更新单个文件类别字段
curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/category/fields/update \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"field_id": "1234567890",
"workspace_id": "1234567890",
"category_id": "1234567890",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"use_prompt": true,
"alias": [
"发票号",
"票号"
],
"identity": "invoice_number",
"multi_value": true,
"duplicate_value_distinct": true,
"transform_settings": {
"datetime_settings": {
"format": "yyyy-MM-dd"
},
"enumerate_settings": {
"items": [
"增值税专用发票",
"增值税普通发票",
"电子发票"
]
},
"regex_settings": {
"match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": {
"default_value": "N/A"
}
},
"extract_model": "Acgpt",
"table_id": "1234567890",
"with_detail": true
}
'import requests
url = "https://docflow.textin.com/api/app-api/sip/platform/v2/category/fields/update"
payload = {
"field_id": "1234567890",
"workspace_id": "1234567890",
"category_id": "1234567890",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"use_prompt": True,
"alias": ["发票号", "票号"],
"identity": "invoice_number",
"multi_value": True,
"duplicate_value_distinct": True,
"transform_settings": {
"datetime_settings": { "format": "yyyy-MM-dd" },
"enumerate_settings": { "items": ["增值税专用发票", "增值税普通发票", "电子发票"] },
"regex_settings": {
"match": "^(\d{4})-(\d{2})-(\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": { "default_value": "N/A" }
},
"extract_model": "Acgpt",
"table_id": "1234567890",
"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({
field_id: '1234567890',
workspace_id: '1234567890',
category_id: '1234567890',
name: '<string>',
description: '<string>',
prompt: '<string>',
use_prompt: true,
alias: ['发票号', '票号'],
identity: 'invoice_number',
multi_value: true,
duplicate_value_distinct: true,
transform_settings: {
datetime_settings: {format: 'yyyy-MM-dd'},
enumerate_settings: {items: ['增值税专用发票', '增值税普通发票', '电子发票']},
regex_settings: {match: '^(\d{4})-(\d{2})-(\d{2})$', replace: '$1/$2/$3'},
mismatch_action: {default_value: 'N/A'}
},
extract_model: 'Acgpt',
table_id: '1234567890',
with_detail: true
})
};
fetch('https://docflow.textin.com/api/app-api/sip/platform/v2/category/fields/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/fields/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([
'field_id' => '1234567890',
'workspace_id' => '1234567890',
'category_id' => '1234567890',
'name' => '<string>',
'description' => '<string>',
'prompt' => '<string>',
'use_prompt' => true,
'alias' => [
'发票号',
'票号'
],
'identity' => 'invoice_number',
'multi_value' => true,
'duplicate_value_distinct' => true,
'transform_settings' => [
'datetime_settings' => [
'format' => 'yyyy-MM-dd'
],
'enumerate_settings' => [
'items' => [
'增值税专用发票',
'增值税普通发票',
'电子发票'
]
],
'regex_settings' => [
'match' => '^(\\d{4})-(\\d{2})-(\\d{2})$',
'replace' => '$1/$2/$3'
],
'mismatch_action' => [
'default_value' => 'N/A'
]
],
'extract_model' => 'Acgpt',
'table_id' => '1234567890',
'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/fields/update"
payload := strings.NewReader("{\n \"field_id\": \"1234567890\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"发票号\",\n \"票号\"\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 \"增值税专用发票\",\n \"增值税普通发票\",\n \"电子发票\"\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 \"extract_model\": \"Acgpt\",\n \"table_id\": \"1234567890\",\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/fields/update")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"field_id\": \"1234567890\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"发票号\",\n \"票号\"\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 \"增值税专用发票\",\n \"增值税普通发票\",\n \"电子发票\"\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 \"extract_model\": \"Acgpt\",\n \"table_id\": \"1234567890\",\n \"with_detail\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.com/api/app-api/sip/platform/v2/category/fields/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 \"field_id\": \"1234567890\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"发票号\",\n \"票号\"\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 \"增值税专用发票\",\n \"增值税普通发票\",\n \"电子发票\"\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 \"extract_model\": \"Acgpt\",\n \"table_id\": \"1234567890\",\n \"with_detail\": true\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"name": "发票代码",
"description": "发票代码描述",
"prompt": "<string>",
"use_prompt": true,
"alias": [
"发票号",
"票号",
"Invoice No."
],
"identity": "invoice_number",
"multi_value": true,
"duplicate_value_distinct": true,
"transform_settings": {
"datetime_settings": {
"format": "yyyy-MM-dd"
},
"enumerate_settings": {
"items": [
"增值税专用发票",
"增值税普通发票",
"电子发票"
]
},
"regex_settings": {
"match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": {
"default_value": "N/A"
}
},
"id": "1234567890",
"extract_model": "Acgpt"
}
}已废弃
更新单个文件类别字段
更新指定文件类别字段的信息,支持普通字段和表格字段
⚠️ 该接口目前仍在提供服务,但后续将停止维护。推荐使用 更新文件类别字段 接口替代。
POST
/
api
/
app-api
/
sip
/
platform
/
v2
/
category
/
fields
/
update
更新单个文件类别字段
curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/category/fields/update \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"field_id": "1234567890",
"workspace_id": "1234567890",
"category_id": "1234567890",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"use_prompt": true,
"alias": [
"发票号",
"票号"
],
"identity": "invoice_number",
"multi_value": true,
"duplicate_value_distinct": true,
"transform_settings": {
"datetime_settings": {
"format": "yyyy-MM-dd"
},
"enumerate_settings": {
"items": [
"增值税专用发票",
"增值税普通发票",
"电子发票"
]
},
"regex_settings": {
"match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": {
"default_value": "N/A"
}
},
"extract_model": "Acgpt",
"table_id": "1234567890",
"with_detail": true
}
'import requests
url = "https://docflow.textin.com/api/app-api/sip/platform/v2/category/fields/update"
payload = {
"field_id": "1234567890",
"workspace_id": "1234567890",
"category_id": "1234567890",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"use_prompt": True,
"alias": ["发票号", "票号"],
"identity": "invoice_number",
"multi_value": True,
"duplicate_value_distinct": True,
"transform_settings": {
"datetime_settings": { "format": "yyyy-MM-dd" },
"enumerate_settings": { "items": ["增值税专用发票", "增值税普通发票", "电子发票"] },
"regex_settings": {
"match": "^(\d{4})-(\d{2})-(\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": { "default_value": "N/A" }
},
"extract_model": "Acgpt",
"table_id": "1234567890",
"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({
field_id: '1234567890',
workspace_id: '1234567890',
category_id: '1234567890',
name: '<string>',
description: '<string>',
prompt: '<string>',
use_prompt: true,
alias: ['发票号', '票号'],
identity: 'invoice_number',
multi_value: true,
duplicate_value_distinct: true,
transform_settings: {
datetime_settings: {format: 'yyyy-MM-dd'},
enumerate_settings: {items: ['增值税专用发票', '增值税普通发票', '电子发票']},
regex_settings: {match: '^(\d{4})-(\d{2})-(\d{2})$', replace: '$1/$2/$3'},
mismatch_action: {default_value: 'N/A'}
},
extract_model: 'Acgpt',
table_id: '1234567890',
with_detail: true
})
};
fetch('https://docflow.textin.com/api/app-api/sip/platform/v2/category/fields/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/fields/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([
'field_id' => '1234567890',
'workspace_id' => '1234567890',
'category_id' => '1234567890',
'name' => '<string>',
'description' => '<string>',
'prompt' => '<string>',
'use_prompt' => true,
'alias' => [
'发票号',
'票号'
],
'identity' => 'invoice_number',
'multi_value' => true,
'duplicate_value_distinct' => true,
'transform_settings' => [
'datetime_settings' => [
'format' => 'yyyy-MM-dd'
],
'enumerate_settings' => [
'items' => [
'增值税专用发票',
'增值税普通发票',
'电子发票'
]
],
'regex_settings' => [
'match' => '^(\\d{4})-(\\d{2})-(\\d{2})$',
'replace' => '$1/$2/$3'
],
'mismatch_action' => [
'default_value' => 'N/A'
]
],
'extract_model' => 'Acgpt',
'table_id' => '1234567890',
'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/fields/update"
payload := strings.NewReader("{\n \"field_id\": \"1234567890\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"发票号\",\n \"票号\"\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 \"增值税专用发票\",\n \"增值税普通发票\",\n \"电子发票\"\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 \"extract_model\": \"Acgpt\",\n \"table_id\": \"1234567890\",\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/fields/update")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"field_id\": \"1234567890\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"发票号\",\n \"票号\"\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 \"增值税专用发票\",\n \"增值税普通发票\",\n \"电子发票\"\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 \"extract_model\": \"Acgpt\",\n \"table_id\": \"1234567890\",\n \"with_detail\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.com/api/app-api/sip/platform/v2/category/fields/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 \"field_id\": \"1234567890\",\n \"workspace_id\": \"1234567890\",\n \"category_id\": \"1234567890\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"prompt\": \"<string>\",\n \"use_prompt\": true,\n \"alias\": [\n \"发票号\",\n \"票号\"\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 \"增值税专用发票\",\n \"增值税普通发票\",\n \"电子发票\"\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 \"extract_model\": \"Acgpt\",\n \"table_id\": \"1234567890\",\n \"with_detail\": true\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"name": "发票代码",
"description": "发票代码描述",
"prompt": "<string>",
"use_prompt": true,
"alias": [
"发票号",
"票号",
"Invoice No."
],
"identity": "invoice_number",
"multi_value": true,
"duplicate_value_distinct": true,
"transform_settings": {
"datetime_settings": {
"format": "yyyy-MM-dd"
},
"enumerate_settings": {
"items": [
"增值税专用发票",
"增值税普通发票",
"电子发票"
]
},
"regex_settings": {
"match": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"replace": "$1/$2/$3"
},
"mismatch_action": {
"default_value": "N/A"
}
},
"id": "1234567890",
"extract_model": "Acgpt"
}
}请求体
application/json
批量更新字段的单项配置(仅包含可更新字段,multi_value/duplicate_value_distinct 不可通过此接口修改)
字段ID
示例:
"1234567890"
空间ID
示例:
"1234567890"
文件类别ID
示例:
"1234567890"
字段名称
字段描述
语义抽取提示词
是否使用语义提示词
字段别名。不传=不修改,传空数组[]=清空别名,传非空数组=覆盖
示例:
["发票号", "票号"]
导出字段名。不传=不修改,传空字符串""=清空,传非空值=覆盖
示例:
"invoice_number"
是否多值抽取。不传=不修改
是否重复值去重,仅当 multi_value 为 true 时有效。不传=不修改
字段输出转换配置,对抽取结果进行格式化处理后再输出。
Show child attributes
Show child attributes
字段级抽取模型,仅普通字段可独立设置,表格字段不可设置。不传则保持原有配置。
- Auto: 智能匹配抽取模型
- Acgpt: 速度快,抽取结果稳定
- Acgpt-VL: 多模态,适用简单抽取(≤10 页)
- DF-M1: 适用复杂文档理解
可用选项:
Auto, Acgpt, Acgpt-VL, DF-M1 示例:
"Acgpt"
表格ID
- 对普通字段可不传
- 对表格字段需要传入其所属的表格ID
示例:
"1234567890"
是否返回完整详情。传 true 时响应返回更新后的字段完整信息。 不传或为 false 时仅返回 code/msg。
⌘I

