Skip to main content
POST
/
api
/
templates.compile
Compile template
curl --request POST \
  --url https://{notifuseDomain}/api/templates.compile \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "template_content": {},
  "template_data": {
    "user_name": "John Doe",
    "action_url": "https://example.com/action"
  }
}'
{
  "html": "<string>",
  "errors": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

API token for authentication

Body

application/json
template_content
object
required

MJML template structure to compile

template_data
object
required

Data to use for Liquid templating

Example:
{
"user_name": "John Doe",
"action_url": "https://example.com/action"
}

Response

Template compiled successfully

html
string

Compiled HTML output

errors
string[]

Compilation errors, if any