Sign inGet Started

List WhatsApp keyword rules

GET
/v1/whatsapp/keyword-rules
const rules = await bird.whatsapp.keywordRules.list({ operation: "opt_out" });
for (const rule of rules.data ?? []) {
  console.log(rule.scope, rule.effective_keywords);
}
Réponse200
{
  "data": [
    {
      "id": "wkr_01krdgeqcxet5s7t44vh8rt9mg",
      "scope": "workspace",
      "operation": "opt_out",
      "country": "US",
      "waba": "102290129340398",
      "keywords": [
        "no more texts",
        "remove me"
      ],
      "effective_keywords": [
        "stop",
        "unsubscribe",
        "optout",
        "no more texts",
        "remove me"
      ],
      "reply": "You're off the list. ACME Courier won't message you again.",
      "created_at": "2026-09-15T10:04:00Z",
      "updated_at": "2026-09-15T10:04:00Z"
    }
  ]
}

Returns the keyword rules that apply to inbound messages, most specific first. Bird's own rules are included, so opt-out and opt-in work on every inbound-capable number before you configure anything.

Use the filters to narrow the full, unpaginated list. Set scope=system for Bird's rules only, or scope=workspace for the ones you created.

Paramètres de requête

countrystring

Keep only rules that apply to someone messaging from this country, as an ISO 3166-1 alpha-2 code. Omit for every rule, whichever country it covers.

wabastring

Keep only the rules that apply to this WhatsApp Business Account of yours, identified by its WhatsApp-issued account ID or by the waa_ ID Bird gives it. Either form finds the same rules.

operationstring

Keep only rules for this operation. Omit for all of them. Open on the same terms as the response, so an operation Bird gains later can be filtered for without a client update; one Bird does not answer matches nothing rather than failing.

Possible values (may grow over time): opt_in, opt_out

scopestring

Keep only Bird's own rules (system) or only the rules you created (workspace). Omit for both.

Possible values: system, workspace

Contenu de la réponse

data
array of object
obligatoire

The keyword rules that apply to your workspace, Bird's own included. Ordered most specific first, so the first rule whose keywords match an inbound message is the one that runs. The set is small and returned in full; this list is not paginated.

Afficher les attributs enfants

Poursuivez avec la documentation, les guides et les exemples sur ce sujet.