Create Document
Upload a new document for processing. This endpoint supports asynchronous processing with status updates available through polling or webhooks.
Request
Headers
Bearer token authentication. See our Authentication guide for more details. Example: Bearer YOUR_API_KEY
Must be multipart/form-data
Body Parameters
A document file to process. The file must be a PDF, Docx, or Image file.
Markdown conversion with processing accuracy level. Options: lite
or ultra
.
lite
: Faster processing with great accuracyultra
: Highest accuracy, but slower processing
The ID of the custom extractor to use with your document.
Whether to include page separators in the output.
Whether to skip image extraction from the document.
Optional webhook URL to receive processing status updates.
Example Request of Document to Markdown
Response
Created document object.
Example Responses
Webhook Notifications
If a callback_url
is provided, you will receive a POST request when processing has completed:
Webhook URLs must be HTTPS and publicly accessible.
Webhook Failure Handling
If the webhook delivery fails:
- The system will automatically retry up to 3 times
- Each retry attempt waits 5 seconds before trying again
Next Step: Poll for Completion
After you create a document the status will be PENDING
. Call Get Document periodically using the returned id
until status
changes to COMPLETED
or FAILED
. The output_file_url
field will then be available for download.