Pular para o conteúdo
Esc
↑↓navegar↵abrir⌘Jpré-visualizar

Create a template

POST/templates
Autorização
AuthorizationToken Bearer · headerobrigatório

A BillionSend API key (bs_…).

Corpo da requisição
obrigatórioapplication/json
namestringobrigatório
comprimento mín. 1 · comprimento máx. 200
subjectstring | null

"" or null clears the subject

comprimento máx. 998
htmlstringobrigatório

Stored as sent; the dashboard sanitizes at render

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

"" or null clears the text part

comprimento máx. 500000
aliasstring | null

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

comprimento mín. 1 · comprimento máx. 100 · corresponde a ^[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

Mostrar propriedades
Pelo menos um de:
string
string
string[]
Array de string
string
null
null
variablesany[]

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

Respostas
200

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

objectstringobrigatório
Valores permitidos:template
idstring<uuid>obrigatório
401

Missing, malformed, unknown or revoked API key

statusCodenumberobrigatório
namestringobrigatório
messagestringobrigatório
409

Alias already in use

statusCodenumberobrigatório
namestringobrigatório
messagestringobrigatório
422

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

statusCodenumberobrigatório
namestringobrigatório
messagestringobrigatório
429

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

statusCodenumberobrigatório
namestringobrigatório
messagestringobrigatório
Experimentar
Servidor
Autorização
Corpoapplication/json
Requisição
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
  ]
}'
Resposta
{
  "object": "template",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

Esta página foi útil?