跳转到主要内容
POST
/
api
/
app-api
/
sip
/
platform
/
v2
/
category
/
tables
/
update
更新单个文件类别表格
curl --request POST \
  --url https://docflow.textin.com/api/app-api/sip/platform/v2/category/tables/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",
  "table_id": "1234567890",
  "collect_from_multi_table": true,
  "name": "表格1",
  "prompt": "请抽取每行的品名、数量和金额",
  "extract_model": "Model 1",
  "with_detail": true
}
'
{
  "code": 200,
  "msg": "<string>",
  "result": {
    "id": "1234567890",
    "name": "表格1",
    "description": "表格描述",
    "prompt": "请抽取每行的品名、数量和金额",
    "collect_from_multi_table": true,
    "extract_model": "Model 1",
    "fields": [
      {
        "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": "Model 1"
      }
    ]
  }
}

授权

x-ti-app-id
string
header
必填
x-ti-secret-code
string
header
必填

请求体

application/json
workspace_id
string
必填

空间ID

示例:

"1234567890"

category_id
string
必填

文件类别ID

示例:

"1234567890"

table_id
string
必填

表格ID

示例:

"1234567890"

collect_from_multi_table
boolean
必填

多表合并,抽取模型 Model 3 暂不支持多表合并

示例:

true

name
string

表格名称

Maximum string length: 50
示例:

"表格1"

prompt
string

表格语义抽取提示词

Maximum string length: 200
示例:

"请抽取每行的品名、数量和金额"

extract_model
enum<string>

表格级抽取模型

  • Model 1: 速度快,抽取结果稳定
  • Model 2: 适用复杂文档理解
  • Model 3: 多模态,适用简单抽取
可用选项:
Model 1,
Model 2,
Model 3
示例:

"Model 1"

with_detail
boolean

是否返回完整详情

响应

200 - application/json

成功更新文件类别表格

code
integer
必填

状态码

示例:

200

msg
string
必填

状态描述

result
object

with_detail=true 时返回更新后的表格信息,否则为 null