Skip to main content
Resend Docs

Search documentation

Type to search this documentation.

Create a template

POST/templatesCreate a template

Request body

application/json
objectCreateTemplateRequest
aliasstring

The alias of the template.

fromstring

Sender email address. To include a friendly name, use the format "Your Name <sender@domain.com>".

htmlstringrequired

The HTML version of the template.

namestringrequired

The name of the template.

reply_toarray of string

Reply-to email addresses.

Show child attributes
subjectstring

Email subject.

textstring

The plain text version of the template.

variablesarray of object
Show child attributes
Show array items
fallback_valuevalue

The fallback value of the variable.

Show child attributes
oneOf · 5 options
Option 1string
Option 2number
Option 3boolean
Option 4object
Option 5array of value
keystringrequired

The key of the variable.

typestringrequired

The type of the variable.

one of "string", "number", "boolean", "object", "list"

Example request
{
  "alias": "string",
  "from": "string",
  "html": "string",
  "name": "string",
  "reply_to": [
    "string"
  ],
  "subject": "string",
  "text": "string",
  "variables": [
    {
      "fallback_value": "string",
      "key": "string",
      "type": "boolean"
    }
  ]
}

Responses

201OKapplication/json
objectCreateTemplateResponseSuccess
idstring

The ID of the template.

objectstring

The object type of the response.

Example response
{
  "id": "string",
  "object": "template"
}
Documentation menu