Document and file tools
OmniDoc offers synchronous file tools and trackable asynchronous document operations. Call the capability endpoints first; do not hard-code supported formats or limits in the client.
Capability discovery
Section titled “Capability discovery”GET /api/v1/document-operations/capabilitiesGET /api/v1/artifacts/convert/capabilitiesThese return the operations currently open, their input formats, billing and technical limits. Capabilities listed under unavailable cannot be created.
Asynchronous document operations
Section titled “Asynchronous document operations”POST /api/v1/document-operationsIdempotency-Key: unique-request-id{ "document_id": "4q8mx2q9z1k7p6ra", "kind": "visual_extract"}This endpoint requires an Idempotency-Key. kind currently includes:
extract: structured extraction, free.pdf_to_html: PDF to online HTML, free.visual_extract: visual structured extraction, charged per page (1 credit per page). Before it starts, the number of pages it may process is set from the balance (at most 20 pages); if the balance covers less than 1 page, it returns402. When it finishes, the pages actually processed are charged, and the balance may become negative.
Query and cancel:
GET /api/v1/document-operations/{operation_id}GET /api/v1/document-operations?limit=25POST /api/v1/document-operations/{operation_id}/cancelWhen it completes, the response’s output_document_id can go into the file library or another job, and credit_operation_id gives the settlement record.
PDF tools
Section titled “PDF tools”POST /api/v1/file-tools/pdf/mergePOST /api/v1/file-tools/pdf/splitPOST /api/v1/file-tools/pdf/compressMerge example:
{"document_ids":["4q8mx2q9z1k7p6ra","b6t1n8c3v9m2x5ka"]}Split example:
{"document_id":"4q8mx2q9z1k7p6ra","ranges":["1-3","5","8-10"]}Image tools
Section titled “Image tools”POST /api/v1/file-tools/image/convertPOST /api/v1/file-tools/image/compress{ "document_id": "4q8mx2q9z1k7p6ra", "target_format": "webp", "quality": 85}The tools accept only documents the current account owns and whose type matches. Stream binary responses, and take the file name and type from the response headers.