Skip to main content
POST
/
templates
Create a template
curl --request POST \
  --url https://api.pulsewave.dev/v1/templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Invoice receipt",
  "subject": "<string>",
  "body": "<string>"
}
'
{
  "id": "tmpl_8f3e2a",
  "object": "template",
  "name": "<string>",
  "subject": "<string>",
  "body": "<string>",
  "version": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

All requests must include Authorization: Bearer <api_key>. Keys are prefixed pw_live_ or pw_test_. See Authentication.

Body

application/json
name
string
required
Example:

"Invoice receipt"

channel
enum<string>
required

Delivery channel for a message

Available options:
email,
sms,
push
subject
string

Default subject for email templates. Supports {{ variable }} syntax.

body
string

Template body. Supports {{ variable }} syntax.

Response

The created template

id
string
Example:

"tmpl_8f3e2a"

object
enum<string>
Available options:
template
name
string
channel
enum<string>

Delivery channel for a message

Available options:
email,
sms,
push
subject
string | null
body
string
version
integer

Incremented every time the body changes

created_at
string<date-time>
updated_at
string<date-time>