Saltar al contenido
Esc
↑↓navegar↵abrir⌘Jvista previa

Create a template

POST/templates
Autorización
AuthorizationToken Bearer · headerobligatorio

A BillionSend API key (bs_…).

Cuerpo de la solicitud
obligatorioapplication/json
namestringobligatorio
longitud mín. 1 · longitud máx. 200
subjectstring | null

"" or null clears the subject

longitud máx. 998
htmlstringobligatorio

Stored as sent; the dashboard sanitizes at render

longitud mín. 1 · longitud máx. 500000
textstring | null

"" or null clears the text part

longitud máx. 500000
aliasstring | null

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

longitud mín. 1 · longitud máx. 100 · coincide con ^[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

Mostrar propiedades
Al menos uno de:
string
string
string[]
Array de string
string
null
null
variablesany[]

Not supported: a non-empty list is a 422

Respuestas
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.

objectstringobligatorio
Valores permitidos:template
idstring<uuid>obligatorio
401

Missing, malformed, unknown or revoked API key

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
409

Alias already in use

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
422

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

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
429

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

statusCodenumberobligatorio
namestringobligatorio
messagestringobligatorio
Pruébalo
Servidor
Autorización
Cuerpoapplication/json
Solicitud
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
  ]
}'
Respuesta
{
  "object": "template",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

¿Te ha resultado útil esta página?