Skip to main content
POST
Error

Autorizações

Authorization
string
header
obrigatório

A staff session token, uk_st_…. Minted by sign-up, sign-in or the two-factor exchange. Only a 401 means it is spent; not_a_member (403) is about the organization named in X-Organization-Id and leaves the token good for the others.

Cabeçalhos

X-Organization-Id
string

The organization the caller is acting on — the org_… code that appears in the panel URL. It identifies; the membership JOIN is what authorizes, so a forged code reads nothing: the answer is not_a_member (403), which does not mean the session is over. Absent, the session's default organization answers, or — if that membership was revoked while the session was open — any other one the caller still holds.

Parâmetros de consulta

environment
enum<string>
padrão:live

Which environment to act in. A view parameter, valid only on the staff surface — a machine credential never chooses its environment, it is resolved from the key.

Opções disponíveis:
live,
test

Corpo

application/json
name
string
obrigatório

How you recognise it. Unique per environment, archived rows included.

Maximum string length: 200
channel
enum<string>
obrigatório

in_app templates are accepted before the widget's notification surface exists — a template written for a channel that has no endpoint yet is a draft, not an error.

Opções disponíveis:
email,
in_app
category
enum<string>
obrigatório

Which switch the recipient can throw. See the Notifications tag.

Opções disponíveis:
marketing,
product_news,
surveys
body
string
obrigatório
Maximum string length: 100000
key
string

How a PROGRAM addresses this template — POST /v1/notifications names it here rather than by id. Lowercase letters, digits, underscore and hyphen.

The same key exists once per channel, which is what makes one call reach three doors: fatura_vencendo is a row for email, one for in_app and one for whatsapp, each written for the medium it goes out on.

Omit it for a campaign-only template, addressed by id from a step. A transactional template REQUIRES one — see category.

Maximum string length: 100
Exemplo:

"fatura_vencendo"

variables
(string | object)[]

The placeholders this body may read from the caller's data, declared.

{{.Data.invoice_id}} compiles only when invoice_id is listed here, which is what keeps the save-time check possible with an open value: a typo is refused on the screen of the person who typed it, instead of rendering as an empty half-sentence in ten thousand inboxes. It is also the contract the send validates against.

A list is declared with its columns and is the only thing {{range}} may walk — a loop rebinds the dot, and the columns are what let the check follow it. That is what puts a table in a message without the table being built in your own deploy: the template draws the row, you send the cells.

Names are letters, digits and underscores — a hyphen does not parse inside a template.

A plain value: {{.Data.invoice_id}}.

Exemplo:
subject
string

Required on email, refused on in_app. Rendered like the body.

Maximum string length: 500
url
string

Optional, and in_app only. Where the notifications this template produces lead when somebody acts on one.

A path rooted at / or an absolute http/https URL — nothing else, and never a scheme that executes. Refused on email for the same reason a subject is refused on in_app: an email body here is your own text escaped into our shell, with no call to action for a URL to attach to.

Maximum string length: 2048

Resposta

The template.

template
object

The words this product sends, written once and rendered per person — by a campaign, and since 00165 by POST /v1/notifications too, which addresses it by key and supplies its variables. Per environment, so writing it in test and copying it to live is the obvious workflow rather than a rename.