Templates & Community
Save a template
Section titled “Save a template”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 }'Render from it
Section titled “Render from it”{ "template_id": "2bc5659a-...", "variables": { "title": "Invoice #142" }}html and template_id are mutually exclusive on POST /v1/pdf — send exactly one.
Community templates
Section titled “Community templates”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.
Making a template public
Section titled “Making a template public”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.