Skip to main content
POST
/
api
/
templates.create
Create a template
curl --request POST \
  --url https://{notifuseDomain}/api/templates.create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workspace_id": "ws_1234567890",
  "id": "welcome_email",
  "name": "Welcome Email",
  "channel": "email",
  "category": "transactional",
  "template_macro_id": "<string>",
  "test_data": {},
  "settings": {}
}
'
{ "template": { "id": "welcome_email", "name": "Welcome Email", "channel": "email", "category": "transactional", "version": 1, "email": { "subject": "Welcome, {{user_name}}!", "compiled_preview": "<string>", "visual_editor_tree": { "type": "mjml", "children": [] }, "sender_id": "sender_123", "reply_to": "support@example.com", "subject_preview": "Get started with your account", "text": "<string>" }, "web": { "content": {}, "html": "<string>", "plain_text": "<string>" }, "template_macro_id": "<string>", "integration_id": "<string>", "test_data": { "user_name": "John Doe", "action_url": "https://example.com/action" }, "settings": {}, "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z", "deleted_at": "2023-11-07T05:31:56Z" } }

Documentation Index

Fetch the complete documentation index at: https://docs.notifuse.com/llms.txt

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

Authorizations

Authorization
string
header
required

API token for authentication

Body

application/json
workspace_id
string
required

The ID of the workspace

Example:

"ws_1234567890"

id
string
required

Unique identifier for the template (alphanumeric, underscores, and hyphens only)

Maximum string length: 32
Pattern: ^[a-zA-Z0-9_-]+$
Example:

"welcome_email"

name
string
required

Name of the template

Maximum string length: 32
Example:

"Welcome Email"

channel
enum<string>
required

Communication channel

Available options:
email,
web
Example:

"email"

category
enum<string>
required

Template category

Available options:
marketing,
transactional,
welcome,
opt_in,
unsubscribe,
bounce,
blocklist,
blog,
other
Example:

"transactional"

email
object
web
object
template_macro_id
string | null

ID of the template macro (layout) to use

test_data
object

Test data for template preview

settings
object

Channel-specific settings

Response

Template created successfully

template
object