/ API ReferenceDocumint API Reference
Generate certificates, invoices, cards, PNGs, PDFs, and merged template packets from your backend.
Generate documents from templates.
Use Documint APIs to list workspace templates, validate payloads, generate PNG or PDF output, and merge multiple templates into one PDF packet.
Send an API key with every request.
Generation and validation endpoints accept API key authentication. Dashboard-only key management uses the signed-in session.
Authorization: Bearer YOUR_API_KEYx-api-key: YOUR_API_KEYapi-key: YOUR_API_KEY/api/documents/templatesList workspace templates
Returns templates owned by the authenticated workspace user. Use this to show template IDs and required parameters before generation.
- Lists templates owned by the authenticated workspace.
- Use requiredParams to prepare payload fields.
- Public template discovery is handled in the product UI.
GET /api/documents/templates HTTP/1.1
Authorization: Bearer YOUR_API_KEY{
"success": true,
"templates": [
{
"id": "template_cert_completion",
"name": "Course completion certificate",
"isPublic": false,
"requiredParams": ["client.name", "course.name"],
"previewUrl": "https://...",
"pageCount": 1,
"updatedAt": "2026-06-06T10:00:00.000Z"
}
]
}/api/documents/validate-dataValidate payload data
Checks whether a payload contains every required placeholder for a template before generating output.
- payload and data are both accepted.
- Flat keys such as client.name are normalized automatically.
- A missing template returns a 404 response.
POST /api/documents/validate-data HTTP/1.1
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json{
"templateId": "template_cert_completion",
"payload": {
"client": { "name": "Ayesha Khan" },
"course": { "name": "Design Systems" }
}
}{
"valid": true,
"requiredPlaceholders": ["client.name", "course.name"],
"missingFields": []
}/api/documents/generateGenerate one document
Generates one PNG or PDF from a saved template and a payload.
- output can be png or pdf.
- If required values are missing, the API returns status 422.
- Use certificate.fileUrl or certificate.dataUrl depending on your environment.
POST /api/documents/generate HTTP/1.1
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json{
"templateId": "template_cert_completion",
"output": "pdf",
"payload": {
"client": {
"name": "Ayesha Khan",
"email": "ayesha@example.com"
},
"course": { "name": "Design Systems" },
"certificate": { "issueDate": "2026-06-06" },
"qrurl": "https://example.com/verify/CERT-1024"
}
}{
"success": true,
"certificate": {
"id": "generated_file_id",
"templateId": "template_cert_completion",
"outputType": "pdf",
"fileUrl": "https://cdn.example.com/output.pdf"
}
}/api/documents/generateGenerate a multi-template PDF
Sends several template and payload pairs in one request and returns one merged PDF document.
- documents, templates, items, and root arrays are accepted.
- Multi-template output is PDF only.
- Each document item gets its own payload.
POST /api/documents/generate HTTP/1.1
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json{
"output": "pdf",
"documents": [
{
"templateId": "template_certificate",
"payload": {
"client": { "name": "Ayesha Khan" }
}
},
{
"templateId": "template_transcript",
"payload": {
"client": { "name": "Ayesha Khan" }
}
}
]
}{
"success": true,
"document": {
"id": "merged_document_id",
"outputType": "pdf",
"fileUrl": "https://cdn.example.com/packet.pdf"
}
}/api/documents/generate-bulkGenerate from rows
Generates documents from row data. Use it for CSV-style generation where each row becomes one finished file.
- rows must contain at least one object.
- Flat CSV-style keys are converted to nested payload data.
- Larger uploads return progress details for follow-up checks.
POST /api/documents/generate-bulk HTTP/1.1
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json{
"templateId": "template_cert_completion",
"output": "pdf",
"rows": [
{
"client.name": "Ayesha Khan",
"course.name": "Design Systems"
},
{
"client.name": "Omar Malik",
"course.name": "Node APIs"
}
]
}{
"success": true,
"queued": false,
"summary": {
"total": 2,
"generated": 2,
"failed": 0
},
"certificates": []
}Common request fields
templateIdstringSaved template ID from the dashboard.templateobjectInline template object, when not using templateId.outputpng | pdfOutput format. Defaults to png.payloadobjectNested values for placeholders.dataobjectAlias for payload.rowsobject[]List of flat or nested row objects for bulk generation.documentsobject[]Template and payload pairs for merged PDF output.Response conventions
Successful requests include success: true. Validation issues return clear missing-field details, and generation output is returned on the certificate or document object.