Skip to main content
POST
/
templates
Create Template
curl --request POST \
  --url https://api.unosend.co/templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "subject": "<string>",
  "html": "<string>",
  "text": "<string>"
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.unosend.co/llms.txt

Use this file to discover all available pages before exploring further.

name
string
required
A friendly name for the template.
subject
string
required
The email subject line. Supports variables like {{variable}}.
html
string
The HTML body of the email. Supports variables.
text
string
The plain text body of the email. Supports variables.

Request

curl -X POST https://api.unosend.co/templates \
  -H "Authorization: Bearer un_xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Welcome Email",
    "subject": "Welcome to {{company_name}}, {{first_name}}!",
    "html": "<h1>Welcome, {{first_name}}!</h1><p>Thanks for joining {{company_name}}.</p>"
  }'

Response

201
{
  "success": true,
  "data": {
    "id": "tpl_abc123",
    "name": "Welcome Email",
    "subject": "Welcome to {{company_name}}, {{first_name}}!",
    "html": "<h1>Welcome, {{first_name}}!</h1><p>Thanks for joining {{company_name}}.</p>",
    "created_at": "2024-01-15T10:30:00.000Z"
  }
}