Certificate PDF generation API
Generate a certificate PDF from a template and your recipient JSON in a single call. Docweave binds the recipient name, course, and date into an HTML certificate template and returns a print-ready PDF — issue one or thousands.
Generate a certificate PDF via the API
POST your template and data to /api/v1/pdf:
curl https://docweave.dev/api/v1/pdf \
-H "Authorization: Bearer dw_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"source": {
"type": "template",
"template": "<h1>Certificate of Completion</h1><p>Awarded to {{ recipient }}</p><p>{{ course }} — {{ date }}</p>",
"data": {
"recipient": "Jordan Lee",
"course": "Advanced TypeScript",
"date": "2026-07-14"
}
},
"options": { "format": "A4", "landscape": true },
"idempotencyKey": "cert-jordan-lee-advanced-ts"
}'…or from an AI agent
Add the Docweave MCP server and your agent gets a generate_pdf tool — the same orchestration, no HTTP boilerplate:
// From an AI agent over MCP — no HTTP plumbing:
generate_pdf({
source: {
type: "template",
template: "<h1>Certificate of Completion</h1><p>Awarded to {{ recipient }}</p><p>{{ course }} — {{ date }}</p>",
data: { recipient: "Jordan Lee", course: "Advanced TypeScript", date: "2026-07-14" }
},
outputPath: "/tmp/certificate-jordan-lee.pdf"
})Template example
Any HTML works as a template. Use {{ placeholders }} for the values you pass in data:
<article style="font-family: Georgia, serif; text-align:center; padding:64px;">
<h1 style="letter-spacing:2px;">Certificate of Completion</h1>
<p style="font-size:18px;">This certifies that</p>
<h2 style="font-size:32px; margin:16px 0;">{{ recipient }}</h2>
<p>has successfully completed</p>
<h3>{{ course }}</h3>
<p>Issued on {{ date }} by {{ issuer }}</p>
<p style="margin-top:48px;">Credential ID: {{ credential_id }}</p>
</article>FAQ
How do I generate a certificate PDF from the API?
Send a POST to /api/v1/pdf with a source of type "template": pass your certificate HTML template and a data object with the recipient name, course, and date. Docweave binds the JSON into the {{ placeholders }} and returns the certificate PDF.
Can I generate certificate PDFs in bulk?
Yes. Call /api/v1/pdf once per recipient with the same template and different data. Because each request is independent, you can fan out and generate a batch of personalized certificates in parallel.
Can certificates be landscape or use custom fonts and styling?
Yes. Pass options like landscape and format to control page layout, and style the certificate with any CSS in the HTML template — fonts, borders, and background colors are all under your control.
How is certificate PDF generation priced?
Pricing is per document, not per page. Each certificate you generate counts as a single document.
Ready to generate certificate PDFs in production?
Get an API key