Sign inGet Started

bird whatsapp templates versions languages set

Usage

Esempio di codice
bird whatsapp templates versions languages set <template-ref> <version-id> <language> [flags]

Description

Write one language of a WhatsApp template's draft

This replaces the language, it does not merge: send its complete content every time. "optimization_spec" and "message_send_ttl_seconds" are the exceptions: leave either out to keep its current value, or set it to null to return to WhatsApp's standard rate or default time-to-live. Only the draft is writable. A submitted version is immutable, and a language under review at WhatsApp refuses the write until that review finishes. "bird whatsapp templates get <slug>" reports the draft's id in "draft_version_id"; "bird whatsapp templates versions create" opens one if there is none.

Content goes in through --body-file: "components" is an array of blocks, each carrying nested arrays of its own, a shape no flag can express. A body block is required before the language can be submitted, and every variable in a block needs an example value, which is what WhatsApp reviews against.

Nothing here reaches WhatsApp. Submit the draft once every language is ready.

Build the request from flags, a JSON WhatsAppTemplateLanguageUpsert body via --body-file ("-" reads stdin), or both — a flag 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 4 of 7 of "Author a WhatsApp template and get it approved". Previous: bird whatsapp templates versions create. Next: bird whatsapp templates versions submit.

Examples

Esempio di codice
# print the body shape (no credentials needed)
bird whatsapp templates versions languages set --example

# the body it prints:
Esempio di codice
{
  "components": [
    {
      "code_expiration_minutes": 60,
      "text": "Your order {{order_id}} has shipped.",
      "type": "body"
    }
  ],
  "message_send_ttl_seconds": 600,
  "optimization_spec": {
    "bid_amount": 5000,
    "bid_country_multiplier_overrides": {
      "IN": 1.2,
      "MX": 0.8
    },
    "bid_strategy": "lowest_cost_with_bid_cap"
  },
  "revision": 4
}
Esempio di codice
# write the English content of a draft
bird whatsapp templates versions languages set order_update wav_01krdgeqcxet5s7t44vh8rt9mg en --body-file en.json

# cap a marketing language's price: en.json carries "optimization_spec" beside "components"
bird whatsapp templates versions languages set black_friday wav_01krdgeqcxet5s7t44vh8rt9mg en --body-file en.json

# expire undelivered order updates after an hour: en.json carries "message_send_ttl_seconds": 3600 beside "components"
bird whatsapp templates versions languages set order_update wav_01krdgeqcxet5s7t44vh8rt9mg en --body-file en.json

# write it only if nobody has edited it since you read revision 4
bird whatsapp templates versions languages set order_update wav_01krdgeqcxet5s7t44vh8rt9mg en --body-file en.json --revision 4

Options

Concurrency

NameDescription
--revision <n>The revision you last read for this language, making the write a compare-and-set: a mismatch is refused rather than overwriting an edit you have not seen. Omit it for last-write-wins, which is what a single writer wants

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 versions languages deleteDelete a language from the draft
bird whatsapp templates versions languages discardDiscard a language's draft edits back to its submitted copy
bird whatsapp templates versions languages getGet a version's language
bird whatsapp templates versions languages listList a version's languages