Skip to main content
Adds a template: one message written once per channel, with {{values}}. A message names it by template and gives the values in values.
Needs the templates:write scope.

Body

variants holds one object per channel, keyed sms or whatsapp, in that channel’s content shape: SMS takes text; WhatsApp takes text (inside the 24-hour window) and template, language and params (an approved WhatsApp template, used outside it). Write {{name}} wherever a value goes; variables in the answer lists every name the template needs. Send an Idempotency-Key header to make a retry safe: the same key with the same body is answered once, and the first answer repeated (with Idempotent-Replayed: true).

Request

Response

201 Created

Errors

Every refusal is {"error": {"code", "message", "field"}}; field is there when one input is at fault. Any request can also be refused for its key, its account or its rate (key_required, invalid_key, account_suspended, plan_excludes_api, address_not_allowed, rate_limited); see the overview.