Templates

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. 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.

post/v1/templates/projects/{id}/entries

Request

  • Base URL: https://api.samva.dev
  • URL: https://api.samva.dev/v1/templates/projects/{id}/entries
  • Auth: API key in header x-api-key

Path parameters

idstring required

Request body

entryPathstring required
namestring required
slugstring required
descriptionstring nullable
category'transactional' | 'marketing' | 'support' | 'notification' | 'verification' | 'reminder' | 'alert' nullable

Response

Success

idstring required
slugstring required
namestring required
channel'email' required
projectIdstring required
namespaceIdstring required
sharedboolean required

Whether the template's project is shared with every namespace. Every entry in a project shares it. A namespace-scoped key reads and sends a shared template in its own namespace but cannot change it. Only an organization-level project is shared.

entryPathstring required
status'draft' | 'pending' | 'approved' | 'published' | 'rejected' | 'archived' required
isActiveboolean required
publishedAtstring nullable required
usageCountinteger required
lastUsedAtstring nullable required
createdAtstring required
updatedAtstring required
familyIdstring required
descriptionstring nullable required
category'transactional' | 'marketing' | 'support' | 'notification' | 'verification' | 'reminder' | 'alert' nullable required
replyToDefaultstring[] nullable required
publicationIdstring required
inputContractIdstring required
inputSchemaobject nullable required

Changes

No recorded changes to this operation across all 1 revision of this API.