Certificate PDF API & SDK
Need an SDK or API to create PDF certificates? Docweave is a certificate PDF API: pass a template + JSON (recipient, course, date) and get a print-ready certificate back in one REST call — or from an AI agent via the open-source MCP tool.
Issue one credential or thousands in parallel. Same per-document pricing whether the certificate is one page or a multi-page packet.
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" \
-H "Accept: application/pdf" \
--output certificate.pdf \
-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
Is there an SDK to create PDF certificates?
Yes. Use the Docweave REST API as your certificate PDF SDK from any language (curl, Node, Python, etc.), or install the open-source MCP server (`npx @docweave/mcp`) so an AI agent can call generate_pdf with your certificate template and recipient JSON.
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