Create certificates over REST#
Use this guide when a client outside Plone, such as a script or a form, creates certificates. The services are described in the REST API reference.
Before you start#
Know the URL of the template, such as
https://example.org/plone/template.Have credentials for a user who may edit the template and holds the Add Certificate permission in the target folder. The examples use HTTP basic authentication. Install explains how to grant the permission.
Know the folder path where the certificates go, such as
/certificates.
Preview the template#
Download a preview of the stored blueprint filled with sample data. It needs a valid blueprint, and the user must be able to modify the template.
curl -u editor:secret -o preview.png "https://example.org/plone/template/@preview?format=png"
Validate a blueprint before saving it#
curl -u editor:secret -H "Content-Type: application/json" \
-d @blueprint-request.json \
https://example.org/plone/template/@validate-blueprint
The file blueprint-request.json holds {"blueprint": {...}}.
The response says whether the blueprint is valid, and lists the problems when it is not.
Nothing is saved.
Create a certificate#
Write the request body to a file, certificate-request.json:
{
"data": {
"full_name": "Patrick Stewart",
"event_name": "Star Trek: Picard",
"event_start_date": "2026-05-26",
"event_end_date": "2026-06-09",
"responsible_person": "Jean-Luc Picard",
"total_hours": "47"
},
"path": "/certificates",
"format": "pdf"
}
Send it:
curl -u editor:secret -H "Content-Type: application/json" \
-d @certificate-request.json \
https://example.org/plone/template/@create-certificate
A successful request returns 201 and the summary of the new certificate item.
Read the error object when the status is 400.
It names the problem, and for missing values it lists them in a missing field.
A 401 means the user does not hold the Add Certificate permission in the folder.
Render without storing#
@render returns the file in the response and stores nothing.
Use it to check how data looks.
The printed certificate ID is the sample ID, so this output cannot be verified later.
curl -u editor:secret -H "Content-Type: application/json" \
-d @certificate-request.json \
-o check.pdf \
https://example.org/plone/template/@render