Templates API
List Templates
GET /api/v1/templatesCreate Template
POST /api/v1/templatesRequest Body:
json
{
"name": "My Custom Template",
"description": "Minimalist invoice design",
"html_content": "<html>{{invoice_number}}...</html>",
"css_content": "body { font-family: sans-serif; }"
}Get Template
GET /api/v1/templates/:idUpdate Template
PUT /api/v1/templates/:idDelete Template
DELETE /api/v1/templates/:idBuilt-in templates cannot be deleted.
Set as Default
PUT /api/v1/templates/:id/defaultInstall from URL
POST /api/v1/templates/install-urlRequest Body:
json
{
"url": "https://example.com/template-package.json"
}Install from Upload
POST /api/v1/templates/install-uploadAccepts a multipart form upload of a template file.
Update from Remote
POST /api/v1/templates/:id/update-remoteRe-fetches the template from its original source URL.
Preview
POST /api/v1/templates/preview
POST /api/v1/templates/:id/previewRenders the template with sample data and returns the HTML preview.