Create document
curl --request POST \
--url https://api.beltic.com/v1/documents \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"data": {
"type": "document",
"meta": {
"document_template_id": "123e4567-e89b-12d3-a456-426614174000",
"file_url": "https://example.com/documents/invoice.pdf"
},
"relationships": {
"session": {
"data": {
"type": "session",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
}
}
}
'import requests
url = "https://api.beltic.com/v1/documents"
payload = { "data": {
"type": "document",
"meta": {
"document_template_id": "123e4567-e89b-12d3-a456-426614174000",
"file_url": "https://example.com/documents/invoice.pdf"
},
"relationships": { "session": { "data": {
"type": "session",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
} } }
} }
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',
meta: {
document_template_id: '123e4567-e89b-12d3-a456-426614174000',
file_url: 'https://example.com/documents/invoice.pdf'
},
relationships: {session: {data: {type: 'session', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}}}
}
})
};
fetch('https://api.beltic.com/v1/documents', 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/documents",
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',
'meta' => [
'document_template_id' => '123e4567-e89b-12d3-a456-426614174000',
'file_url' => 'https://example.com/documents/invoice.pdf'
],
'relationships' => [
'session' => [
'data' => [
'type' => 'session',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]
]
]),
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/documents"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"document\",\n \"meta\": {\n \"document_template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"file_url\": \"https://example.com/documents/invoice.pdf\"\n },\n \"relationships\": {\n \"session\": {\n \"data\": {\n \"type\": \"session\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\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/documents")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"document\",\n \"meta\": {\n \"document_template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"file_url\": \"https://example.com/documents/invoice.pdf\"\n },\n \"relationships\": {\n \"session\": {\n \"data\": {\n \"type\": \"session\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beltic.com/v1/documents")
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\",\n \"meta\": {\n \"document_template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"file_url\": \"https://example.com/documents/invoice.pdf\"\n },\n \"relationships\": {\n \"session\": {\n \"data\": {\n \"type\": \"session\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "document",
"attributes": {
"file": {
"id": "<string>",
"filename": "<string>",
"content_type": "image/jpeg",
"byte_size": 3340938,
"checksum": "cdff95d353d86a9fa1f06532a8ca212430d5b512efa669250c0777c9525d55fb",
"url": "https://files.beltic.com/9941d601-0dd4-4a33-8043-4f158b480f0e/file?X-Amz-Signature=..."
},
"processing_errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"meta": {
"occurred_at": "<string>"
}
}
],
"created_at": "<string>",
"submitted_at": "<string>",
"processed_at": "<string>",
"redacted_at": "<string>",
"extracted_data": {},
"fraud_result": {
"score": "NORMAL",
"file_metadata": {
"producer": null,
"creator": null,
"creation_date": null,
"mod_date": null,
"author": null,
"title": null,
"keywords": null,
"subject": null
},
"indicators": [
{
"id": "<string>",
"category": "<string>",
"title": "<string>",
"description": "<string>"
}
],
"document_classification": {
"id": "<string>",
"type": "<string>",
"document_class_type": "<string>",
"detailed_type": "<string>"
}
},
"extracted_data_coordinates": {
"version": 1,
"fields": {
"partners[0]": [
{
"surface": {
"type": "page",
"number": 2
},
"coordinate_space": "normalized_page",
"bbox": {
"left": 0.177,
"top": 0.783,
"width": 0.672,
"height": 0.016
},
"polygon": [
{
"x": 0.177,
"y": 0.783
},
{
"x": 0.848,
"y": 0.783
},
{
"x": 0.848,
"y": 0.799
},
{
"x": 0.177,
"y": 0.799
}
]
}
]
}
},
"fraud_result_coordinates": {
"version": 1,
"indicators": {
"grp_overlaps": [
{
"surface": {
"type": "page",
"number": 1
},
"coordinate_space": "normalized_page",
"bbox": {
"left": 0.471,
"top": 0.601,
"width": 0.397,
"height": 0.27
},
"polygon": null,
"detail": {
"original_text": "ParsedImage",
"new_text": ""
}
}
]
}
}
},
"relationships": {
"document_template": {
"data": {
"type": "document-template",
"id": "123e4567-e89b-12d3-a456-426614174000"
}
},
"session": {
"data": {
"type": "session",
"id": "123e4567-e89b-12d3-a456-426614174000"
}
}
},
"meta": {
"extraction_config": {
"enabled": true,
"schema": {
"type": "object",
"properties": {},
"required": [
"<string>"
],
"additionalProperties": true
},
"extraction_rules": ""
},
"fraud_config": {
"enabled": true,
"requires_digital_signature": true
},
"file_url": "<string>",
"ocr_external_id": "<string>",
"fraud_check_external_id": "<string>"
}
},
"meta": {
"presigned_upload_url": "https://files.beltic.com/9941d601-0dd4-4a33-8043-4f158b480f0e/file?X-Amz-Signature=...",
"expires_in": 3600
}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"detail": "<string>"
}
]
}Document API
Create Document
Create a new document for processing. This initializes a document record and returns a pre-signed S3 URL for file upload.
Configuration Options (mutually exclusive):
- Template-based: Provide
document_template_idto use a predefined template configuration - Ad-hoc: Provide
extraction_configandfraud_configdirectly in the request
Additional Options:
file_url: Optionally provide a URL to download the file fromfraud_config.requires_digital_signature: In ad-hoc mode, set totruewhen the document must contain a signature; if no signature is detected, the fraud result includes a missing-signature RISK indicator
Workflow:
- Call this endpoint to create the document and receive an upload URL
- Upload your file to the pre-signed URL using PUT method (or provide
file_urlto skip this step) - Once uploaded, the document will automatically begin processing
- Poll the document GET endpoint to monitor processing status
Limits:
- Maximum file size: 50MB. Files exceeding this limit will be rejected and the document will be marked as failed with error code
FILE_TOO_LARGE.
Note: The pre-signed upload URL expires after the time specified in expires_in (typically 1 hour).
POST
/
v1
/
documents
Create document
curl --request POST \
--url https://api.beltic.com/v1/documents \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"data": {
"type": "document",
"meta": {
"document_template_id": "123e4567-e89b-12d3-a456-426614174000",
"file_url": "https://example.com/documents/invoice.pdf"
},
"relationships": {
"session": {
"data": {
"type": "session",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
}
}
}
'import requests
url = "https://api.beltic.com/v1/documents"
payload = { "data": {
"type": "document",
"meta": {
"document_template_id": "123e4567-e89b-12d3-a456-426614174000",
"file_url": "https://example.com/documents/invoice.pdf"
},
"relationships": { "session": { "data": {
"type": "session",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
} } }
} }
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',
meta: {
document_template_id: '123e4567-e89b-12d3-a456-426614174000',
file_url: 'https://example.com/documents/invoice.pdf'
},
relationships: {session: {data: {type: 'session', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}}}
}
})
};
fetch('https://api.beltic.com/v1/documents', 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/documents",
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',
'meta' => [
'document_template_id' => '123e4567-e89b-12d3-a456-426614174000',
'file_url' => 'https://example.com/documents/invoice.pdf'
],
'relationships' => [
'session' => [
'data' => [
'type' => 'session',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]
]
]),
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/documents"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"document\",\n \"meta\": {\n \"document_template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"file_url\": \"https://example.com/documents/invoice.pdf\"\n },\n \"relationships\": {\n \"session\": {\n \"data\": {\n \"type\": \"session\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\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/documents")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"document\",\n \"meta\": {\n \"document_template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"file_url\": \"https://example.com/documents/invoice.pdf\"\n },\n \"relationships\": {\n \"session\": {\n \"data\": {\n \"type\": \"session\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beltic.com/v1/documents")
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\",\n \"meta\": {\n \"document_template_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"file_url\": \"https://example.com/documents/invoice.pdf\"\n },\n \"relationships\": {\n \"session\": {\n \"data\": {\n \"type\": \"session\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "document",
"attributes": {
"file": {
"id": "<string>",
"filename": "<string>",
"content_type": "image/jpeg",
"byte_size": 3340938,
"checksum": "cdff95d353d86a9fa1f06532a8ca212430d5b512efa669250c0777c9525d55fb",
"url": "https://files.beltic.com/9941d601-0dd4-4a33-8043-4f158b480f0e/file?X-Amz-Signature=..."
},
"processing_errors": [
{
"status": "<string>",
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"meta": {
"occurred_at": "<string>"
}
}
],
"created_at": "<string>",
"submitted_at": "<string>",
"processed_at": "<string>",
"redacted_at": "<string>",
"extracted_data": {},
"fraud_result": {
"score": "NORMAL",
"file_metadata": {
"producer": null,
"creator": null,
"creation_date": null,
"mod_date": null,
"author": null,
"title": null,
"keywords": null,
"subject": null
},
"indicators": [
{
"id": "<string>",
"category": "<string>",
"title": "<string>",
"description": "<string>"
}
],
"document_classification": {
"id": "<string>",
"type": "<string>",
"document_class_type": "<string>",
"detailed_type": "<string>"
}
},
"extracted_data_coordinates": {
"version": 1,
"fields": {
"partners[0]": [
{
"surface": {
"type": "page",
"number": 2
},
"coordinate_space": "normalized_page",
"bbox": {
"left": 0.177,
"top": 0.783,
"width": 0.672,
"height": 0.016
},
"polygon": [
{
"x": 0.177,
"y": 0.783
},
{
"x": 0.848,
"y": 0.783
},
{
"x": 0.848,
"y": 0.799
},
{
"x": 0.177,
"y": 0.799
}
]
}
]
}
},
"fraud_result_coordinates": {
"version": 1,
"indicators": {
"grp_overlaps": [
{
"surface": {
"type": "page",
"number": 1
},
"coordinate_space": "normalized_page",
"bbox": {
"left": 0.471,
"top": 0.601,
"width": 0.397,
"height": 0.27
},
"polygon": null,
"detail": {
"original_text": "ParsedImage",
"new_text": ""
}
}
]
}
}
},
"relationships": {
"document_template": {
"data": {
"type": "document-template",
"id": "123e4567-e89b-12d3-a456-426614174000"
}
},
"session": {
"data": {
"type": "session",
"id": "123e4567-e89b-12d3-a456-426614174000"
}
}
},
"meta": {
"extraction_config": {
"enabled": true,
"schema": {
"type": "object",
"properties": {},
"required": [
"<string>"
],
"additionalProperties": true
},
"extraction_rules": ""
},
"fraud_config": {
"enabled": true,
"requires_digital_signature": true
},
"file_url": "<string>",
"ocr_external_id": "<string>",
"fraud_check_external_id": "<string>"
}
},
"meta": {
"presigned_upload_url": "https://files.beltic.com/9941d601-0dd4-4a33-8043-4f158b480f0e/file?X-Amz-Signature=...",
"expires_in": 3600
}
}{
"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.
Body
application/json
Show child attributes
Show child attributes
Was this page helpful?
⌘I