Create a template
POST
/templates
const url = 'https://mail.teamander.com/v1/templates';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":"receipt","name":"Receipt","subject_template":"Your receipt from {{company}}","mjml_source":"<mjml><mj-body><mj-section><mj-column><mj-text>Hi {{name}}</mj-text></mj-column></mj-section></mj-body></mjml>"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://mail.teamander.com/v1/templates \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": "receipt", "name": "Receipt", "subject_template": "Your receipt from {{company}}", "mjml_source": "<mjml><mj-body><mj-section><mj-column><mj-text>Hi {{name}}</mj-text></mj-column></mj-section></mj-body></mjml>" }'Provide mjml_source (compiled to HTML at save time) or raw html.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
id
required
string
name
required
string
subject_template
required
string
mjml_source
string
design_json
object
schema_version
required
integer
theme
object
backgroundColor
required
string
contentBackgroundColor
required
string
fontFamily
required
string
linkColor
required
string
width
required
string
blocks
required
Array
One of:
object
id
required
string
type
required
string
html
required
string
align
required
string
color
string
object
id
required
string
type
required
string
label
required
string
href
required
string
align
required
string
backgroundColor
string
color
string
object
id
required
string
type
required
string
src
required
string
alt
required
string
href
string
width
string
align
required
string
object
id
required
string
type
required
string
color
string
object
id
required
string
type
required
string
height
required
integer
object
id
required
string
type
required
string
align
required
string
networks
required
Array<object>
object
name
required
string
href
required
string
object
id
required
string
type
required
string
html
required
string
unsubscribeUrl
string
object
id
required
string
type
required
string
columns
required
Array<object>
object
blocks
required
Array
One of:
object
id
required
string
type
required
string
html
required
string
align
required
string
color
string
object
id
required
string
type
required
string
label
required
string
href
required
string
align
required
string
backgroundColor
string
color
string
object
id
required
string
type
required
string
src
required
string
alt
required
string
href
string
width
string
align
required
string
object
id
required
string
type
required
string
color
string
object
id
required
string
type
required
string
height
required
integer
object
id
required
string
type
required
string
align
required
string
networks
required
Array<object>
object
name
required
string
href
required
string
object
id
required
string
type
required
string
html
required
string
unsubscribeUrl
string
html
string
text_body
string
variables
object
key
additional properties
string
Example
{ "id": "receipt", "name": "Receipt", "subject_template": "Your receipt from {{company}}", "mjml_source": "<mjml><mj-body><mj-section><mj-column><mj-text>Hi {{name}}</mj-text></mj-column></mj-section></mj-body></mjml>"}Responses
Section titled “Responses”Created
Media typeapplication/json
object
id
required
string
status
required
string
warnings
Array<string>
variables
object
key
additional properties
string
Example
{ "id": "receipt", "status": "created"}Validation failed
Media typeapplication/json
object
error
required
string
details
object
key
additional properties
Example
{ "error": "Validation failed", "details": {}}Missing or invalid API key
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "Invalid API key"}