Create a template

Creates an email template project from Samva's canonical TSX starter and returns its template entry with status 201.

POST
/v1/templates

Creates an email template project from Samva's canonical TSX starter and returns its template entry with status 201.

x-api-key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name*string
Length1 <= length <= 200
projectName?|null
slug?|null
galleryTemplateId?|null
useBrand?|null
description?string|null|null
category?|null|null
isActive?boolean|null
idempotencyKey*string
Length1 <= length <= 255

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/templates" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "idempotencyKey": "string"  }'
{  "id": "string",  "slug": "string",  "name": "string",  "channel": "email",  "projectId": "string",  "entryPath": "string",  "status": "draft",  "isActive": true,  "publishedAt": "string",  "brand": {    "slug": "string",    "digest": "string",    "stale": true  },  "fromDefault": {    "email": "string",    "name": "string"  },  "usageCount": 0,  "lastUsedAt": "string",  "createdAt": "string",  "updatedAt": "string",  "familyId": "string",  "description": "string",  "category": "transactional",  "replyToDefault": [    "string"  ],  "trackingDefault": {    "opens": true,    "clicks": true  },  "email": {    "subject": "string",    "preheader": "string",    "headers": {      "property1": "string",      "property2": "string"    }  },  "publicationId": "string",  "inputContractId": "string",  "inputSchema": {    "property1": "string",    "property2": "string"  }}

Related documentation