Add a template entry
Registers an `emails/*.tsx` file in an existing template project as its own template and returns it with status 201.
Registers an emails/*.tsx file 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
projectId*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(?:\/|$))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", "organizationId": "string", "projectId": "string", "entryPath": "string", "name": "string", "slug": "string", "familyId": "string", "channel": "email", "description": "string", "category": "string", "fromDefault": { "email": "string", "name": "string" }, "replyToDefault": [ "string" ], "trackingDefault": { "opens": true, "clicks": true }, "email": { "subject": "string", "preheader": "string", "headers": { "property1": "string", "property2": "string" } }, "publicationId": "string", "inputContractId": "string", "inputSchema": {}, "usageCount": 0, "lastUsedAt": "string", "status": "string", "isActive": true, "isDefault": true, "publishedAt": "string", "publishedBy": "string", "createdAt": "string", "updatedAt": "string"}