DocLab API reference
DocLab API reference
Use your deployment’s API origin with the paths below. Send one credential: X-Api-Key: <key> or Authorization: Bearer <access-token>. See authentication.
Endpoints
| Method | Path | Request | Permission |
|---|---|---|---|
| GET | /api/v1/capabilities |
None | documents.read |
| POST | /api/v1/templates/inspect |
JSON template |
documents.read |
| POST | /api/v1/templates/inspect-upload |
Multipart template, format |
documents.read |
| POST | /api/v1/documents/generate |
JSON template, options |
documents.generate |
| POST | /api/v1/documents/generate-upload |
Multipart template, format, options JSON |
documents.generate |
| POST | /api/v1/documents/convert |
JSON document, options |
documents.generate |
| POST | /api/v1/documents/convert-upload |
Multipart document, format, options JSON |
documents.generate |
| POST | /api/v1/connector/generate |
Base64 content, format settings, fieldsJson string |
documents.generate |
Inspect a template
{
"template": {
"contentBase64": "<base64-encoded file bytes>",
"format": "Docx"
}
}
format is Docx, Xlsx, or Pdf and must match the actual file. Inspection does not modify the template. For multipart inspection, send the file as template and the format as format.
Generate a document
{
"template": {
"contentBase64": "<base64-encoded DOCX template>",
"format": "Docx"
},
"options": {
"outputFormat": "Docx",
"delivery": "Binary",
"disposition": "Attachment",
"fileName": "invoice",
"missingFields": "Preserve",
"fields": [
{ "name": "CustomerName", "kind": "Text", "text": "Cloudwell" }
]
}
}
Send to /api/v1/documents/generate. Use names discovered by inspection, with the correct typed values. The multipart equivalent accepts the template file, format, and generation options serialized as JSON.
Convert an existing file
{
"document": {
"contentBase64": "<base64-encoded DOCX bytes>",
"format": "Docx"
},
"options": {
"outputFormat": "Pdf",
"delivery": "Binary",
"disposition": "Attachment",
"fileName": "converted"
}
}
Send to /api/v1/documents/convert. DOCX and XLSX conversion require an enabled, available renderer. Conversion does not populate fields, so its field/replacement counts are zero. PDF-to-Office and cross-Office conversions are unsupported.
Delivery and diagnostics
Binaryreturns file bytes with a content type and filename. Diagnostic headers areX-Document-Field-Count,X-Document-Replacement-Count, and, when present,X-Document-Warnings.Jsonreturns base64 content, content type, filename, field/replacement counts, and warnings in the body.Previewreturns expiring links when enabled. Office previews require explicitallowExternalPreview: trueconsent. See output and previews.
Field counts describe discovered template occurrences; replacement counts include processed repeating rows. Responses are no-store. Processing errors use Problem Details with a stable code and traceId. See the status-code guide.
Capability discovery and interactive reference
- Query
/api/v1/capabilitiesbefore offering optional conversion features. Enabled configuration is not a renderer health guarantee. - Query
/api/v1/previews/capabilitiesfor preview availability. - Get the deployed OpenAPI specification at
/openapi/v1.json. It is anonymous only in Development; production access requiresdocuments.read. - The interactive
/docsAPI workbench is Development-only. Document operations remain authenticated there. /health/liveis an anonymous liveness endpoint, not proof that generation or external dependencies are healthy.