Update document template
curl --request PATCH \
--url https://api.beltic.com/v1/document-templates/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"data": {
"type": "document-template",
"id": "123e4567-e89b-12d3-a456-426614174000",
"attributes": {
"name": "Passport Document",
"description": "Template for processing passport documents"
}
}
}
'import requests
url = "https://api.beltic.com/v1/document-templates/{id}"
payload = { "data": {
"type": "document-template",
"id": "123e4567-e89b-12d3-a456-426614174000",
"attributes": {
"name": "Passport Document",
"description": "Template for processing passport documents"
}
} }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'document-template',
id: '123e4567-e89b-12d3-a456-426614174000',
attributes: {
name: 'Passport Document',
description: 'Template for processing passport documents'
}
}
})
};
fetch('https://api.beltic.com/v1/document-templates/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'document-template',
'id' => '123e4567-e89b-12d3-a456-426614174000',
'attributes' => [
'name' => 'Passport Document',
'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/{id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"document-template\",\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"attributes\": {\n \"name\": \"Passport Document\",\n \"description\": \"Template for processing passport documents\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.beltic.com/v1/document-templates/{id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"document-template\",\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"attributes\": {\n \"name\": \"Passport Document\",\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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"document-template\",\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"attributes\": {\n \"name\": \"Passport Document\",\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": {}
}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}Document API
Update Document Template
Update an existing document template with partial attributes. Only provided fields will be updated.
Updatable Fields:
- name: Template name (must be unique)
- description: Template description
- extraction_config: Extraction settings including JSON schema
- fraud_config: Fraud detection settings, including optional
requires_digital_signaturefor documents that must contain a signature
Validation Schema Convention:
- Date-based validation should be stored on boolean fields (not on date fields)
- Boolean validation fields use
beltic:validationwithkind,field_ref, and rule parameters field_refis scope-relative and must reference a sibling date field name
Notes:
- The template ID in the request body must match the path parameter
- Omitted fields will retain their current values
- Template status cannot be changed after creation
PATCH
/
v1
/
document-templates
/
{id}
Update document template
curl --request PATCH \
--url https://api.beltic.com/v1/document-templates/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"data": {
"type": "document-template",
"id": "123e4567-e89b-12d3-a456-426614174000",
"attributes": {
"name": "Passport Document",
"description": "Template for processing passport documents"
}
}
}
'import requests
url = "https://api.beltic.com/v1/document-templates/{id}"
payload = { "data": {
"type": "document-template",
"id": "123e4567-e89b-12d3-a456-426614174000",
"attributes": {
"name": "Passport Document",
"description": "Template for processing passport documents"
}
} }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'document-template',
id: '123e4567-e89b-12d3-a456-426614174000',
attributes: {
name: 'Passport Document',
description: 'Template for processing passport documents'
}
}
})
};
fetch('https://api.beltic.com/v1/document-templates/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'document-template',
'id' => '123e4567-e89b-12d3-a456-426614174000',
'attributes' => [
'name' => 'Passport Document',
'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/{id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"document-template\",\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"attributes\": {\n \"name\": \"Passport Document\",\n \"description\": \"Template for processing passport documents\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.beltic.com/v1/document-templates/{id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"document-template\",\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"attributes\": {\n \"name\": \"Passport Document\",\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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"document-template\",\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"attributes\": {\n \"name\": \"Passport Document\",\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": {}
}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}Authorizations
API key for authentication. Access https://console.beltic.com/ to obtain your API key.
Path Parameters
Template unique identifier
Example:
"123e4567-e89b-12d3-a456-426614174000"
Body
application/json
Show child attributes
Show child attributes
Response
Template updated successfully
Show child attributes
Show child attributes
Was this page helpful?
⌘I