Aller au contenu
Esc
↑↓naviguer↵ouvrir⌘Japerçu

Create a template

POST/templates
Autorisation
AuthorizationJeton Bearer · headerrequis

A BillionSend API key (bs_…).

Corps de la requête
requisapplication/json
namestringrequis
longueur min 1 · longueur max 200
subjectstring | null

"" or null clears the subject

longueur max 998
htmlstringrequis

Stored as sent; the dashboard sanitizes at render

longueur min 1 · longueur max 500000
textstring | null

"" or null clears the text part

longueur max 500000
aliasstring | null

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

longueur min 1 · longueur max 100 · correspond à ^[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

Afficher les propriétés
Au moins un de :
string
string
string[]
Tableau de string
string
null
null
variablesany[]

Not supported: a non-empty list is a 422

Réponses
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.

objectstringrequis
Valeurs autorisées :template
idstring<uuid>requis
401

Missing, malformed, unknown or revoked API key

statusCodenumberrequis
namestringrequis
messagestringrequis
409

Alias already in use

statusCodenumberrequis
namestringrequis
messagestringrequis
422

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

statusCodenumberrequis
namestringrequis
messagestringrequis
429

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

statusCodenumberrequis
namestringrequis
messagestringrequis
Essayer
Serveur
Autorisation
Corpsapplication/json
Requête
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
  ]
}'
Réponse
{
  "object": "template",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

Cette page vous a-t-elle été utile ?