How to make certificates for a list of names
One certificate template, hundreds of participants. Send them within your plan's limits, retry the busy ones, and collect the PDFs by callback.
certificatestemplatesbulk
A course ends, and 300 people need a certificate with their own name on it. The certificate is one template; the work is sending 300 requests well: fast, without errors, and without losing any.

The request
Save the template once (Use this template opens it in your dashboard), then send its id and your data for each document:
curl https://api.printpipe.io/v1/generate \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": "YOUR_TEMPLATE_ID",
"data": {
"name": "Alex Morgan",
"course": "Advanced Document Automation",
"date": "22 November 2026",
"hours": 12,
"signer": "Jordan Lee",
"signerTitle": "Head of Training",
"organisation": "Springfield Academy",
"id": "SA-2026-0042"
}
}' \
--output document.pdfimport { writeFile } from 'node:fs/promises';
const res = await fetch('https://api.printpipe.io/v1/generate', {
method: 'POST',
headers: { 'X-API-Key': process.env.API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"templateId": "YOUR_TEMPLATE_ID",
"data": {
"name": "Alex Morgan",
"course": "Advanced Document Automation",
"date": "22 November 2026",
"hours": 12,
"signer": "Jordan Lee",
"signerTitle": "Head of Training",
"organisation": "Springfield Academy",
"id": "SA-2026-0042"
}
}),
});
if (!res.ok) throw new Error((await res.json()).message);
await writeFile('document.pdf', Buffer.from(await res.arrayBuffer()));import os, requests
res = requests.post(
"https://api.printpipe.io/v1/generate",
headers={"X-API-Key": os.environ["API_KEY"]},
json={
"templateId": "YOUR_TEMPLATE_ID",
"data": {
"name": "Alex Morgan",
"course": "Advanced Document Automation",
"date": "22 November 2026",
"hours": 12,
"signer": "Jordan Lee",
"signerTitle": "Head of Training",
"organisation": "Springfield Academy",
"id": "SA-2026-0042"
}
},
timeout=60,
)
res.raise_for_status()
with open("document.pdf", "wb") as f:
f.write(res.content)The certificate
The template is a landscape A4 page with a decorative heading font from Google Fonts (loaded with @import in its <style>), a double border and space for two signatures. Its page settings save the landscape orientation and keep the background colour (printBackground), so each request only sends the participant’s data.
Names vary in length. Test the template with your longest name; if it wraps, lower the heading’s font size or let it shrink with font-size: clamp(32px, 6vw, 48px).
Sending the whole list
Your plan sets how many conversions run at the same time (see Plans & limits). Send more and the extra requests get 429 with errorCode 32 straight away. So run exactly that many workers, each taking the next name when its last certificate is done:
import { writeFile } from 'node:fs/promises';
const PARALLEL = 10; // your plan's parallel conversions
const people = [/* { name, course, date, id }, … */];
async function certificate(person, attempt = 1) {
const res = await fetch('https://api.printpipe.io/v1/generate', {
method: 'POST',
headers: { 'X-API-Key': process.env.API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ templateId: process.env.TEMPLATE_ID, data: person, filename: `certificate-${person.id}` }),
});
// 429: all parallel slots busy. 503: no renderer free in time. Both are safe to retry.
if ((res.status === 429 || res.status === 503) && attempt < 6) {
await new Promise((r) => setTimeout(r, 2 ** attempt * 250 + Math.random() * 250));
return certificate(person, attempt + 1);
}
if (!res.ok) throw new Error(`${person.id}: ${(await res.json()).message}`);
await writeFile(`certificate-${person.id}.pdf`, Buffer.from(await res.arrayBuffer()));
}
const queue = [...people];
await Promise.all(
Array.from({ length: PARALLEL }, async () => {
for (let person; (person = queue.shift()); ) await certificate(person);
}),
);
- Retry only
429and503, with a growing pause and a little randomness so the workers don’t all retry at the same moment. Other errors (a400for bad data) fail the same way again: log them and move on. - Failed conversions cost nothing, so retries are free.
- Keep track of who got a certificate. If your script stops halfway, start again with the rest instead of the whole list.
Let us call you back instead
Holding 10 requests open while certificates render is fine for a script. In a web app, answer your user right away and let the certificates arrive later: add callBackUrl to each request (Plus plans and up). We answer 202 at once, render in the background and POST each PDF to your URL, with the state you sent (for example the participant’s id) so you know whose it is.
{ "templateId": "YOUR_TEMPLATE_ID", "data": { "name": "Alex Morgan" }, "callBackUrl": "https://your-app.example/certificates", "state": "participant-0042" }
Every callback is signed: check the X-Webhook-Signature header before trusting it. Async & callbacks shows how, and what happens when your server is down.
All of them in one PDF
Sometimes the organiser wants one file to print. An AI assistant connected to our MCP server (Plus plans and up) can do this from a sentence (“Fill the certificate template for each of these 12 people and give me one PDF”): its combine_pdfs tool fills the template once per person and joins up to 20 at a time into a single PDF. For larger lists, make the PDFs as above and join them with any PDF library.
Credits
Each certificate is a separate conversion: one credit per started megabyte, so 300 one-page certificates cost about 300 credits. Check that your month’s credits cover the list before you start; your dashboard and GET /v1/usage show what’s left.