API Reference · Key Extraction v3

Templates

เทมเพลตเป็นเวอร์ชัน immutable งานจะ snapshot schema, instructions และ review_threshold ตอนรับคำขอ เพื่อให้ผลย้อนหลังทำซ้ำได้เมื่อเทมเพลตถูกแก้

Create template (version 1)

POSThttps://backend.aksonocr.com/api/v3/key-extract/templates
ฟิลด์ชนิดจำเป็นรายละเอียด
namestringใช่1–200 ตัวอักษร
data_schemaobjectใช่JSON Schema subset เดียวกับงาน
descriptionstringไม่≤ 2,000
instructionsstringไม่≤ 10,000
review_thresholdnumberไม่0–1
json
{
"name": "Thai Invoice",
"description": "Thai tax invoice",
"data_schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"invoice_no": { "type": "string" },
"line_items": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"description": { "type": "string" },
"amount": { "type": "number" }
}
}
}
}
},
"instructions": "Use the net total after VAT.",
"review_threshold": 0.8
}

สำเร็จได้ 201 คืน id และ version: 1

Create next version

POSThttps://backend.aksonocr.com/api/v3/key-extract/templates/{template_id}/versions

Body ชุดเดียวกับตอนสร้าง 201 เวอร์ชันใหม่ งานเก่ายังผูกเวอร์ชันเดิม ห้าม override schema ตอนสร้างงาน — สร้างเวอร์ชันใหม่หรือส่ง data_schema ทั้งก้อน

Get template

GEThttps://backend.aksonocr.com/api/v3/key-extract/templates/{template_id}
Queryรายละเอียด
versionถ้าไม่ระบุ คืนเวอร์ชันล่าสุด

List templates

GEThttps://backend.aksonocr.com/api/v3/key-extract/templates

Cursor pagination เหมือน jobs: cursor, limit (1–100)

json
{
"data": [
{
"id": "tpl_invoice_th",
"version": 7,
"name": "Thai Invoice",
"status": "active",
"schema_sha256": "5d3a...",
"created_at": "2026-09-03T10:00:00Z"
}
],
"has_more": false,
"next_cursor": null,
"request_id": "req_01J..."
}

Archive template

DELETEhttps://backend.aksonocr.com/api/v3/key-extract/templates/{template_id}

204 งานใหม่ห้ามอ้างแบบไม่ปัก version งานเก่าไม่เปลี่ยน

ขอบเขตเทมเพลตเป็นต่อ tenant/project ทุก query กรองก่อนดู id