Skip to main content
POST /api/v1/documents Upload a document to convert it to Markdown or process it with a custom extractor. The API supports PDF, DOCX, and image files up to 100MB.

Request

Headers

string
required
Bearer token authentication. Example: Bearer YOUR_API_KEY
string
required
Must be multipart/form-data

Body Parameters

file
The document file to process. Supported formats: PDF, DOCX, PNG, JPG, JPEG, WEBP, GIF.
Provide either file or url, not both.
string
URL to download the document from. The file will be fetched and processed.
Provide either file or url, not both.
string
default:"lite"
Processing accuracy level for Markdown conversion:
  • lite — Fast processing with great accuracy (default)
  • ultra — Highest accuracy for complex documents
string
UUID of a custom extractor to use instead of standard Markdown conversion.
boolean
default:"true"
Include page break markers (---) in the Markdown output.
boolean
default:"false"
When true, images are not extracted or transcribed from the document.
string
Webhook URL to receive a POST request when processing completes.

EU Endpoint

For data residency requirements, an EU-based endpoint is available at api.eu.doctly.ai. Documents processed through this endpoint are stored and processed entirely within the European Union.
The EU endpoint only supports the url parameter. Direct file uploads using the file parameter are not available on this endpoint.

Example Requests

Convert to Markdown

Convert from URL

Use Custom Extractor

Response

Example Responses

Webhooks

When callback_url is provided, a POST request is sent when processing completes:
Webhooks retry up to 3 times with 5-second delays if delivery fails. URLs must be HTTPS and publicly accessible.

Next Steps

After creating a document, poll Get Document until status is COMPLETED or FAILED. The output_file_url provides a signed download link for the result.