SendLit logoSendLit Docs
API ReferenceTemplates

Create an email template

Purpose is immutable. Marketing content must contain exactly one final managed footer; transactional content must not contain a footer or marketing-only variables.

POST
/templates

Purpose is immutable. Marketing content must contain exactly one final managed footer; transactional content must not contain a footer or marketing-only variables.

x-sendlit-apikey<token>

In: header

Request Body

application/json

Body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.sendlit.dev/templates" \  -H "Content-Type: application/json" \  -d '{    "title": "string",    "content": {      "style": {        "colors": {          "background": "string",          "foreground": "string",          "border": "string",          "accent": "string",          "accentForeground": "string"        },        "typography": {          "header": {},          "text": {},          "link": {}        },        "interactives": {          "button": {},          "link": {}        },        "structure": {          "page": {},          "section": {}        }      },      "meta": {},      "content": [        {          "settings": {            "content": "string"          },          "blockType": "text"        }      ]    }  }'
{
  "templateId": "string",
  "title": "string",
  "purpose": "marketing",
  "content": {
    "style": {
      "property1": null,
      "property2": null
    },
    "meta": {
      "property1": null,
      "property2": null
    },
    "content": [
      {
        "property1": null,
        "property2": null
      }
    ]
  },
  "requiredVariables": [
    "string"
  ],
  "validationError": "string",
  "createdAt": "string",
  "updatedAt": "string"
}
{
  "error": "string",
  "variables": [
    "string"
  ]
}