Sign inGet started

bird whatsapp templates create

Usage

Exemplo de código
bird whatsapp templates create <slug> [flags]

Description

Create a WhatsApp template, optionally seeding its first draft
"slug" is the handle a send names the template by, for example "order_update". It is fixed at creation, and WhatsApp's own template name derives from it. The "bird_" prefix is reserved for Bird's built-in templates.
Nothing here reaches WhatsApp. What this returns is a draft, and a draft cannot be sent: submit it with "bird whatsapp templates versions submit", and sends then use the version that submit freezes.
Called without "languages", this creates the template with no draft. Open one with "bird whatsapp templates versions create", then add content a language at a time with "bird whatsapp templates versions languages set", which is also how you edit it later. To seed content at creation instead, pass the whole JSON body with --body-file: the "languages" object maps a BCP-47 tag to that language's {components}, a shape no flag can express.
Build the request from the <slug> argument and flags, a JSON WhatsAppTemplateCreate body via --body-file ("-" reads stdin), or both — an inline value overrides the matching body field. Run --example to print a ready-to-edit body, or --dry-run to print the resolved request without sending it.

Procedure

Step 2 of 7 of "Author a WhatsApp template and get it approved". Previous: bird whatsapp business-accounts list. Next: bird whatsapp templates versions create.

Examples

Exemplo de código
# print the body shape (no credentials needed)
bird whatsapp templates create --example

# the body it prints:
Exemplo de código
{
  "category": "utility",
  "default_language": "en",
  "description": "Sent when a customer's order ships.",
  "languages": {
    "en": {
      "components": [
        {
          "example_parameters": [
            {
              "text": "A-4192",
              "type": "text"
            }
          ],
          "text": "Your order {{1}} has shipped.",
          "type": "body"
        }
      ]
    }
  },
  "name": "Order update",
  "on_missing_language": "fallback",
  "slug": "order_update",
  "waba": "102290129340398"
}
Exemplo de código
# create the template, then author its English content
bird whatsapp templates create order_update --waba 102290129340398 --category utility --default-language en

# seed the first draft's content at creation
bird whatsapp templates create order_update --waba 102290129340398 --category utility --default-language en --body-file body.json

Options

Identity

NameDescription
--wabaThe WhatsApp Business Account to author this template on. It has to be one this workspace has connected; "bird whatsapp business-accounts list" shows them
--nameDisplay name shown wherever the template is listed. You can change it any time; defaults to the slug
--descriptionWhat the template is for, in your own words
--categoryThe category WhatsApp reviews the template under: utility, marketing or authentication. Fixed at creation. It is not what a send is priced at: WhatsApp applies its own category per language and may move one, and the price follows that

Languages

NameDescription
--default-languageThe language a send uses when it names none, and the last resort when the language a send asks for is unavailable. It has to be one of the languages the draft holds
--on-missing-languageHow a send behaves when it asks for a language this template does not carry: fail (default) or fallback
--language-source-requiredReject a send that does not name a language, instead of sending the default language

Request

NameDescription
--body-fileRead the JSON request body from this file; "-" reads stdin
--examplePrint a complete example request body, then exit
--dry-runPrint the resolved request without sending it, then exit
--idempotency-keyDeduplication key; a retry with the same key won't act twice

Options

NameDescription
--response-schemaPrint the fields this command returns, then exit
NameDescription
bird whatsapp templates deleteDelete a message template
bird whatsapp templates duplicateDuplicate a message template
bird whatsapp templates getGet a message template
bird whatsapp templates listList available message templates
bird whatsapp templates updateUpdate a message template