Quickstart
This guide walks you through your first render in about five minutes.
1. Create an API key
- Log in to the CommsPliant admin app.
- Open API keys and create a new key.
- Copy the secret — it starts with
ck_and is shown only once.
2. Find your template ID
List templates with your API key on the admin API:
curl -sS 'https://adminapi.commspliant.com/api/v1/templates' \
-H 'X-Api-Key: ck_YOUR_API_KEY'Use the id field from a template as templateId. Do not use a version UUID here.
3. Render HTML
curl -sS -X POST 'https://api.commspliant.com/api/v1/render/html' \
-H 'X-Api-Key: ck_YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"templateId": "550e8400-e29b-41d4-a716-446655440000",
"variables": {
"title": "Hello",
"user": { "name": "Jane Doe" }
}
}' \
--output document.htmlThe response body is the rendered HTML. Save it to a file as shown above.
4. Render PDF (optional)
curl -sS -X POST 'https://api.commspliant.com/api/v1/render/pdf' \
-H 'X-Api-Key: ck_YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"templateId": "550e8400-e29b-41d4-a716-446655440000",
"variables": { "title": "Invoice", "amount": "99.00" }
}' \
--output document.pdfCommon mistakes
- Using a version UUID in
templateId→ returns404 template not found. - Rendering a template that is not approved → returns
422. - Sending a JWT instead of an API key on
api.commspliant.com→ returns403.
Next: read Authentication and the API reference.