curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/category/update \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"workspace_id": "1234567890",
"category_id": "1234567890",
"name": "Invoice",
"category_prompt": "VAT invoice, including fields such as invoice code, invoice number, etc.",
"category_keyword_rules": {
"positive_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": [
"invoice number",
"buyer name",
"total amount"
]
}
],
"negative_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": [
"invoice number",
"buyer name",
"total amount"
]
}
]
},
"extract_model": "Acgpt",
"with_detail": true
}
'import requests
url = "https://docflow.textin.com/api/app-api/sip/platform/v2/category/update"
payload = {
"workspace_id": "1234567890",
"category_id": "1234567890",
"name": "Invoice",
"category_prompt": "VAT invoice, including fields such as invoice code, invoice number, etc.",
"category_keyword_rules": {
"positive_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": ["invoice number", "buyer name", "total amount"]
}
],
"negative_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": ["invoice number", "buyer name", "total amount"]
}
]
},
"extract_model": "Acgpt",
"with_detail": True
}
headers = {
"x-ti-app-id": "<api-key>",
"x-ti-secret-code": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-ti-app-id': '<api-key>',
'x-ti-secret-code': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
workspace_id: '1234567890',
category_id: '1234567890',
name: 'Invoice',
category_prompt: 'VAT invoice, including fields such as invoice code, invoice number, etc.',
category_keyword_rules: {
positive_rules: [
{
group_name: 'Core invoice elements',
min_hit: 2,
words: ['invoice number', 'buyer name', 'total amount']
}
],
negative_rules: [
{
group_name: 'Core invoice elements',
min_hit: 2,
words: ['invoice number', 'buyer name', 'total amount']
}
]
},
extract_model: 'Acgpt',
with_detail: true
})
};
fetch('https://docflow.textin.com/api/app-api/sip/platform/v2/category/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://docflow.textin.com/api/app-api/sip/platform/v2/category/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workspace_id' => '1234567890',
'category_id' => '1234567890',
'name' => 'Invoice',
'category_prompt' => 'VAT invoice, including fields such as invoice code, invoice number, etc.',
'category_keyword_rules' => [
'positive_rules' => [
[
'group_name' => 'Core invoice elements',
'min_hit' => 2,
'words' => [
'invoice number',
'buyer name',
'total amount'
]
]
],
'negative_rules' => [
[
'group_name' => 'Core invoice elements',
'min_hit' => 2,
'words' => [
'invoice number',
'buyer name',
'total amount'
]
]
]
],
'extract_model' => 'Acgpt',
'with_detail' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ti-app-id: <api-key>",
"x-ti-secret-code: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://docflow.textin.com/api/app-api/sip/platform/v2/category/update"
payload := strings.NewReader("{\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"Invoice\",\n \"category_prompt\": \"VAT invoice, including fields such as invoice code, invoice number, etc.\",\n \"category_keyword_rules\": {\n \"positive_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ],\n \"negative_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ]\n },\n \"extract_model\": \"Acgpt\",\n \"with_detail\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ti-app-id", "<api-key>")
req.Header.Add("x-ti-secret-code", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://docflow.textin.com/api/app-api/sip/platform/v2/category/update")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"Invoice\",\n \"category_prompt\": \"VAT invoice, including fields such as invoice code, invoice number, etc.\",\n \"category_keyword_rules\": {\n \"positive_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ],\n \"negative_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ]\n },\n \"extract_model\": \"Acgpt\",\n \"with_detail\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.com/api/app-api/sip/platform/v2/category/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ti-app-id"] = '<api-key>'
request["x-ti-secret-code"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"Invoice\",\n \"category_prompt\": \"VAT invoice, including fields such as invoice code, invoice number, etc.\",\n \"category_keyword_rules\": {\n \"positive_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ],\n \"negative_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ]\n },\n \"extract_model\": \"Acgpt\",\n \"with_detail\": true\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"category_prompt": "<string>",
"category_keyword_rules": {
"positive_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": [
"invoice number",
"buyer name",
"total amount"
]
}
],
"negative_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": [
"invoice number",
"buyer name",
"total amount"
]
}
]
},
"extract_model": "<string>",
"enabled": 123
}
}Update File Category
Update the specified file category information.
Note: Setting extract_model will cascade override the extraction model of all fields and tables under this category.
When updating, omit category_keyword_rules or set it to null to keep existing rules; send a valid object to replace all rules; only {"positive_rules":[],"negative_rules":[]} clears them. {}, blank strings, and invalid structures return a parameter error. A same-type rule group duplicate in another enabled category in the workspace returns a conflict error. Parameter validation error codes: 1005025065–1005025069; cross-category rule-group conflicts reuse 1005015019.
curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/category/update \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"workspace_id": "1234567890",
"category_id": "1234567890",
"name": "Invoice",
"category_prompt": "VAT invoice, including fields such as invoice code, invoice number, etc.",
"category_keyword_rules": {
"positive_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": [
"invoice number",
"buyer name",
"total amount"
]
}
],
"negative_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": [
"invoice number",
"buyer name",
"total amount"
]
}
]
},
"extract_model": "Acgpt",
"with_detail": true
}
'import requests
url = "https://docflow.textin.com/api/app-api/sip/platform/v2/category/update"
payload = {
"workspace_id": "1234567890",
"category_id": "1234567890",
"name": "Invoice",
"category_prompt": "VAT invoice, including fields such as invoice code, invoice number, etc.",
"category_keyword_rules": {
"positive_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": ["invoice number", "buyer name", "total amount"]
}
],
"negative_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": ["invoice number", "buyer name", "total amount"]
}
]
},
"extract_model": "Acgpt",
"with_detail": True
}
headers = {
"x-ti-app-id": "<api-key>",
"x-ti-secret-code": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-ti-app-id': '<api-key>',
'x-ti-secret-code': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
workspace_id: '1234567890',
category_id: '1234567890',
name: 'Invoice',
category_prompt: 'VAT invoice, including fields such as invoice code, invoice number, etc.',
category_keyword_rules: {
positive_rules: [
{
group_name: 'Core invoice elements',
min_hit: 2,
words: ['invoice number', 'buyer name', 'total amount']
}
],
negative_rules: [
{
group_name: 'Core invoice elements',
min_hit: 2,
words: ['invoice number', 'buyer name', 'total amount']
}
]
},
extract_model: 'Acgpt',
with_detail: true
})
};
fetch('https://docflow.textin.com/api/app-api/sip/platform/v2/category/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://docflow.textin.com/api/app-api/sip/platform/v2/category/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workspace_id' => '1234567890',
'category_id' => '1234567890',
'name' => 'Invoice',
'category_prompt' => 'VAT invoice, including fields such as invoice code, invoice number, etc.',
'category_keyword_rules' => [
'positive_rules' => [
[
'group_name' => 'Core invoice elements',
'min_hit' => 2,
'words' => [
'invoice number',
'buyer name',
'total amount'
]
]
],
'negative_rules' => [
[
'group_name' => 'Core invoice elements',
'min_hit' => 2,
'words' => [
'invoice number',
'buyer name',
'total amount'
]
]
]
],
'extract_model' => 'Acgpt',
'with_detail' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ti-app-id: <api-key>",
"x-ti-secret-code: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://docflow.textin.com/api/app-api/sip/platform/v2/category/update"
payload := strings.NewReader("{\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"Invoice\",\n \"category_prompt\": \"VAT invoice, including fields such as invoice code, invoice number, etc.\",\n \"category_keyword_rules\": {\n \"positive_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ],\n \"negative_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ]\n },\n \"extract_model\": \"Acgpt\",\n \"with_detail\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ti-app-id", "<api-key>")
req.Header.Add("x-ti-secret-code", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://docflow.textin.com/api/app-api/sip/platform/v2/category/update")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"Invoice\",\n \"category_prompt\": \"VAT invoice, including fields such as invoice code, invoice number, etc.\",\n \"category_keyword_rules\": {\n \"positive_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ],\n \"negative_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ]\n },\n \"extract_model\": \"Acgpt\",\n \"with_detail\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.com/api/app-api/sip/platform/v2/category/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ti-app-id"] = '<api-key>'
request["x-ti-secret-code"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"Invoice\",\n \"category_prompt\": \"VAT invoice, including fields such as invoice code, invoice number, etc.\",\n \"category_keyword_rules\": {\n \"positive_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ],\n \"negative_rules\": [\n {\n \"group_name\": \"Core invoice elements\",\n \"min_hit\": 2,\n \"words\": [\n \"invoice number\",\n \"buyer name\",\n \"total amount\"\n ]\n }\n ]\n },\n \"extract_model\": \"Acgpt\",\n \"with_detail\": true\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"category_prompt": "<string>",
"category_keyword_rules": {
"positive_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": [
"invoice number",
"buyer name",
"total amount"
]
}
],
"negative_rules": [
{
"group_name": "Core invoice elements",
"min_hit": 2,
"words": [
"invoice number",
"buyer name",
"total amount"
]
}
]
},
"extract_model": "<string>",
"enabled": 123
}
}Body
Workspace ID
"1234567890"
File category ID
"1234567890"
File category name
50"Invoice"
Prompt for classification
150"VAT invoice, including fields such as invoice code, invoice number, etc."
Category keyword rules. Omit or null=no change; a valid object=full replacement; both positive_rules and negative_rules as empty arrays=clear.
{} and blank strings are not accepted.
Show child attributes
Show child attributes
Enabled status
- 0: Disabled
- 1: Enabled
- 2: Draft
0, 1, 2 Extraction model, cascades to all fields and tables when set
- Auto: Automatically matches the extraction model
- Acgpt: Fast speed with stable extraction results
- Acgpt-VL: VLM, suitable for simple extraction (≤10 pages)
- DF-M1: Suitable for complex document understanding
Auto, Acgpt, Acgpt-VL, DF-M1 "Acgpt"
Whether to return full details. When true, the response returns category self info (without child-level fields/tables). When not set or false, only code/msg is returned.

