Skip to content

Templates & Community

Terminal window
curl -X POST https://api.tupsara.com/v1/templates \
-H "Authorization: Bearer <clerk-session-jwt>" \
-H "Content-Type: application/json" \
-d '{
"name": "Invoice",
"html": "<h1>{{ title }}</h1>",
"is_public": false
}'
{
"template_id": "2bc5659a-...",
"variables": { "title": "Invoice #142" }
}

html and template_id are mutually exclusive on POST /v1/pdf — send exactly one.

Public templates made by any account are listed at GET /v1/templates/public and usable by anyone as template_id — a starting point instead of writing HTML from scratch. Current examples: a modern invoice, an airline boarding pass, an event ticket with a real scannable QR code, and a festival-style concert ticket.

Terminal window
curl -X PATCH https://api.tupsara.com/v1/templates/{id}/visibility \
-H "Authorization: Bearer <clerk-session-jwt>" \
-H "Content-Type: application/json" \
-d '{"is_public": true}'

Anyone can then render from it. Only you can still edit, delete it, or turn it back private.