curl --request POST \
--url https://docflow.textin.ai/api/app-api/sip/platform/v2/category/fields/add \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"name": "Invoice Code",
"workspace_id": "1234567890",
"category_id": "1234567890",
"description": "Invoice code description",
"prompt": "<string>",
"use_prompt": true,
"alias": [
"Invoice No.",
"Bill Number"
],
"identity": "invoice_number",
"multi_value": true,
"duplicate_value_distinct": true,
"transform_settings": {
"datetime_settings": {
"format": "yyyy-MM-dd"
},
"enumerate_settings": {
"items": [
"VAT Special Invoice",
"VAT General Invoice",
"Electronic Invoice"
]
},
"regex_settings": {
"match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": {
"default_value": "N/A"
}
},
"table_id": "1234567890",
"extract_model": "Acgpt",
"with_detail": true
}
'import requests
url = "https://docflow.textin.ai/api/app-api/sip/platform/v2/category/fields/add"
payload = {
"name": "Invoice Code",
"workspace_id": "1234567890",
"category_id": "1234567890",
"description": "Invoice code description",
"prompt": "<string>",
"use_prompt": True,
"alias": ["Invoice No.", "Bill Number"],
"identity": "invoice_number",
"multi_value": True,
"duplicate_value_distinct": True,
"transform_settings": {
"datetime_settings": { "format": "yyyy-MM-dd" },
"enumerate_settings": { "items": ["VAT Special Invoice", "VAT General Invoice", "Electronic Invoice"] },
"regex_settings": {
"match": "^(\d{4})-(\d{2})-(\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": { "default_value": "N/A" }
},
"table_id": "1234567890",
"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({
name: 'Invoice Code',
workspace_id: '1234567890',
category_id: '1234567890',
description: 'Invoice code description',
prompt: '<string>',
use_prompt: true,
alias: ['Invoice No.', 'Bill Number'],
identity: 'invoice_number',
multi_value: true,
duplicate_value_distinct: true,
transform_settings: {
datetime_settings: {format: 'yyyy-MM-dd'},
enumerate_settings: {items: ['VAT Special Invoice', 'VAT General Invoice', 'Electronic Invoice']},
regex_settings: {match: '^(\d{4})-(\d{2})-(\d{2})$', replace: '$1/$2/$3'},
mismatch_action: {default_value: 'N/A'}
},
table_id: '1234567890',
extract_model: 'Acgpt',
with_detail: true
})
};
fetch('https://docflow.textin.ai/api/app-api/sip/platform/v2/category/fields/add', 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.ai/api/app-api/sip/platform/v2/category/fields/add",
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([
'name' => 'Invoice Code',
'workspace_id' => '1234567890',
'category_id' => '1234567890',
'description' => 'Invoice code description',
'prompt' => '<string>',
'use_prompt' => true,
'alias' => [
'Invoice No.',
'Bill Number'
],
'identity' => 'invoice_number',
'multi_value' => true,
'duplicate_value_distinct' => true,
'transform_settings' => [
'datetime_settings' => [
'format' => 'yyyy-MM-dd'
],
'enumerate_settings' => [
'items' => [
'VAT Special Invoice',
'VAT General Invoice',
'Electronic Invoice'
]
],
'regex_settings' => [
'match' => '^(\\d{4})-(\\d{2})-(\\d{2})$',
'replace' => '$1/$2/$3'
],
'mismatch_action' => [
'default_value' => 'N/A'
]
],
'table_id' => '1234567890',
'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.ai/api/app-api/sip/platform/v2/category/fields/add"
payload := strings.NewReader("{\n \"name\": \"Invoice Code\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"description\": \"Invoice code description\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"Invoice No.\",\n \"Bill Number\"\n ],\n \"identity\": \"invoice_number\",\n \"multi_value\": true,\n \"duplicate_value_distinct\": true,\n \"transform_settings\": {\n \"datetime_settings\": {\n \"format\": \"yyyy-MM-dd\"\n },\n \"enumerate_settings\": {\n \"items\": [\n \"VAT Special Invoice\",\n \"VAT General Invoice\",\n \"Electronic Invoice\"\n ]\n },\n \"regex_settings\": {\n \"match\": \"^(\\\\d{4})-(\\\\d{2})-(\\\\d{2})$\",\n \"replace\": \"$1/$2/$3\"\n },\n \"mismatch_action\": {\n \"default_value\": \"N/A\"\n }\n },\n \"table_id\": \"1234567890\",\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.ai/api/app-api/sip/platform/v2/category/fields/add")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Invoice Code\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"description\": \"Invoice code description\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"Invoice No.\",\n \"Bill Number\"\n ],\n \"identity\": \"invoice_number\",\n \"multi_value\": true,\n \"duplicate_value_distinct\": true,\n \"transform_settings\": {\n \"datetime_settings\": {\n \"format\": \"yyyy-MM-dd\"\n },\n \"enumerate_settings\": {\n \"items\": [\n \"VAT Special Invoice\",\n \"VAT General Invoice\",\n \"Electronic Invoice\"\n ]\n },\n \"regex_settings\": {\n \"match\": \"^(\\\\d{4})-(\\\\d{2})-(\\\\d{2})$\",\n \"replace\": \"$1/$2/$3\"\n },\n \"mismatch_action\": {\n \"default_value\": \"N/A\"\n }\n },\n \"table_id\": \"1234567890\",\n \"extract_model\": \"Acgpt\",\n \"with_detail\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.ai/api/app-api/sip/platform/v2/category/fields/add")
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 \"name\": \"Invoice Code\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"description\": \"Invoice code description\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"Invoice No.\",\n \"Bill Number\"\n ],\n \"identity\": \"invoice_number\",\n \"multi_value\": true,\n \"duplicate_value_distinct\": true,\n \"transform_settings\": {\n \"datetime_settings\": {\n \"format\": \"yyyy-MM-dd\"\n },\n \"enumerate_settings\": {\n \"items\": [\n \"VAT Special Invoice\",\n \"VAT General Invoice\",\n \"Electronic Invoice\"\n ]\n },\n \"regex_settings\": {\n \"match\": \"^(\\\\d{4})-(\\\\d{2})-(\\\\d{2})$\",\n \"replace\": \"$1/$2/$3\"\n },\n \"mismatch_action\": {\n \"default_value\": \"N/A\"\n }\n },\n \"table_id\": \"1234567890\",\n \"extract_model\": \"Acgpt\",\n \"with_detail\": true\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"field_id": "1234567890",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"use_prompt": true,
"alias": [
"<string>"
],
"identity": "<string>",
"multi_value": true,
"duplicate_value_distinct": true,
"transform_settings": {
"datetime_settings": {
"format": "yyyy-MM-dd"
},
"enumerate_settings": {
"items": [
"VAT Special Invoice",
"VAT General Invoice",
"Electronic Invoice"
]
},
"regex_settings": {
"match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": {
"default_value": "N/A"
}
},
"extract_model": "<string>",
"enabled": 123
}
}Add Single File Category Field
Add a new field under the specified file category, supports both regular fields and table fields
⚠️ This endpoint is still available but will no longer be maintained. Please use Add File Category Fields instead.
curl --request POST \
--url https://docflow.textin.ai/api/app-api/sip/platform/v2/category/fields/add \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"name": "Invoice Code",
"workspace_id": "1234567890",
"category_id": "1234567890",
"description": "Invoice code description",
"prompt": "<string>",
"use_prompt": true,
"alias": [
"Invoice No.",
"Bill Number"
],
"identity": "invoice_number",
"multi_value": true,
"duplicate_value_distinct": true,
"transform_settings": {
"datetime_settings": {
"format": "yyyy-MM-dd"
},
"enumerate_settings": {
"items": [
"VAT Special Invoice",
"VAT General Invoice",
"Electronic Invoice"
]
},
"regex_settings": {
"match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": {
"default_value": "N/A"
}
},
"table_id": "1234567890",
"extract_model": "Acgpt",
"with_detail": true
}
'import requests
url = "https://docflow.textin.ai/api/app-api/sip/platform/v2/category/fields/add"
payload = {
"name": "Invoice Code",
"workspace_id": "1234567890",
"category_id": "1234567890",
"description": "Invoice code description",
"prompt": "<string>",
"use_prompt": True,
"alias": ["Invoice No.", "Bill Number"],
"identity": "invoice_number",
"multi_value": True,
"duplicate_value_distinct": True,
"transform_settings": {
"datetime_settings": { "format": "yyyy-MM-dd" },
"enumerate_settings": { "items": ["VAT Special Invoice", "VAT General Invoice", "Electronic Invoice"] },
"regex_settings": {
"match": "^(\d{4})-(\d{2})-(\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": { "default_value": "N/A" }
},
"table_id": "1234567890",
"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({
name: 'Invoice Code',
workspace_id: '1234567890',
category_id: '1234567890',
description: 'Invoice code description',
prompt: '<string>',
use_prompt: true,
alias: ['Invoice No.', 'Bill Number'],
identity: 'invoice_number',
multi_value: true,
duplicate_value_distinct: true,
transform_settings: {
datetime_settings: {format: 'yyyy-MM-dd'},
enumerate_settings: {items: ['VAT Special Invoice', 'VAT General Invoice', 'Electronic Invoice']},
regex_settings: {match: '^(\d{4})-(\d{2})-(\d{2})$', replace: '$1/$2/$3'},
mismatch_action: {default_value: 'N/A'}
},
table_id: '1234567890',
extract_model: 'Acgpt',
with_detail: true
})
};
fetch('https://docflow.textin.ai/api/app-api/sip/platform/v2/category/fields/add', 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.ai/api/app-api/sip/platform/v2/category/fields/add",
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([
'name' => 'Invoice Code',
'workspace_id' => '1234567890',
'category_id' => '1234567890',
'description' => 'Invoice code description',
'prompt' => '<string>',
'use_prompt' => true,
'alias' => [
'Invoice No.',
'Bill Number'
],
'identity' => 'invoice_number',
'multi_value' => true,
'duplicate_value_distinct' => true,
'transform_settings' => [
'datetime_settings' => [
'format' => 'yyyy-MM-dd'
],
'enumerate_settings' => [
'items' => [
'VAT Special Invoice',
'VAT General Invoice',
'Electronic Invoice'
]
],
'regex_settings' => [
'match' => '^(\\d{4})-(\\d{2})-(\\d{2})$',
'replace' => '$1/$2/$3'
],
'mismatch_action' => [
'default_value' => 'N/A'
]
],
'table_id' => '1234567890',
'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.ai/api/app-api/sip/platform/v2/category/fields/add"
payload := strings.NewReader("{\n \"name\": \"Invoice Code\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"description\": \"Invoice code description\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"Invoice No.\",\n \"Bill Number\"\n ],\n \"identity\": \"invoice_number\",\n \"multi_value\": true,\n \"duplicate_value_distinct\": true,\n \"transform_settings\": {\n \"datetime_settings\": {\n \"format\": \"yyyy-MM-dd\"\n },\n \"enumerate_settings\": {\n \"items\": [\n \"VAT Special Invoice\",\n \"VAT General Invoice\",\n \"Electronic Invoice\"\n ]\n },\n \"regex_settings\": {\n \"match\": \"^(\\\\d{4})-(\\\\d{2})-(\\\\d{2})$\",\n \"replace\": \"$1/$2/$3\"\n },\n \"mismatch_action\": {\n \"default_value\": \"N/A\"\n }\n },\n \"table_id\": \"1234567890\",\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.ai/api/app-api/sip/platform/v2/category/fields/add")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Invoice Code\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"description\": \"Invoice code description\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"Invoice No.\",\n \"Bill Number\"\n ],\n \"identity\": \"invoice_number\",\n \"multi_value\": true,\n \"duplicate_value_distinct\": true,\n \"transform_settings\": {\n \"datetime_settings\": {\n \"format\": \"yyyy-MM-dd\"\n },\n \"enumerate_settings\": {\n \"items\": [\n \"VAT Special Invoice\",\n \"VAT General Invoice\",\n \"Electronic Invoice\"\n ]\n },\n \"regex_settings\": {\n \"match\": \"^(\\\\d{4})-(\\\\d{2})-(\\\\d{2})$\",\n \"replace\": \"$1/$2/$3\"\n },\n \"mismatch_action\": {\n \"default_value\": \"N/A\"\n }\n },\n \"table_id\": \"1234567890\",\n \"extract_model\": \"Acgpt\",\n \"with_detail\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.ai/api/app-api/sip/platform/v2/category/fields/add")
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 \"name\": \"Invoice Code\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"description\": \"Invoice code description\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"Invoice No.\",\n \"Bill Number\"\n ],\n \"identity\": \"invoice_number\",\n \"multi_value\": true,\n \"duplicate_value_distinct\": true,\n \"transform_settings\": {\n \"datetime_settings\": {\n \"format\": \"yyyy-MM-dd\"\n },\n \"enumerate_settings\": {\n \"items\": [\n \"VAT Special Invoice\",\n \"VAT General Invoice\",\n \"Electronic Invoice\"\n ]\n },\n \"regex_settings\": {\n \"match\": \"^(\\\\d{4})-(\\\\d{2})-(\\\\d{2})$\",\n \"replace\": \"$1/$2/$3\"\n },\n \"mismatch_action\": {\n \"default_value\": \"N/A\"\n }\n },\n \"table_id\": \"1234567890\",\n \"extract_model\": \"Acgpt\",\n \"with_detail\": true\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"field_id": "1234567890",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"use_prompt": true,
"alias": [
"<string>"
],
"identity": "<string>",
"multi_value": true,
"duplicate_value_distinct": true,
"transform_settings": {
"datetime_settings": {
"format": "yyyy-MM-dd"
},
"enumerate_settings": {
"items": [
"VAT Special Invoice",
"VAT General Invoice",
"Electronic Invoice"
]
},
"regex_settings": {
"match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": {
"default_value": "N/A"
}
},
"extract_model": "<string>",
"enabled": 123
}
}Body
Field name
"Invoice Code"
Workspace ID
"1234567890"
File category ID
"1234567890"
Field description
"Invoice code description"
Semantic extraction prompt
Whether to use semantic prompt
Field aliases. On update: omit=no change, empty array []=clear aliases, non-empty array=override
["Invoice No.", "Bill Number"]
Export field name. On update: omit=no change, empty string ""=clear, non-empty=override
"invoice_number"
Whether to enable multi-value extraction
Whether to deduplicate values, only effective when multi_value is true
Field output transform configuration. Formats the extraction result before output.
Show child attributes
Show child attributes
Table ID
- Not provided or empty: Creates a regular field, result appears in result.fields
- Provide table ID: Creates a table field under the specified table, result appears in result.tables[].fields
"1234567890"
Optional, field-level extraction model, only supported for regular fields (not table fields); if omitted, follows the category-level config (defaults to Auto when the category level is mixed or null)
- 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 includes complete field info. When not set or false, only field_id is returned.

