Merge Documents
Merge 2–50 images or PDFs into one document before processing.
Merge 2–50 images or PDFs into one document before processing, for multi-page documents captured as separate images. In the HTTP API, each entry in the files list uses file_url or file_base64 plus filename; the Python SDK also accepts local file_path values and converts them to base64.
HTTP API
POST
/api/v1/documents/mergeSend a JSON body with an array of 2–50 files to merge and process as one document.
body parameters
| Field | Type | Description |
|---|---|---|
filesrequired | array | Array of 2–50 objects, each with file_url or file_base64 + filename. |
document_typerequired | string | Target document type for the merged result (e.g. bank_statement). |
output_filename | string | Custom filename for the merged PDF. Defaults to auto-generated. |
webhook_url | string | Completion callback URL; same payload shape as single-document uploads. |
cURL
curl -X POST https://api.kita.ai/api/v1/documents/merge \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"files": [
{ "file_url": "https://example.com/page1.pdf" },
{ "file_url": "https://example.com/page2.pdf" }
],
"document_type": "bank_statement",
"output_filename": "merged_document.pdf"
}'Merge response
{
"document_id": 12345,
"status": "processing",
"message": "Files merged successfully. Processing as bank_statement.",
"output_filename": "merged_document.pdf",
"total_files_merged": 2
}Python SDK
The SDK merge_documents method accepts mixed input types (URLs, local file paths, and base64 strings) in a single call.
Retrieving the result
The merged file is processed as a single document. Poll GET /api/v1/documents/jobs/{document_id} with the returned document_id for the extracted result.


