curl --request POST \
--url https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"ai_function": 1425,
"app_name": "High-speed invoice extraction app",
"app_label": [
"invoice",
"high-speed"
],
"extract_fields": [
{
"field_key": "invoice_no",
"field_name": "Invoice number",
"field_type": "string",
"field_prompt": "Extract the unique invoice number from the invoice."
},
{
"field_key": "invoice_date",
"field_name": "Invoice date",
"field_type": "date",
"field_prompt": "Extract the invoice issue date."
},
{
"field_key": "line_items",
"field_name": "Line items",
"field_type": "table",
"sub_fields": [
{
"field_key": "item_name",
"field_name": "Item name",
"field_type": "string"
},
{
"field_key": "item_date",
"field_name": "Date",
"field_type": "date"
}
]
}
],
"enable_field_value_translation": false
}
'const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ai_function: 1425,
app_name: 'High-speed invoice extraction app',
app_label: ['invoice', 'high-speed'],
extract_fields: [
{
field_key: 'invoice_no',
field_name: 'Invoice number',
field_type: 'string',
field_prompt: 'Extract the unique invoice number from the invoice.'
},
{
field_key: 'invoice_date',
field_name: 'Invoice date',
field_type: 'date',
field_prompt: 'Extract the invoice issue date.'
},
{
field_key: 'line_items',
field_name: 'Line items',
field_type: 'table',
sub_fields: [
{field_key: 'item_name', field_name: 'Item name', field_type: 'string'},
{field_key: 'item_date', field_name: 'Date', field_type: 'date'}
]
}
],
enable_field_value_translation: false
})
};
fetch('https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
response = requests.post(
"https://adp-global.laiye.com/open/agentic_doc_processor/laiye/v1/app-manage/create",
headers={"X-API-KEY": "YOUR_API_KEY"},
json={
"ai_function": 1406,
"app_name": "Purchase order extraction app",
"extract_fields": [
{"field_name": "Order number", "field_type": "string"}
],
"parse_mode": "standard",
},
timeout=60,
)
response.raise_for_status()
result = response.json()
if result.get("code") not in ("success", 200, "200"):
raise RuntimeError(result.get("message") or result.get("code"))
HttpResponse<String> response = Unirest.post("https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ai_function\": 1425,\n \"app_name\": \"High-speed invoice extraction app\",\n \"app_label\": [\n \"invoice\",\n \"high-speed\"\n ],\n \"extract_fields\": [\n {\n \"field_key\": \"invoice_no\",\n \"field_name\": \"Invoice number\",\n \"field_type\": \"string\",\n \"field_prompt\": \"Extract the unique invoice number from the invoice.\"\n },\n {\n \"field_key\": \"invoice_date\",\n \"field_name\": \"Invoice date\",\n \"field_type\": \"date\",\n \"field_prompt\": \"Extract the invoice issue date.\"\n },\n {\n \"field_key\": \"line_items\",\n \"field_name\": \"Line items\",\n \"field_type\": \"table\",\n \"sub_fields\": [\n {\n \"field_key\": \"item_name\",\n \"field_name\": \"Item name\",\n \"field_type\": \"string\"\n },\n {\n \"field_key\": \"item_date\",\n \"field_name\": \"Date\",\n \"field_type\": \"date\"\n }\n ]\n }\n ],\n \"enable_field_value_translation\": false\n}")
.asString();const url = 'https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create';
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ai_function: 1425,
app_name: 'High-speed invoice extraction app',
app_label: ['invoice', 'high-speed'],
extract_fields: [
{
field_key: 'invoice_no',
field_name: 'Invoice number',
field_type: 'string',
field_prompt: 'Extract the unique invoice number from the invoice.'
},
{
field_key: 'invoice_date',
field_name: 'Invoice date',
field_type: 'date',
field_prompt: 'Extract the invoice issue date.'
},
{
field_key: 'line_items',
field_name: 'Line items',
field_type: 'table',
sub_fields: [
{field_key: 'item_name', field_name: 'Item name', field_type: 'string'},
{field_key: 'item_date', field_name: 'Date', field_type: 'date'}
]
}
],
enable_field_value_translation: false
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create"
payload := strings.NewReader("{\n \"ai_function\": 1425,\n \"app_name\": \"High-speed invoice extraction app\",\n \"app_label\": [\n \"invoice\",\n \"high-speed\"\n ],\n \"extract_fields\": [\n {\n \"field_key\": \"invoice_no\",\n \"field_name\": \"Invoice number\",\n \"field_type\": \"string\",\n \"field_prompt\": \"Extract the unique invoice number from the invoice.\"\n },\n {\n \"field_key\": \"invoice_date\",\n \"field_name\": \"Invoice date\",\n \"field_type\": \"date\",\n \"field_prompt\": \"Extract the invoice issue date.\"\n },\n {\n \"field_key\": \"line_items\",\n \"field_name\": \"Line items\",\n \"field_type\": \"table\",\n \"sub_fields\": [\n {\n \"field_key\": \"item_name\",\n \"field_name\": \"Item name\",\n \"field_type\": \"string\"\n },\n {\n \"field_key\": \"item_date\",\n \"field_name\": \"Date\",\n \"field_type\": \"date\"\n }\n ]\n }\n ],\n \"enable_field_value_translation\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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))
}using RestSharp;
var options = new RestClientOptions("https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-API-KEY", "<api-key>");
request.AddJsonBody("{\n \"ai_function\": 1425,\n \"app_name\": \"High-speed invoice extraction app\",\n \"app_label\": [\n \"invoice\",\n \"high-speed\"\n ],\n \"extract_fields\": [\n {\n \"field_key\": \"invoice_no\",\n \"field_name\": \"Invoice number\",\n \"field_type\": \"string\",\n \"field_prompt\": \"Extract the unique invoice number from the invoice.\"\n },\n {\n \"field_key\": \"invoice_date\",\n \"field_name\": \"Invoice date\",\n \"field_type\": \"date\",\n \"field_prompt\": \"Extract the invoice issue date.\"\n },\n {\n \"field_key\": \"line_items\",\n \"field_name\": \"Line items\",\n \"field_type\": \"table\",\n \"sub_fields\": [\n {\n \"field_key\": \"item_name\",\n \"field_name\": \"Item name\",\n \"field_type\": \"string\"\n },\n {\n \"field_key\": \"item_date\",\n \"field_name\": \"Date\",\n \"field_type\": \"date\"\n }\n ]\n }\n ],\n \"enable_field_value_translation\": false\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create",
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([
'ai_function' => 1425,
'app_name' => 'High-speed invoice extraction app',
'app_label' => [
'invoice',
'high-speed'
],
'extract_fields' => [
[
'field_key' => 'invoice_no',
'field_name' => 'Invoice number',
'field_type' => 'string',
'field_prompt' => 'Extract the unique invoice number from the invoice.'
],
[
'field_key' => 'invoice_date',
'field_name' => 'Invoice date',
'field_type' => 'date',
'field_prompt' => 'Extract the invoice issue date.'
],
[
'field_key' => 'line_items',
'field_name' => 'Line items',
'field_type' => 'table',
'sub_fields' => [
[
'field_key' => 'item_name',
'field_name' => 'Item name',
'field_type' => 'string'
],
[
'field_key' => 'item_date',
'field_name' => 'Date',
'field_type' => 'date'
]
]
]
],
'enable_field_value_translation' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"code": "success",
"message": "",
"tips": null,
"data": {
"app_id": "app_abc123",
"app_name": "High-speed invoice extraction app",
"app_label": [
"invoice",
"high-speed"
],
"config_version": "v1"
}
}Create extraction application
Create a standard or high-speed custom extraction application, and configure labels, fields, and extraction settings. Standard applications support parse_mode, source locations, PDF text first, stamp recognition, and related parsing settings. To create a high-speed custom extraction application, set ai_function to 1425 and provide field_key for fields and table sub-fields. High-speed applications do not support standard parsing settings. An HTTP 200 response can still represent a business failure, so callers must check both the HTTP status and the response code.
curl --request POST \
--url https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"ai_function": 1425,
"app_name": "High-speed invoice extraction app",
"app_label": [
"invoice",
"high-speed"
],
"extract_fields": [
{
"field_key": "invoice_no",
"field_name": "Invoice number",
"field_type": "string",
"field_prompt": "Extract the unique invoice number from the invoice."
},
{
"field_key": "invoice_date",
"field_name": "Invoice date",
"field_type": "date",
"field_prompt": "Extract the invoice issue date."
},
{
"field_key": "line_items",
"field_name": "Line items",
"field_type": "table",
"sub_fields": [
{
"field_key": "item_name",
"field_name": "Item name",
"field_type": "string"
},
{
"field_key": "item_date",
"field_name": "Date",
"field_type": "date"
}
]
}
],
"enable_field_value_translation": false
}
'const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ai_function: 1425,
app_name: 'High-speed invoice extraction app',
app_label: ['invoice', 'high-speed'],
extract_fields: [
{
field_key: 'invoice_no',
field_name: 'Invoice number',
field_type: 'string',
field_prompt: 'Extract the unique invoice number from the invoice.'
},
{
field_key: 'invoice_date',
field_name: 'Invoice date',
field_type: 'date',
field_prompt: 'Extract the invoice issue date.'
},
{
field_key: 'line_items',
field_name: 'Line items',
field_type: 'table',
sub_fields: [
{field_key: 'item_name', field_name: 'Item name', field_type: 'string'},
{field_key: 'item_date', field_name: 'Date', field_type: 'date'}
]
}
],
enable_field_value_translation: false
})
};
fetch('https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
response = requests.post(
"https://adp-global.laiye.com/open/agentic_doc_processor/laiye/v1/app-manage/create",
headers={"X-API-KEY": "YOUR_API_KEY"},
json={
"ai_function": 1406,
"app_name": "Purchase order extraction app",
"extract_fields": [
{"field_name": "Order number", "field_type": "string"}
],
"parse_mode": "standard",
},
timeout=60,
)
response.raise_for_status()
result = response.json()
if result.get("code") not in ("success", 200, "200"):
raise RuntimeError(result.get("message") or result.get("code"))
HttpResponse<String> response = Unirest.post("https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ai_function\": 1425,\n \"app_name\": \"High-speed invoice extraction app\",\n \"app_label\": [\n \"invoice\",\n \"high-speed\"\n ],\n \"extract_fields\": [\n {\n \"field_key\": \"invoice_no\",\n \"field_name\": \"Invoice number\",\n \"field_type\": \"string\",\n \"field_prompt\": \"Extract the unique invoice number from the invoice.\"\n },\n {\n \"field_key\": \"invoice_date\",\n \"field_name\": \"Invoice date\",\n \"field_type\": \"date\",\n \"field_prompt\": \"Extract the invoice issue date.\"\n },\n {\n \"field_key\": \"line_items\",\n \"field_name\": \"Line items\",\n \"field_type\": \"table\",\n \"sub_fields\": [\n {\n \"field_key\": \"item_name\",\n \"field_name\": \"Item name\",\n \"field_type\": \"string\"\n },\n {\n \"field_key\": \"item_date\",\n \"field_name\": \"Date\",\n \"field_type\": \"date\"\n }\n ]\n }\n ],\n \"enable_field_value_translation\": false\n}")
.asString();const url = 'https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create';
const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ai_function: 1425,
app_name: 'High-speed invoice extraction app',
app_label: ['invoice', 'high-speed'],
extract_fields: [
{
field_key: 'invoice_no',
field_name: 'Invoice number',
field_type: 'string',
field_prompt: 'Extract the unique invoice number from the invoice.'
},
{
field_key: 'invoice_date',
field_name: 'Invoice date',
field_type: 'date',
field_prompt: 'Extract the invoice issue date.'
},
{
field_key: 'line_items',
field_name: 'Line items',
field_type: 'table',
sub_fields: [
{field_key: 'item_name', field_name: 'Item name', field_type: 'string'},
{field_key: 'item_date', field_name: 'Date', field_type: 'date'}
]
}
],
enable_field_value_translation: false
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create"
payload := strings.NewReader("{\n \"ai_function\": 1425,\n \"app_name\": \"High-speed invoice extraction app\",\n \"app_label\": [\n \"invoice\",\n \"high-speed\"\n ],\n \"extract_fields\": [\n {\n \"field_key\": \"invoice_no\",\n \"field_name\": \"Invoice number\",\n \"field_type\": \"string\",\n \"field_prompt\": \"Extract the unique invoice number from the invoice.\"\n },\n {\n \"field_key\": \"invoice_date\",\n \"field_name\": \"Invoice date\",\n \"field_type\": \"date\",\n \"field_prompt\": \"Extract the invoice issue date.\"\n },\n {\n \"field_key\": \"line_items\",\n \"field_name\": \"Line items\",\n \"field_type\": \"table\",\n \"sub_fields\": [\n {\n \"field_key\": \"item_name\",\n \"field_name\": \"Item name\",\n \"field_type\": \"string\"\n },\n {\n \"field_key\": \"item_date\",\n \"field_name\": \"Date\",\n \"field_type\": \"date\"\n }\n ]\n }\n ],\n \"enable_field_value_translation\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<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))
}using RestSharp;
var options = new RestClientOptions("https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-API-KEY", "<api-key>");
request.AddJsonBody("{\n \"ai_function\": 1425,\n \"app_name\": \"High-speed invoice extraction app\",\n \"app_label\": [\n \"invoice\",\n \"high-speed\"\n ],\n \"extract_fields\": [\n {\n \"field_key\": \"invoice_no\",\n \"field_name\": \"Invoice number\",\n \"field_type\": \"string\",\n \"field_prompt\": \"Extract the unique invoice number from the invoice.\"\n },\n {\n \"field_key\": \"invoice_date\",\n \"field_name\": \"Invoice date\",\n \"field_type\": \"date\",\n \"field_prompt\": \"Extract the invoice issue date.\"\n },\n {\n \"field_key\": \"line_items\",\n \"field_name\": \"Line items\",\n \"field_type\": \"table\",\n \"sub_fields\": [\n {\n \"field_key\": \"item_name\",\n \"field_name\": \"Item name\",\n \"field_type\": \"string\"\n },\n {\n \"field_key\": \"item_date\",\n \"field_name\": \"Date\",\n \"field_type\": \"date\"\n }\n ]\n }\n ],\n \"enable_field_value_translation\": false\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://adp-global.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/app-manage/create",
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([
'ai_function' => 1425,
'app_name' => 'High-speed invoice extraction app',
'app_label' => [
'invoice',
'high-speed'
],
'extract_fields' => [
[
'field_key' => 'invoice_no',
'field_name' => 'Invoice number',
'field_type' => 'string',
'field_prompt' => 'Extract the unique invoice number from the invoice.'
],
[
'field_key' => 'invoice_date',
'field_name' => 'Invoice date',
'field_type' => 'date',
'field_prompt' => 'Extract the invoice issue date.'
],
[
'field_key' => 'line_items',
'field_name' => 'Line items',
'field_type' => 'table',
'sub_fields' => [
[
'field_key' => 'item_name',
'field_name' => 'Item name',
'field_type' => 'string'
],
[
'field_key' => 'item_date',
'field_name' => 'Date',
'field_type' => 'date'
]
]
]
],
'enable_field_value_translation' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"code": "success",
"message": "",
"tips": null,
"data": {
"app_id": "app_abc123",
"app_name": "High-speed invoice extraction app",
"app_label": [
"invoice",
"high-speed"
],
"config_version": "v1"
}
}Authorizations
Production API Key. You can find it under My API in the ADP platform. Make sure the API Key is active and belongs to the production environment.
Path Parameters
Tenant name. Default: laiye.
Body
- Create high-speed extraction application
- Create standard custom extraction application
Set ai_function first. Use the standard custom extraction application parameters when ai_function is 1406. Use the high-speed custom extraction application parameters when ai_function is 1425.
Application type. Use 1425 to create a high-speed custom extraction application.
1425 Application name.
1 - 100High-speed extraction field configuration list. Up to 50 fields. Every field must provide field_key.
1 - 50 elementsShow child attributes
Show child attributes
Application labels. Up to 5 labels.
5Whether to enable extracted value translation. Disabled by default.