Skip to content
Esc
↑↓navigate↵open⌘Jpreview

Create a template

POST/templates
Authorization
AuthorizationBearer token · headerrequired

A BillionSend API key (bs_…).

Request body
requiredapplication/json
namestringrequired
min length 1 · max length 200
subjectstring | null

"" or null clears the subject

max length 998
htmlstringrequired

Stored as sent; the dashboard sanitizes at render

min length 1 · max length 500000
textstring | null

"" or null clears the text part

max length 500000
aliasstring | null

Case-sensitive handle, unique per team; GET /templates/{alias} resolves it

min length 1 · max length 100 · matches ^[A-Za-z0-9][A-Za-z0-9._-]*$
fromstring | null

Not supported yet: any value is a 422

reply_tostring | string[] | null

Not supported yet: any value is a 422

Show properties
Any of:
string
string
string[]
Array of string
string
null
null
variablesany[]

Not supported yet: a non-empty list is a 422

Responses
200

Template created. Templates have no draft/publish cycle: every save is live, so status is always published.

objectstringrequired
Allowed:template
idstring<uuid>required
401

Missing, malformed, unknown or revoked API key

statusCodenumberrequired
namestringrequired
messagestringrequired
409

Alias already in use

statusCodenumberrequired
namestringrequired
messagestringrequired
422

Validation error, including from/reply_to/variables (not supported yet)

statusCodenumberrequired
namestringrequired
messagestringrequired
429

Over the rate limit (rate_limit_exceeded, with Retry-After)

statusCodenumberrequired
namestringrequired
messagestringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'https://api.billionsend.com/templates' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "subject": "string",
  "html": "string",
  "text": "string",
  "alias": "string",
  "from": "string",
  "reply_to": "string",
  "variables": [
    null
  ]
}'
Response
{
  "object": "template",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

Was this page helpful?