Zum Inhalt springen
Esc
↑↓navigieren↵öffnen⌘Jvorschau

Create a template

POST/templates
Autorisierung
AuthorizationBearer-Token · headererforderlich

A BillionSend API key (bs_…).

Request-Body
erforderlichapplication/json
namestringerforderlich
min. Länge 1 · max. Länge 200
subjectstring | null

"" or null clears the subject

max. Länge 998
htmlstringerforderlich

Stored as sent; the dashboard sanitizes at render

min. Länge 1 · max. Länge 500000
textstring | null

"" or null clears the text part

max. Länge 500000
aliasstring | null

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

min. Länge 1 · max. Länge 100 · entspricht ^[A-Za-z0-9][A-Za-z0-9._-]*$
fromstring | null

Not supported: any value is a 422

reply_tostring | string[] | null

Not supported: any value is a 422

Eigenschaften anzeigen
Mindestens eines von:
string
string
string[]
Array von string
string
null
null
variablesany[]

Not supported: a non-empty list is a 422

Antworten
200

Template created. Every save through the API is live and publishes a new version, so status is always published. The dashboard editor keeps a working copy and publishes on request, with a version history.

objectstringerforderlich
Erlaubt:template
idstring<uuid>erforderlich
401

Missing, malformed, unknown or revoked API key

statusCodenumbererforderlich
namestringerforderlich
messagestringerforderlich
409

Alias already in use

statusCodenumbererforderlich
namestringerforderlich
messagestringerforderlich
422

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

statusCodenumbererforderlich
namestringerforderlich
messagestringerforderlich
429

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

statusCodenumbererforderlich
namestringerforderlich
messagestringerforderlich
Ausprobieren
Server
Autorisierung
Bodyapplication/json
Anfrage
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
  ]
}'
Antwort
{
  "object": "template",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

War diese Seite hilfreich?