Add a template entry
Registers a `.tsx` file under `templates/` or `emails/` in an existing template project as its own template and returns it with status 201.
Registers a .tsx file under templates/ or emails/ in an existing template project as its own template and returns it with status 201. The file does not need to exist yet; publishing fails until a commit contains it. Repeating the call with the same entry path, name, and slug returns the existing template.
Authorization
apiKey x-api-key<token>
In: header
Path Parameters
id*string
Match
^tproj_[0-9a-hjkmnp-tv-z]{16,24}$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
entryPath*string
Match
^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?!.*(?:^|\/)\.git(?:\/|$))(?:templates|emails)\/.+\.tsx$Length
length <= 1024name*string
Length
1 <= length <= 200slug*string
Match
^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$description?string|null|null
category?|null|null
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/templates/projects/string/entries" \ -H "Content-Type: application/json" \ -d '{ "entryPath": "string", "name": "string", "slug": "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": {}}