Create document template
curl --request POST \
--url https://api.beltic.com/v1/document-templates \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"data": {
"type": "document-template",
"attributes": {
"name": "Passport Document",
"extraction_config": {
"enabled": true,
"schema": {
"type": "object",
"properties": {},
"required": [
"<string>"
],
"additionalProperties": true
},
"extraction_rules": ""
},
"fraud_config": {
"enabled": true,
"requires_digital_signature": true
},
"description": "Template for processing passport documents"
}
}
}
'import requests
url = "https://api.beltic.com/v1/document-templates"
payload = { "data": {
"type": "document-template",
"attributes": {
"name": "Passport Document",
"extraction_config": {
"enabled": True,
"schema": {
"type": "object",
"properties": {},
"required": ["<string>"],
"additionalProperties": True
},
"extraction_rules": ""
},
"fraud_config": {
"enabled": True,
"requires_digital_signature": True
},
"description": "Template for processing passport documents"
}
} }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'document-template',
attributes: {
name: 'Passport Document',
extraction_config: {
enabled: true,
schema: {
type: 'object',
properties: {},
required: ['<string>'],
additionalProperties: true
},
extraction_rules: ''
},
fraud_config: {enabled: true, requires_digital_signature: true},
description: 'Template for processing passport documents'
}
}
})
};
fetch('https://api.beltic.com/v1/document-templates', 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://api.beltic.com/v1/document-templates",
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([
'data' => [
'type' => 'document-template',
'attributes' => [
'name' => 'Passport Document',
'extraction_config' => [
'enabled' => true,
'schema' => [
'type' => 'object',
'properties' => [
],
'required' => [
'<string>'
],
'additionalProperties' => true
],
'extraction_rules' => ''
],
'fraud_config' => [
'enabled' => true,
'requires_digital_signature' => true
],
'description' => 'Template for processing passport documents'
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.beltic.com/v1/document-templates"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"document-template\",\n \"attributes\": {\n \"name\": \"Passport Document\",\n \"extraction_config\": {\n \"enabled\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n },\n \"extraction_rules\": \"\"\n },\n \"fraud_config\": {\n \"enabled\": true,\n \"requires_digital_signature\": true\n },\n \"description\": \"Template for processing passport documents\"\n }\n }\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))
}HttpResponse<String> response = Unirest.post("https://api.beltic.com/v1/document-templates")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"document-template\",\n \"attributes\": {\n \"name\": \"Passport Document\",\n \"extraction_config\": {\n \"enabled\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n },\n \"extraction_rules\": \"\"\n },\n \"fraud_config\": {\n \"enabled\": true,\n \"requires_digital_signature\": true\n },\n \"description\": \"Template for processing passport documents\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beltic.com/v1/document-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"document-template\",\n \"attributes\": {\n \"name\": \"Passport Document\",\n \"extraction_config\": {\n \"enabled\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n },\n \"extraction_rules\": \"\"\n },\n \"fraud_config\": {\n \"enabled\": true,\n \"requires_digital_signature\": true\n },\n \"description\": \"Template for processing passport documents\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "document-template",
"id": "123e4567-e89b-12d3-a456-426614174000",
"attributes": {
"name": "<string>",
"extraction_config": {
"enabled": true,
"schema": "<unknown>",
"extraction_rules": "<string>"
},
"fraud_config": {
"enabled": true,
"requires_digital_signature": true
},
"description": "<string>",
"status": "published",
"is_active": true,
"created_at": "<string>",
"updated_at": "<string>"
},
"relationships": {}
}
}Document API
Create Document Template
Create a new document template to standardize document processing workflows. Templates define reusable configurations including extraction schemas and fraud detection rules.
Template Components:
- Schema: Defines the expected structure of extracted data
- Fraud Config: Pipeline configuration for fraud detection. Set
requires_digital_signature: truewhen documents processed with this template must contain a signature; if no signature is detected, the fraud result includes a missing-signature RISK indicator. - Validation Fields: Date checks should be represented as boolean fields with
beltic:validation
Validation Field Pattern:
- Keep the source date field as
type: ["string", "null"]with"custom:type": "date" - Add a sibling boolean field with
"beltic:validation" - Use
field_refto reference the source date field in the same object scope - Works in top-level objects, nested objects, and array item objects
Best Practices:
- Use descriptive names and detailed descriptions for team clarity
- Test with sample documents before using in production
- Keep templates focused on specific document types (e.g., “Passport”, “Driver License”)
POST
/
v1
/
document-templates
Create document template
curl --request POST \
--url https://api.beltic.com/v1/document-templates \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"data": {
"type": "document-template",
"attributes": {
"name": "Passport Document",
"extraction_config": {
"enabled": true,
"schema": {
"type": "object",
"properties": {},
"required": [
"<string>"
],
"additionalProperties": true
},
"extraction_rules": ""
},
"fraud_config": {
"enabled": true,
"requires_digital_signature": true
},
"description": "Template for processing passport documents"
}
}
}
'import requests
url = "https://api.beltic.com/v1/document-templates"
payload = { "data": {
"type": "document-template",
"attributes": {
"name": "Passport Document",
"extraction_config": {
"enabled": True,
"schema": {
"type": "object",
"properties": {},
"required": ["<string>"],
"additionalProperties": True
},
"extraction_rules": ""
},
"fraud_config": {
"enabled": True,
"requires_digital_signature": True
},
"description": "Template for processing passport documents"
}
} }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'document-template',
attributes: {
name: 'Passport Document',
extraction_config: {
enabled: true,
schema: {
type: 'object',
properties: {},
required: ['<string>'],
additionalProperties: true
},
extraction_rules: ''
},
fraud_config: {enabled: true, requires_digital_signature: true},
description: 'Template for processing passport documents'
}
}
})
};
fetch('https://api.beltic.com/v1/document-templates', 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://api.beltic.com/v1/document-templates",
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([
'data' => [
'type' => 'document-template',
'attributes' => [
'name' => 'Passport Document',
'extraction_config' => [
'enabled' => true,
'schema' => [
'type' => 'object',
'properties' => [
],
'required' => [
'<string>'
],
'additionalProperties' => true
],
'extraction_rules' => ''
],
'fraud_config' => [
'enabled' => true,
'requires_digital_signature' => true
],
'description' => 'Template for processing passport documents'
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.beltic.com/v1/document-templates"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"document-template\",\n \"attributes\": {\n \"name\": \"Passport Document\",\n \"extraction_config\": {\n \"enabled\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n },\n \"extraction_rules\": \"\"\n },\n \"fraud_config\": {\n \"enabled\": true,\n \"requires_digital_signature\": true\n },\n \"description\": \"Template for processing passport documents\"\n }\n }\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))
}HttpResponse<String> response = Unirest.post("https://api.beltic.com/v1/document-templates")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"document-template\",\n \"attributes\": {\n \"name\": \"Passport Document\",\n \"extraction_config\": {\n \"enabled\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n },\n \"extraction_rules\": \"\"\n },\n \"fraud_config\": {\n \"enabled\": true,\n \"requires_digital_signature\": true\n },\n \"description\": \"Template for processing passport documents\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beltic.com/v1/document-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"document-template\",\n \"attributes\": {\n \"name\": \"Passport Document\",\n \"extraction_config\": {\n \"enabled\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {},\n \"required\": [\n \"<string>\"\n ],\n \"additionalProperties\": true\n },\n \"extraction_rules\": \"\"\n },\n \"fraud_config\": {\n \"enabled\": true,\n \"requires_digital_signature\": true\n },\n \"description\": \"Template for processing passport documents\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "document-template",
"id": "123e4567-e89b-12d3-a456-426614174000",
"attributes": {
"name": "<string>",
"extraction_config": {
"enabled": true,
"schema": "<unknown>",
"extraction_rules": "<string>"
},
"fraud_config": {
"enabled": true,
"requires_digital_signature": true
},
"description": "<string>",
"status": "published",
"is_active": true,
"created_at": "<string>",
"updated_at": "<string>"
},
"relationships": {}
}
}Authorizations
API key for authentication. Access https://console.beltic.com/ to obtain your API key.
Body
application/json
Show child attributes
Show child attributes
Response
Template created successfully
Show child attributes
Show child attributes
Was this page helpful?
⌘I