Split Document
curl --request POST \
--url https://platform.aifano.com/split \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"split_description": [
{
"title": "<string>",
"description": "<string>"
}
],
"split_rules": "Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.",
"parsing": {
"enhance": {
"agentic": [],
"summarize_figures": true
},
"retrieval": {
"chunking": {
"chunk_mode": "disabled",
"chunk_size": 123
},
"filter_blocks": [],
"embedding_optimized": false
},
"formatting": {
"add_page_markers": false,
"table_output_format": "dynamic",
"merge_tables": false,
"include": []
},
"spreadsheet": {
"split_large_tables": {
"enabled": true,
"size": 50
},
"clustering": "accurate"
},
"settings": {
"ocr_system": "standard",
"extraction_mode": "hybrid",
"force_url_result": false,
"return_ocr_data": false,
"return_images": [],
"page_range": {
"start": 123,
"end": 123
},
"timeout": 123,
"document_password": "<string>"
}
},
"settings": {
"table_cutoff": "truncate"
}
}
'import requests
url = "https://platform.aifano.com/split"
payload = {
"input": "<string>",
"split_description": [
{
"title": "<string>",
"description": "<string>"
}
],
"split_rules": "Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.",
"parsing": {
"enhance": {
"agentic": [],
"summarize_figures": True
},
"retrieval": {
"chunking": {
"chunk_mode": "disabled",
"chunk_size": 123
},
"filter_blocks": [],
"embedding_optimized": False
},
"formatting": {
"add_page_markers": False,
"table_output_format": "dynamic",
"merge_tables": False,
"include": []
},
"spreadsheet": {
"split_large_tables": {
"enabled": True,
"size": 50
},
"clustering": "accurate"
},
"settings": {
"ocr_system": "standard",
"extraction_mode": "hybrid",
"force_url_result": False,
"return_ocr_data": False,
"return_images": [],
"page_range": {
"start": 123,
"end": 123
},
"timeout": 123,
"document_password": "<string>"
}
},
"settings": { "table_cutoff": "truncate" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: '<string>',
split_description: [{title: '<string>', description: '<string>'}],
split_rules: 'Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.',
parsing: {
enhance: {agentic: [], summarize_figures: true},
retrieval: {
chunking: {chunk_mode: 'disabled', chunk_size: 123},
filter_blocks: [],
embedding_optimized: false
},
formatting: {
add_page_markers: false,
table_output_format: 'dynamic',
merge_tables: false,
include: []
},
spreadsheet: {split_large_tables: {enabled: true, size: 50}, clustering: 'accurate'},
settings: {
ocr_system: 'standard',
extraction_mode: 'hybrid',
force_url_result: false,
return_ocr_data: false,
return_images: [],
page_range: {start: 123, end: 123},
timeout: 123,
document_password: '<string>'
}
},
settings: {table_cutoff: 'truncate'}
})
};
fetch('https://platform.aifano.com/split', 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://platform.aifano.com/split",
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([
'input' => '<string>',
'split_description' => [
[
'title' => '<string>',
'description' => '<string>'
]
],
'split_rules' => 'Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.',
'parsing' => [
'enhance' => [
'agentic' => [
],
'summarize_figures' => true
],
'retrieval' => [
'chunking' => [
'chunk_mode' => 'disabled',
'chunk_size' => 123
],
'filter_blocks' => [
],
'embedding_optimized' => false
],
'formatting' => [
'add_page_markers' => false,
'table_output_format' => 'dynamic',
'merge_tables' => false,
'include' => [
]
],
'spreadsheet' => [
'split_large_tables' => [
'enabled' => true,
'size' => 50
],
'clustering' => 'accurate'
],
'settings' => [
'ocr_system' => 'standard',
'extraction_mode' => 'hybrid',
'force_url_result' => false,
'return_ocr_data' => false,
'return_images' => [
],
'page_range' => [
'start' => 123,
'end' => 123
],
'timeout' => 123,
'document_password' => '<string>'
]
],
'settings' => [
'table_cutoff' => 'truncate'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://platform.aifano.com/split"
payload := strings.NewReader("{\n \"input\": \"<string>\",\n \"split_description\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"split_rules\": \"Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.\",\n \"parsing\": {\n \"enhance\": {\n \"agentic\": [],\n \"summarize_figures\": true\n },\n \"retrieval\": {\n \"chunking\": {\n \"chunk_mode\": \"disabled\",\n \"chunk_size\": 123\n },\n \"filter_blocks\": [],\n \"embedding_optimized\": false\n },\n \"formatting\": {\n \"add_page_markers\": false,\n \"table_output_format\": \"dynamic\",\n \"merge_tables\": false,\n \"include\": []\n },\n \"spreadsheet\": {\n \"split_large_tables\": {\n \"enabled\": true,\n \"size\": 50\n },\n \"clustering\": \"accurate\"\n },\n \"settings\": {\n \"ocr_system\": \"standard\",\n \"extraction_mode\": \"hybrid\",\n \"force_url_result\": false,\n \"return_ocr_data\": false,\n \"return_images\": [],\n \"page_range\": {\n \"start\": 123,\n \"end\": 123\n },\n \"timeout\": 123,\n \"document_password\": \"<string>\"\n }\n },\n \"settings\": {\n \"table_cutoff\": \"truncate\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://platform.aifano.com/split")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\",\n \"split_description\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"split_rules\": \"Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.\",\n \"parsing\": {\n \"enhance\": {\n \"agentic\": [],\n \"summarize_figures\": true\n },\n \"retrieval\": {\n \"chunking\": {\n \"chunk_mode\": \"disabled\",\n \"chunk_size\": 123\n },\n \"filter_blocks\": [],\n \"embedding_optimized\": false\n },\n \"formatting\": {\n \"add_page_markers\": false,\n \"table_output_format\": \"dynamic\",\n \"merge_tables\": false,\n \"include\": []\n },\n \"spreadsheet\": {\n \"split_large_tables\": {\n \"enabled\": true,\n \"size\": 50\n },\n \"clustering\": \"accurate\"\n },\n \"settings\": {\n \"ocr_system\": \"standard\",\n \"extraction_mode\": \"hybrid\",\n \"force_url_result\": false,\n \"return_ocr_data\": false,\n \"return_images\": [],\n \"page_range\": {\n \"start\": 123,\n \"end\": 123\n },\n \"timeout\": 123,\n \"document_password\": \"<string>\"\n }\n },\n \"settings\": {\n \"table_cutoff\": \"truncate\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.aifano.com/split")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\",\n \"split_description\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"split_rules\": \"Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.\",\n \"parsing\": {\n \"enhance\": {\n \"agentic\": [],\n \"summarize_figures\": true\n },\n \"retrieval\": {\n \"chunking\": {\n \"chunk_mode\": \"disabled\",\n \"chunk_size\": 123\n },\n \"filter_blocks\": [],\n \"embedding_optimized\": false\n },\n \"formatting\": {\n \"add_page_markers\": false,\n \"table_output_format\": \"dynamic\",\n \"merge_tables\": false,\n \"include\": []\n },\n \"spreadsheet\": {\n \"split_large_tables\": {\n \"enabled\": true,\n \"size\": 50\n },\n \"clustering\": \"accurate\"\n },\n \"settings\": {\n \"ocr_system\": \"standard\",\n \"extraction_mode\": \"hybrid\",\n \"force_url_result\": false,\n \"return_ocr_data\": false,\n \"return_images\": [],\n \"page_range\": {\n \"start\": 123,\n \"end\": 123\n },\n \"timeout\": 123,\n \"document_password\": \"<string>\"\n }\n },\n \"settings\": {\n \"table_cutoff\": \"truncate\"\n }\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"result": [
{
"category": "<string>",
"page_range": {
"start": 123,
"end": 123
},
"content": "<string>"
}
],
"duration": 123,
"usage": {
"num_pages": 123,
"credits": 123
}
}{
"error": "<string>"
}{
"error": "<string>"
}Document Processing
Split Document
Split a document into logical sections based on category descriptions. Useful for separating multi-section documents like contracts or reports.
POST
/
split
Split Document
curl --request POST \
--url https://platform.aifano.com/split \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"split_description": [
{
"title": "<string>",
"description": "<string>"
}
],
"split_rules": "Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.",
"parsing": {
"enhance": {
"agentic": [],
"summarize_figures": true
},
"retrieval": {
"chunking": {
"chunk_mode": "disabled",
"chunk_size": 123
},
"filter_blocks": [],
"embedding_optimized": false
},
"formatting": {
"add_page_markers": false,
"table_output_format": "dynamic",
"merge_tables": false,
"include": []
},
"spreadsheet": {
"split_large_tables": {
"enabled": true,
"size": 50
},
"clustering": "accurate"
},
"settings": {
"ocr_system": "standard",
"extraction_mode": "hybrid",
"force_url_result": false,
"return_ocr_data": false,
"return_images": [],
"page_range": {
"start": 123,
"end": 123
},
"timeout": 123,
"document_password": "<string>"
}
},
"settings": {
"table_cutoff": "truncate"
}
}
'import requests
url = "https://platform.aifano.com/split"
payload = {
"input": "<string>",
"split_description": [
{
"title": "<string>",
"description": "<string>"
}
],
"split_rules": "Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.",
"parsing": {
"enhance": {
"agentic": [],
"summarize_figures": True
},
"retrieval": {
"chunking": {
"chunk_mode": "disabled",
"chunk_size": 123
},
"filter_blocks": [],
"embedding_optimized": False
},
"formatting": {
"add_page_markers": False,
"table_output_format": "dynamic",
"merge_tables": False,
"include": []
},
"spreadsheet": {
"split_large_tables": {
"enabled": True,
"size": 50
},
"clustering": "accurate"
},
"settings": {
"ocr_system": "standard",
"extraction_mode": "hybrid",
"force_url_result": False,
"return_ocr_data": False,
"return_images": [],
"page_range": {
"start": 123,
"end": 123
},
"timeout": 123,
"document_password": "<string>"
}
},
"settings": { "table_cutoff": "truncate" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: '<string>',
split_description: [{title: '<string>', description: '<string>'}],
split_rules: 'Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.',
parsing: {
enhance: {agentic: [], summarize_figures: true},
retrieval: {
chunking: {chunk_mode: 'disabled', chunk_size: 123},
filter_blocks: [],
embedding_optimized: false
},
formatting: {
add_page_markers: false,
table_output_format: 'dynamic',
merge_tables: false,
include: []
},
spreadsheet: {split_large_tables: {enabled: true, size: 50}, clustering: 'accurate'},
settings: {
ocr_system: 'standard',
extraction_mode: 'hybrid',
force_url_result: false,
return_ocr_data: false,
return_images: [],
page_range: {start: 123, end: 123},
timeout: 123,
document_password: '<string>'
}
},
settings: {table_cutoff: 'truncate'}
})
};
fetch('https://platform.aifano.com/split', 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://platform.aifano.com/split",
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([
'input' => '<string>',
'split_description' => [
[
'title' => '<string>',
'description' => '<string>'
]
],
'split_rules' => 'Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.',
'parsing' => [
'enhance' => [
'agentic' => [
],
'summarize_figures' => true
],
'retrieval' => [
'chunking' => [
'chunk_mode' => 'disabled',
'chunk_size' => 123
],
'filter_blocks' => [
],
'embedding_optimized' => false
],
'formatting' => [
'add_page_markers' => false,
'table_output_format' => 'dynamic',
'merge_tables' => false,
'include' => [
]
],
'spreadsheet' => [
'split_large_tables' => [
'enabled' => true,
'size' => 50
],
'clustering' => 'accurate'
],
'settings' => [
'ocr_system' => 'standard',
'extraction_mode' => 'hybrid',
'force_url_result' => false,
'return_ocr_data' => false,
'return_images' => [
],
'page_range' => [
'start' => 123,
'end' => 123
],
'timeout' => 123,
'document_password' => '<string>'
]
],
'settings' => [
'table_cutoff' => 'truncate'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://platform.aifano.com/split"
payload := strings.NewReader("{\n \"input\": \"<string>\",\n \"split_description\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"split_rules\": \"Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.\",\n \"parsing\": {\n \"enhance\": {\n \"agentic\": [],\n \"summarize_figures\": true\n },\n \"retrieval\": {\n \"chunking\": {\n \"chunk_mode\": \"disabled\",\n \"chunk_size\": 123\n },\n \"filter_blocks\": [],\n \"embedding_optimized\": false\n },\n \"formatting\": {\n \"add_page_markers\": false,\n \"table_output_format\": \"dynamic\",\n \"merge_tables\": false,\n \"include\": []\n },\n \"spreadsheet\": {\n \"split_large_tables\": {\n \"enabled\": true,\n \"size\": 50\n },\n \"clustering\": \"accurate\"\n },\n \"settings\": {\n \"ocr_system\": \"standard\",\n \"extraction_mode\": \"hybrid\",\n \"force_url_result\": false,\n \"return_ocr_data\": false,\n \"return_images\": [],\n \"page_range\": {\n \"start\": 123,\n \"end\": 123\n },\n \"timeout\": 123,\n \"document_password\": \"<string>\"\n }\n },\n \"settings\": {\n \"table_cutoff\": \"truncate\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://platform.aifano.com/split")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\",\n \"split_description\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"split_rules\": \"Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.\",\n \"parsing\": {\n \"enhance\": {\n \"agentic\": [],\n \"summarize_figures\": true\n },\n \"retrieval\": {\n \"chunking\": {\n \"chunk_mode\": \"disabled\",\n \"chunk_size\": 123\n },\n \"filter_blocks\": [],\n \"embedding_optimized\": false\n },\n \"formatting\": {\n \"add_page_markers\": false,\n \"table_output_format\": \"dynamic\",\n \"merge_tables\": false,\n \"include\": []\n },\n \"spreadsheet\": {\n \"split_large_tables\": {\n \"enabled\": true,\n \"size\": 50\n },\n \"clustering\": \"accurate\"\n },\n \"settings\": {\n \"ocr_system\": \"standard\",\n \"extraction_mode\": \"hybrid\",\n \"force_url_result\": false,\n \"return_ocr_data\": false,\n \"return_images\": [],\n \"page_range\": {\n \"start\": 123,\n \"end\": 123\n },\n \"timeout\": 123,\n \"document_password\": \"<string>\"\n }\n },\n \"settings\": {\n \"table_cutoff\": \"truncate\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.aifano.com/split")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\",\n \"split_description\": [\n {\n \"title\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"split_rules\": \"Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.\",\n \"parsing\": {\n \"enhance\": {\n \"agentic\": [],\n \"summarize_figures\": true\n },\n \"retrieval\": {\n \"chunking\": {\n \"chunk_mode\": \"disabled\",\n \"chunk_size\": 123\n },\n \"filter_blocks\": [],\n \"embedding_optimized\": false\n },\n \"formatting\": {\n \"add_page_markers\": false,\n \"table_output_format\": \"dynamic\",\n \"merge_tables\": false,\n \"include\": []\n },\n \"spreadsheet\": {\n \"split_large_tables\": {\n \"enabled\": true,\n \"size\": 50\n },\n \"clustering\": \"accurate\"\n },\n \"settings\": {\n \"ocr_system\": \"standard\",\n \"extraction_mode\": \"hybrid\",\n \"force_url_result\": false,\n \"return_ocr_data\": false,\n \"return_images\": [],\n \"page_range\": {\n \"start\": 123,\n \"end\": 123\n },\n \"timeout\": 123,\n \"document_password\": \"<string>\"\n }\n },\n \"settings\": {\n \"table_cutoff\": \"truncate\"\n }\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"result": [
{
"category": "<string>",
"page_range": {
"start": 123,
"end": 123
},
"content": "<string>"
}
],
"duration": 123,
"usage": {
"num_pages": 123,
"credits": 123
}
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
API key authentication. Use your Aifano API key (starts with ak_live_) as the Bearer token.
Body
application/json
The document to process. Accepts: (1) a public URL, (2) a presigned S3 URL, (3) an aifano://file_id from /upload, or (4) a jobid://job_id from a previous /parse call.
Categories to split the document into.
Show child attributes
Show child attributes
split_rules
string
default:Split the document into the applicable sections. Sections may only overlap at their first and last page if at all.
Rules for how to split the document.
Configuration for the parsing step. Ignored when using jobid:// input.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I