Cakemail
Cakemail API

Template

Create and manage reusable email templates. Templates contain the HTML/text content and subject line that can be reused across multiple campaigns. Templates support custom attributes, tags, and can be rendered to preview the final output.


Show all templates

GET
https://api.cakemail.dev
/templates

List all templates in the account. Results can be filtered by name and sorted by name or creation date.

Required scope(s): templates:read

Show all templates › query Parameters

account_id
​integer · min: 1

Optional Account ID to be used for the request

Optional Account ID to be used for the request

page
​integer · min: 1
Default: 1
per_page
​integer · min: 1
Default: 50
with_count
​boolean

Include count in the response

Include count in the response

Default: false
filter
​string

Valid Terms:

  • tag
  • not_tag
  • name
  • is_owner
  • is_not_owner

Valid Operators:

  • ==

Query separator:

  • ;

Valid Terms:

  • tag
  • not_tag
  • name
  • is_owner
  • is_not_owner

Valid Operators:

  • ==

Query separator:

  • ;
sort
​string

Sort term and direction, using syntax [-|+]term.

Valid terms:

  • id
  • created_on
  • updated_on
  • name

Sort term and direction, using syntax [-|+]term.

Valid terms:

  • id
  • created_on
  • updated_on
  • name
Default: id

Show all templates › Responses

Successful Response

​object · required

Pagination metadata

​TemplateSummaryResponse[] · required

List of templates


Create a template

POST
https://api.cakemail.dev
/templates

Create a new email template with content (HTML, text, and/or JSON), a subject line, and optional tags for organization.

Required scope(s): templates:write

Create a template › query Parameters

account_id
​integer · min: 1

Optional Account ID to be used for the request

Optional Account ID to be used for the request

Create a template › Request Body

name
​string · minLength: 1 · required

Name of the template

​object · required

Content of the template

description
​string

Description of the template

tags
​string[]

Tags to categorize the template

Create a template › Responses

Successful Response

id
​integer · required

ID of the created template

object
​string

Object type

Default: template
created
​boolean

Whether the template was created

Default: true

Get a template

GET
https://api.cakemail.dev
/templates/{template_id}

Retrieve the full details of a template, including its content (HTML, text, JSON), metadata, tags, and sharing configuration.

Required scope(s): templates:read

Get a template › path Parameters

template_id
​integer · required

Get a template › query Parameters

account_id
​integer · min: 1

Optional Account ID to be used for the request

Optional Account ID to be used for the request

Get a template › Responses

Successful Response

​object · required

Template details


Update a template

PATCH
https://api.cakemail.dev
/templates/{template_id}

Update a template's name, content, or description. All fields are optional — only provided fields are updated.

Required scope(s): templates:write

Update a template › path Parameters

template_id
​integer · required

Update a template › query Parameters

account_id
​integer · min: 1

Optional Account ID to be used for the request

Optional Account ID to be used for the request

Update a template › Request Body

name
​string · minLength: 1

Name of the template

description
​string

Description of the template

​object

Content of the template

tags
​string[]

Tags to categorize the template

Update a template › Responses

Successful Response

id
​integer · required

ID of the updated template

​object · required

Updated template details

object
​string

Object type

Default: template
updated
​boolean

Whether the template was updated

Default: true

Delete a template

DELETE
https://api.cakemail.dev
/templates/{template_id}

Delete a template. Campaigns that were created from this template are not affected — they retain their own copy of the content.

Required scope(s): templates:delete

Delete a template › path Parameters

template_id
​integer · required

Delete a template › query Parameters

account_id
​integer · min: 1

Optional Account ID to be used for the request

Optional Account ID to be used for the request

Delete a template › Responses

Successful Response

id
​integer · required

ID of the deleted template

object
​string

Object type

Default: template
deleted
​boolean

Whether the template was deleted

Default: true

Render a template

GET
https://api.cakemail.dev
/templates/{template_id}/render

Render a template's HTML content with merge tags replaced. Returns the final HTML as it would appear when used in a campaign.

Required scope(s): templates:read

Render a template › path Parameters

template_id
​integer · required

Render a template › query Parameters

account_id
​integer · min: 1

Render a template › Responses

Successful Response

string