API referenceTemplates

Create a template

POST/templates

Saves a draft with HTML, optional text, subject, preheader, sender defaults and up to 50 variables ({{{KEY}}}, {{{KEY|fallback}}} or {{ KEY | default: "x" }}). Publish it before sending with it. React Email is not compiled server-side: send the rendered html (react is stored as source only).

Authorization

apiKey
AuthorizationBearer <token>

A project API key: Authorization: Bearer s0_…

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/templates" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "object": "template",  "id": "string"}