BIND
POST/templates

Create a template

Creates an SMS or WhatsApp template. Saved as a DRAFT; send it for review with POST /templates/{templateId}/submit. SMS and WhatsApp; Viber templates are not offered yet. An SMS template takes content and optionally variables and messageType. A WhatsApp template is Meta's: name, language, category and components as Meta defines them, on one of your WhatsApp accounts, within the supported subset (see TemplateCreate.components). Scope portal:write.

Request body

application/json
  • channelstringrequired

    Viber templates are not offered through the API yet.

    Values:smswhatsapp
  • profileIdstring (uuid)required

    An SMS sender or a WhatsApp account of the brand.

  • namestringrequired· min 1 chars· max 100 chars

    WhatsApp: lowercase letters, digits and _, as Meta names templates.

  • languagestring· max 20 chars

    WhatsApp only, a language Meta reviews templates in.

    Example: "en"

  • categorystring

    WhatsApp only.

    Values:MARKETINGUTILITY
  • componentsarray of object· max 10 items

    WhatsApp only. Meta's template components, as Meta defines them: one BODY, and optionally a HEADER, a FOOTER and BUTTONS. Parameters are named ({{order_number}}). Carousels, limited-time offers and call requests are not supported yet (400 on the component).

    A HEADER is format: TEXT with its text, or format: IMAGE, VIDEO or DOCUMENT with the file in example.header_handle: a one-item array holding the id POST /media answered, as in {type: HEADER, format: IMAGE, example: {header_handle: [med_3f9c…a18.jpg]}}. The file must be of the header's kind (an image for IMAGE, a video for VIDEO, a PDF for DOCUMENT) and uploaded by your brand; anything else is a 400 on components[i].example.header_handle[0]. The template is held to Meta's rules before it is saved, the same rules the portal's builder checks. Each one broken is an entry in the 400's errors, on the field that broke it (components[0].text, components[2].buttons[1].url) with its own code, for example body_starts_or_ends_with_variable (the body opens or closes on a variable), adjacent_variables (two variables with nothing between them), too_many_variables (too many for the length of the text), footer_has_variables, header_too_many_variables, label_too_long, bad_phone (not + and digits), bad_url (not https://), url_has_variable (a variable before the end of a link), too_many_buttons, too_many_of_one_kind, quick_replies_split (quick replies not side by side) and copy_code_not_marketing. message says the rule in words; branch on code.

  • contentstring· max 2000 chars

    SMS only, with #{variable} placeholders.

  • messageTypestring

    SMS only.

    Values:MARKETINGTRANSACTIONAL

    Default: "MARKETING"

  • variablesarray of object· max 40 items

    The placeholders' fallbacks, sent to a contact without a value. Sent, the list replaces the template's. SMS: a contact field's (first_name, ...) fallback is written into its placeholders; any other name is the template's own variable and needs a type (short_text, name, number, amount, date, time, reference, otp). WhatsApp: each fallback is that parameter's.

Responses

Ready to send your first message?

We set up your account, sender profiles and API key with you, and help you through the first integration.

Bind console showing an SMS profile going live