Skip to main content
POST
/
client
/
email-templates
Create template
curl --request POST \
  --url http://localhost:8080/api/v1/client/email-templates \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "html_body": "<string>",
  "name": "Welcome Template",
  "preview_text": "A short introduction that appears in inbox previews",
  "subject": "Welcome to MailerPath",
  "text_body": "<string>",
  "type": 0
}
'
{
  "data": {
    "created_at": "<string>",
    "deleted_at": {
      "time": "<string>",
      "valid": true
    },
    "html_body": "<string>",
    "id": 123,
    "name": "<string>",
    "preview_text": "<string>",
    "source_template": "<unknown>",
    "source_template_id": 123,
    "subject": "<string>",
    "text_body": "<string>",
    "updated_at": "<string>",
    "user_id": 123
  },
  "errors": [
    {
      "condition": "format",
      "error": "Invalid email format",
      "key": "email"
    }
  ],
  "message": "Operation successful",
  "meta": {},
  "success": true
}

Authorizations

Authorization
string
header
required

JWT Bearer token or raw API key via Authorization header

Body

application/json

Template payload

html_body
string
name
string
Example:

"Welcome Template"

preview_text
string
Example:

"A short introduction that appears in inbox previews"

subject
string
Example:

"Welcome to MailerPath"

text_body
string
type
integer
Example:

0

Response

Template created successfully

data
object
errors
object[]
message
string
Example:

"Operation successful"

meta
object
success
boolean
Example:

true