Create a document (PDF/XLS/XLSX)
docraptor_create_documentGenerate a PDF or Excel document from HTML (document_content) or a URL (document_url). Exactly one of document_content / document_url is required. By default the document is HOSTED and the tool returns a { download_url } you can fetch — ideal for agents (no large binary in the response). Set hosted:false to get the raw document back as base64, or async:true to enqueue a job and poll docraptor_get_document_status. IMPORTANT: real documents consume account credits (billed). Set test:true to generate a FREE, watermarked document while developing. DocRaptor API: POST /docs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | An arbitrary tag string for your own reporting/grouping. | |
| name | No | A name for the document (<=200 chars), shown in the DocRaptor dashboard/listing. | |
| test | No | If true, generate a FREE watermarked test document (does not consume credits). Default false = a real, BILLED document. | |
| type | No | Output format: pdf (default), xls, or xlsx. | |
| async | No | If true, enqueue the job and return a status_id (poll with docraptor_get_document_status). Best for large/slow documents. Default false. | |
| hosted | No | If true (default), DocRaptor hosts the file and returns a download_url. If false, the raw document is returned as base64. | |
| pipeline | No | Rendering pipeline/engine version, e.g. '10'. Omit to use DocRaptor's default. | |
| document_url | No | A URL DocRaptor will fetch and render. Use this OR document_content. | |
| prince_options | No | PDF engine (Prince) options. PDF only. | |
| document_content | No | The HTML/XML source to render. Use this OR document_url. | |
| hosted_expires_at | No | For hosted docs: ISO 8601 datetime when the hosted link expires. | |
| hosted_download_limit | No | For hosted docs: max number of downloads before the link expires. |