Skip to main content
Use this recipe when you want a Conversation to open with a particular WhatsApp template. The detailed template reference explains validation rules and every documented template error.

Before you start

  • Know the template’s ID or name. Both are accepted by GET .../templates/{templateId}.
  • Confirm the template is approved for the WhatsApp Business Account behind the intended line.
  • Have an existing test Contact ID, the authorized WhatsApp providerChannelId, and an internal Bridge User’s email. See Identifiers and concepts.
  • Review the workspace’s onboarding sequence: your override can replace the whole sequence or only its first template, depending on workspace configuration.
The final request starts a Conversation and can send onboarding templates. Use an authorized test Contact and intended content.

1. Discover the variables

URL-encode the supplied ID or name. Read the response’s id, name, variables, and driftWarning. Use the agnostic key, never the display label, a Meta position, or an invented variable name. driftWarning is diagnostic and does not by itself block sending.

2. Prepare your values

Create a server-side JSON file containing only keys returned by discovery. For a template that actually declares order_number and delivery_date, it could contain:
Those two names are examples, not universal Bridge fields. Read your own template before using them. Keep values within the WhatsApp value rules; omit non-custom values you want Bridge to fill instead of sending blank strings.

3. Discover, check, and create the Conversation

Use Node.js with built-in fetch. Save this as send-template.mjs and set BRIDGE_API_KEY, BRIDGE_WORKSPACE_ID, BRIDGE_TEMPLATE_ID_OR_NAME, TEMPLATE_VALUES_PATH, BRIDGE_CONTACT_ID, BRIDGE_PROVIDER_CHANNEL_ID, and BRIDGE_USER_EMAIL.
The example uses the ID returned by discovery in onboardingTemplates[].templateId. The two outbound operations also accept a template ID or name, with the ID taking precedence when both are supplied. Their request shapes differ from onboardingTemplates; read the operation’s contract before reusing this body elsewhere. The local checks catch unknown and missing keys. Bridge still performs its own validation, including approval for the selected line and the final WhatsApp value rules. Do not treat local validation as approval or a delivery guarantee.

Recover from a rejected request

Read the complete template error reference for approval, ownership, unsupported parameters, and malformed requests. Do not retry a timed-out Conversation request automatically: determine its outcome first.