Templates
Create template
Create a template. Returns 201 with the template. HTML is sanitized on save: scripts, <style> blocks and event handlers are removed; inline styles stay.
POST
https://api.sndr.sh/api/cranl/v1/templatesCreate template
curl -X POST 'https://api.sndr.sh/api/cranl/v1/templates' \
-H 'Authorization: Bearer sndr_your_access_token' \
-H 'Content-Type: application/json' \
-d '{
"name": "Order confirmation",
"subject": "Your order #{{ order_id }} is confirmed",
"html": "<h1>Hi {{ first_name }},</h1><p>Order #{{ order_id }} confirmed.</p>",
"text": "Hi {{ first_name }}, order #{{ order_id }} confirmed."
}'201Created
{
"id": "tpl_c19e5d34-82a",
"organization_id": "org_8d41c7a2-3f6",
"name": "Order confirmation",
"subject": "Your order #{{ order_id }} is confirmed",
"html": "<h1>Hi {{ first_name }},</h1><p>Order #{{ order_id }} confirmed.</p>",
"text": "Hi {{ first_name }}, order #{{ order_id }} confirmed.",
"version": 1,
"created_at": "2026-06-01T12:00:00Z",
"updated_at": "2026-06-01T12:00:00Z"
}Authorization
AuthorizationstringheaderrequiredBearer followed by an access token. Needs the send scope.
Body
application/jsonnamestringrequiredInternal name (not shown to recipients), 1–200 characters.
subjectstringrequiredSubject line, max 998 characters. Supports {{ variable }} placeholders.
htmlstringHTML body. Either html or text is required.
textstringPlain-text body.
Errors
401
unauthenticatedMissing or invalid Bearer token.401
token_expiredAccess token expired — exchange the refresh token for a new pair.401
token_revokedToken was explicitly revoked.400
invalid_requestBody is not valid JSON, has an unknown field, or a field has the wrong type.402
plan_limit_reachedThe plan’s template limit is reached.403
insufficient_scopeToken is missing the send scope.422
validation_failedname or subject is missing or too long, or both html and text are empty.