A certificate generator API takes one certificate design and one row of data per person, and returns one file per person. You send the recipient's name, the course, the date and a signature. You get back a PDF with all of it laid out, and a QR code that opens that certificate's own verify page.
That's the whole job. This post shows the request for one certificate, the bulk request for a cohort, what someone sees when they scan the code, and how to revoke a certificate you issued by mistake.
What a certificate API should do
Before picking a tool, check it does these four things:
- Design once. The layout, fonts, border and logo live in a template. Nobody edits a PDF per person.
- Data per person. Name, course, date and certificate ID come from your LMS export, event check-in list or spreadsheet.
- Verifiable. Each certificate carries a code (usually a QR) that opens a page saying who it was issued to, by whom, and whether it's still valid, so an employer can check it's real.
- Print-ready output. A vector PDF, so text stays sharp at A4 or Letter and the name is selectable.
If a tool only gives you a PNG, or makes you build the layout in HTML, you'll feel it the first time someone prints one.
Designing the template
In bannx you design the certificate in the editor, then turn the parts that change into variables. A typical certificate needs five:
| Variable | Type | Bound to |
|---|---|---|
recipient | text | the name line |
course | text | the course or event title |
issuedOn | text | the date line |
signature | signature | an image layer above the signer's name |
email | text | nothing on the page: it tells bannx who the certificate belongs to |
Three details make this work:
- Signature variables take an image: an
https://URL to a signature PNG, or adata:image/png;base64,…data URL. On the template's own page the field becomes a pad where the signer can draw, type or upload their signature. See signature variables. - Verified documents are switched on in the template's settings: Template settings → Verified documents. Pick Certificate, give it a title ("Certificate of completion"), choose the public fields the verify page shows (
recipientas "Name",courseas "Course") and setemailas the subject key. Nothing else becomes public. - QR code layers encode their layer Value. Set that Value to
{{ credential.url }}and every certificate prints the link to its own verify page, hosted by bannx. Print{{ credential.code }}beside it, an 8-character code a person can read out. See verified documents.
The variable names above are examples. Use whatever names your template declares; the API matches them by name. More on declaring them in variables.
Publish the template when the design is done. API renders use the published version, setting included, so publish again whenever you change the verified documents setting.
One certificate from the API
One POST per certificate. You need the template ID (from the editor URL) and an API key with the template.render scope.
curl -X POST https://bannx.com/api/v1/templates/TEMPLATE_ID/render \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "pdf",
"variables": {
"recipient": "Ada Lovelace",
"course": "Data Foundations",
"issuedOn": "12 October 2026",
"signature": "https://example.com/signatures/jane.png",
"email": "[email protected]"
}
}'
The response is JSON with a url to the stored PDF, and the certificate's verify page under credential:
{
"ok": true,
"templateId": "TEMPLATE_ID",
"format": "pdf",
"url": "https://…/render.pdf",
"pages": 1,
"credential": {
"id": "4kT9xw2pQm7LbR1sVd8eZc",
"url": "https://bannx.com/verify/4kT9xw2pQm7LbR1sVd8eZc",
"code": "4KT9XW2P",
"reused": false
}
}
credential.url is the link the QR code holds. Add "raw": true to get the PDF bytes back directly instead of a URL. That's the faster path when your server attaches the file to an email itself; the verify link then comes back in the x-credential-url header.
The same call from JavaScript, for example inside the handler that runs when a learner completes a course:
async function issueCertificate(learner) {
const res = await fetch(
`https://bannx.com/api/v1/templates/${process.env.BANNX_CERT_TEMPLATE}/render`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.BANNX_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
format: "pdf",
variables: {
recipient: learner.fullName,
course: learner.courseTitle,
issuedOn: learner.completedAt.toLocaleDateString("en-GB", { dateStyle: "long" }),
signature: process.env.INSTRUCTOR_SIGNATURE_URL,
email: learner.email,
},
}),
},
);
if (!res.ok) throw new Error(`Render failed: ${res.status}`);
const { url, credential } = await res.json();
// store both on the learner's record: the PDF, and the certificate's verify page
return { pdfUrl: url, certificateId: credential.id, verifyUrl: credential.url };
}
Because email is the subject key, calling this twice for the same learner with the same details doesn't create a second certificate: the response says "reused": true and carries the same verify link. Fix a typo in the name and render again, and the learner gets a new certificate while the old one is marked as replaced.
Keep the key on your server. It belongs in an Authorization header, never in browser code.
If your template has two scenes (say, a front with the certificate and a back with the course outline), a PDF render returns both as pages of one file.
A whole cohort at once
Rendering 300 certificates one call at a time works, but you'd be managing retries and rate limits yourself (the render endpoint allows 30 requests a minute per key). The bulk endpoint takes the whole list in one request and returns a ZIP.
curl -X POST https://bannx.com/api/v1/templates/TEMPLATE_ID/bulk \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "pdf",
"rows": [
{ "name": "ada-lovelace", "recipient": "Ada Lovelace", "course": "Data Foundations", "email": "[email protected]" },
{ "name": "alan-turing", "recipient": "Alan Turing", "course": "Data Foundations", "email": "[email protected]" }
]
}'
# → { "ok": true, "jobId": "…", "total": 2 }
Each row holds the variable values by name. A row can also carry an id or name key, which names that row's file inside the ZIP, so ada-lovelace.pdf is easy to match back to a person. Any variable a row leaves out keeps the template's saved value, so the instructor's signature and the issue date only need setting once in the template if they're the same for everyone.
Then poll the job until it finishes:
curl https://bannx.com/api/v1/templates/bulk/JOB_ID \
-H "Authorization: Bearer YOUR_API_KEY"
# → { "jobId": "…", "state": "active", "total": 2, "completed": 1, "succeeded": 1, "failed": 0, "errors": [] }
# → { …, "state": "completed", "zipUrl": "https://…/renders.zip",
# "credentials": [{ "row": "1", "credentialId": "4kT9…", "url": "https://bannx.com/verify/4kT9…", "code": "4KT9XW2P", "reused": false }, …] }
Every row that rendered gets its own certificate and verify page, listed under credentials. If your export has no email column, add a _credentialKey column with the learner ID instead; it tells bannx who each row belongs to and never reaches the design.
A few limits worth knowing:
- Up to 500 rows per job. Split a bigger cohort into several jobs.
- Failed rows are reported, not silent. The job lists them in
errors, and a row that fails to render isn't charged. - CSV works too. On the template's page, open Bulk, then Playground. It takes a CSV whose header row is your variable names, or JSON rows, and runs exactly this request. Handy for a one-off cohort from an LMS export. The general version of this flow, for any spreadsheet, is in generate images from a spreadsheet.
What someone sees when they scan it
The QR code opens the certificate's verify page on bannx.com. It's made for a phone, and it isn't indexed by search engines. It shows:
- a status: Valid, Expired, Revoked (with the reason you gave) or Replaced (with a link to the current certificate);
- the public fields you picked, as they were when the certificate was issued, and the issue date;
- who issued it: your space's name and logo, and Verified issuer: yourdomain.com once you've proved you own the domain with a DNS TXT record;
- a fingerprint of the file, so a PDF someone forwards can be compared with the one you issued.
Nobody can change what the page says. The fields are frozen when the certificate is issued, the link holds 128 random bits so it can't be guessed, and a forged PDF with a copied QR code still opens the real record, with the real name on it.
You manage every certificate on the Verified documents page of your space: search, revoke one issued in error, delete one when a learner asks for their data to be removed, or export the list as a CSV. The full reference is in the verified documents docs.
Hosting the verify page yourself
If you'd rather keep the record on your own site, leave verified documents off, add a verifyUrl text variable, bind the QR code to {{ verifyUrl }} and pass a link to your own page in each render. bannx draws the code; your system owns the record and the page.
Certificates as links that can't be forged
Sometimes you don't want to send a file. You want a link in the completion email, on the learner's profile page or in a LinkedIn post.
The verify link is one: it's public, it shows the learner's name and course, and you can revoke it. For an image to post, use a signed image URL. It has no API key in it, and it carries a signature over every value in it. If someone edits recipient=Ada to recipient=Eve, the signature no longer matches and nothing renders. So the link is public, and frozen: only you can mint new ones.
Mint one per recipient, up to 500 per call:
curl -X POST https://bannx.com/api/v1/templates/TEMPLATE_ID/signed-urls \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"rows": [
{ "variables": { "recipient": "Ada Lovelace", "course": "Data Foundations" } },
{ "variables": { "recipient": "Alan Turing", "course": "Data Foundations" } }
],
"options": { "format": "png" }
}'
You get back one url per row. Signing itself is free. Each link renders on its first open and serves the saved image on every open after that, so the certificate looks identical every time someone checks it.
Two things to plan for:
- Signed links are images, not PDFs. They render PNG or WebP. Use them for the shareable version; use the render or bulk API for the printable PDF.
- Signed links don't issue certificates. On a signed image,
{{ credential.url }}is a sample link, so make the image version without the QR code, or put the learner's verify link next to the image. - Add
expfor links that should expire, as unix seconds. Useful for time-limited credentials or event passes.
There's more on how the signature works, and how to sign offline inside a CRM, in the signed image URLs docs and in our post on signed URL use cases.
Wiring it into your LMS, automation or AI agent
Because it's plain HTTP, the API fits wherever "a learner finished something" is an event:
- Your LMS or app: call the render endpoint from the completion handler, like the
fetchexample above, and save the returned URL on the learner record. - Zapier or n8n: use the bannx Zapier app or n8n node. Pick the certificate template and map the learner's name and course to its fields; the step returns the file URL, and a New Render trigger can start the next step when a render finishes.
- Make: there's no bannx app yet, so use the generic HTTP request module with the same body. For long jobs, a
render.completedwebhook tells your scenario when a file is ready. - An AI agent: bannx runs an MCP server. An assistant like Claude or Cursor can call
render_templateto issue a certificate (the result carries the samecredential), orsign_template_urlsto mint links, with the same variables.
What bannx doesn't do: it doesn't email recipients for you, and there's no Google Sheets connector. Send the files or links with your own email tool, and export a CSV from your sheet for bulk runs.
Where bannx fits
bannx is a template-to-file engine. You design a certificate once in the browser editor, mark what changes, and render one file per row of data from the API, a CSV, a signed link or an agent. Same engine paints the editor preview and the server render, so what you approve on screen is what lands in the PDF.
It fits when you have data and volume: a training provider issuing a cohort a month, an event with hundreds of attendees, an LMS that needs a certificate the moment a course is marked complete. If you only need one certificate by hand, any public certificate template on bannx.com can be edited in the browser and downloaded as a PDF for free, no account and no watermark.
FAQ
Is the PDF vector or an image?
Vector. Text stays text, so it's sharp at any print size and the name is selectable and searchable. QR codes and barcodes are drawn as vectors too.
What size should a certificate be?
Design it at the paper size you'll print on, usually A4 or US Letter landscape. The editor has an A4 preset. If you also need a square version for social sharing, the render API's size option renders the same design at another size without a second template.
How does someone verify a certificate?
They scan the QR code. It opens the certificate's verify page on bannx, which says whether it's valid, expired, revoked or replaced, shows the name and course you chose to make public, and names the issuer. A developer can check the same record with GET /api/v1/credentials/{id}, no API key needed. If you'd rather host the page yourself, bind the QR code to your own verifyUrl variable instead.
Can I cancel a certificate after it's issued?
Yes. Revoke it on the Verified documents page of your space and its verify page says Revoked, with the reason you give. The PDF already sent can't be recalled, but anyone who scans it sees that it's no longer valid.
Can each certificate have a different signer?
Yes. signature is a variable like any other, so each row can pass a different signature image URL. Leave it out of the rows to use the one saved in the template.
How do I send the certificates out?
With your own email tool or automation. Attach the PDF from the render or bulk response, or put the signed link in the email body. bannx renders the files; delivery stays in the system that already knows your recipients.