Document Merge Async
Markdown for LLMsRuns the same merge as documents-document-merge, but asynchronously. Every rule of the synchronous operation applies unchanged; see its description for the request.
This endpoint returns HTTP 200 with an empty body as soon as the request is accepted and queued. That response only acknowledges receipt; it does not mean the operation succeeded.
The result arrives at your callback URL, not in the response to this call. Once the operation finishes, Doctavian sends a POST to the URL formed by joining the iss and dest claims of the X-Client-Authorization token supplied on this request, authenticating itself through the external connector named by that token's connector_id claim.
On success the callback body is the DocumentMergeResponse envelope — the same body documents-document-merge returns. On failure it is the ErrorResponse envelope, carrying the failure's own code: unlike the synchronous operation, no …_FUNCTION_FAILED entry is added after it. Correlate a callback with its request through externalContext, which is echoed back unchanged.
A 400 from this endpoint means the request was rejected before being queued, so no callback follows it. Usage limits are checked once the request is processed, so a reached limit arrives at the callback as an ErrorResponse with LIMIT_BREACH, not as an HTTP 403 from this endpoint.
JWT token to authenticate the request.
In: header
API key, sent as a request header.
In: header
Header Parameters
Request Body
application/json
Mandatory. The same body as documents-document-merge.
TypeScript Definitions
Use the request body type in TypeScript.
Request body for documents-document-merge and documents-document-merge-async.
Response Body
application/json
curl -X POST "https://example.com/documents/document/merge/async" \ -H "X-Client-Authorization: eyJhbGciOiJIUzI1NiJ9.example-client-callback-token" \ -H "Content-Type: application/json" \ -d '{ "externalContext": { "id": "req-2026-0007421" }, "sourceDocuments": [ { "urn": "e3b0c442-98fc-4e1a-8a3d-2c1b5f6e9a70", "loadMethod": "Storage", "order": 1, "remove": "none" }, { "urn": "5d8e9f0a-1b2c-43d4-95e6-7f8a9b0c1d2e", "loadMethod": "Storage", "order": 2, "remove": "none" } ], "targetDocument": { "name": "Q3 Sales Report - Merged", "fileFormat": "pdf", "deliveryMethod": "Storage", "path": "root" } }'{ "error": { "statusCode": 400, "message": "Bad Request", "innerErrors": [ { "code": "X_CLIENT_AUTH_ERROR", "message": "header is missing for async operations", "userMessage": "This request can't be accepted without a callback authorization header." } ], "externalErrors": [] }, "externalContext": { "id": "req-2026-0007421" }, "origin": "POST https://api.doctavian.com/v1/documents/document/merge/async", "dateTime": "2026-07-14T09:30:00.000Z", "userId": "1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d", "operationId": "38a1de72cef5aba1c0b26dd712239827"}