---
title: "Update an Apple Messages for Business routing rule"
method: PATCH
path: "/v1/amb/routing-rules/{routing_rule_id}"
tags: ["amb-routing-rules"]
---

# Update an Apple Messages for Business routing rule

`PATCH /v1/amb/routing-rules/{routing_rule_id}`

## Request

- Base URL: `https://us1.platform.bird.com`
- URL: `https://us1.platform.bird.com/v1/amb/routing-rules/{routing_rule_id}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `bird_session`

Changes a routing rule's business, match, queue, precedence, or default status. The match changes as a unit: send `match_kind` with the intent and group ids it requires, as on create. Returns a `409` when the update would leave this rule as the default of a business that already has a different default rule. The change applies to conversations that start or reopen afterwards.

## Headers

- `Idempotency-Key` string
- `X-Workspace-Id` string
- `X-Organization-Id` string

## Request body

- AMBRoutingRuleUpdate: Changes to a routing rule. Send `business_account_id` to move the rule to another Apple Messages for Business brand in the workspace. Send `match_kind` to replace what the rule matches, with the ids that kind requires, as on create; a stored id the new kind does not use is cleared. `match_intent_id` and `match_group_id` require `match_kind`. The update returns a `409` when it would leave this rule as the default of a business that already has a different default rule.
  - `business_account_id` string
  - `match_kind` 'both', required: What a routing rule matches against the entry point that started the conversation. - `intent` matches on the entry point's intent alone: `match_intent_id` is set and `match_group_id` is null. - `group` matches on the entry point's group alone: `match_group_id` is set and `match_intent_id` is null. - `both` matches only when the entry point carries the given intent and the given group together, so `match_intent_id` and `match_group_id` are both set. There are two match fields rather than one because `both` needs to carry an intent and a group at once.
  - `match_intent_id` string, required: The entry point intent to match, as sent in Apple's `intentID`. Requires `match_kind`: required when it is `intent` or `both`, and rejected when it is `group`.
  - `match_group_id` string, required: The entry point group to match, as sent in Apple's `groupID`. Requires `match_kind`: required when it is `group` or `both`, and rejected when it is `intent`.
  - `queue` string: Queue label used for routing and filtering conversations.
  - `precedence` integer: Change this rule's evaluation order among the business's other rules.
  - `is_default` boolean: Set to true to make this the rule that catches a conversation matching nothing else, or to false to stop it from being the default.

## Response `200`

Routing rule updated.

- AMBRoutingRule: A rule that puts a conversation into a queue when it is created or reopened, based on the group and intent the entry point that started it carried.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `id` string, required
  - `business_account_id` string, required
  - `match_kind` 'intent' | 'group' | 'both', required: What a routing rule matches against the entry point that started the conversation. - `intent` matches on the entry point's intent alone: `match_intent_id` is set and `match_group_id` is null. - `group` matches on the entry point's group alone: `match_group_id` is set and `match_intent_id` is null. - `both` matches only when the entry point carries the given intent and the given group together, so `match_intent_id` and `match_group_id` are both set. There are two match fields rather than one because `both` needs to carry an intent and a group at once.
  - `match_intent_id` string, nullable: The entry point intent this rule matches, as sent in Apple's `intentID`. Set when `match_kind` is `intent` or `both`, null when it is `group`.
  - `match_group_id` string, nullable: The entry point group this rule matches, as sent in Apple's `groupID`. Set when `match_kind` is `group` or `both`, null when it is `intent`.
  - `queue` string, required: The queue a matching conversation is filed into. A queue is a label your console filters by rather than a resource you create ahead of time, so any value routes.
  - `precedence` integer, required: Evaluation order among this business's rules. The highest-precedence rule a conversation matches wins; rules tied on precedence are evaluated by their `id`.
  - `is_default` boolean, required: Whether this rule catches a conversation that matches nothing else. A business has at most one. A conversation created or reopened while none exists routes to an empty queue, which the console lists as unrouted.

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Insufficient permissions
- `404`: Resource not found
- `409`: Resource conflict
- `422`: The request has invalid field values, violates a business rule, or carries a query parameter the endpoint does not declare. Field validation errors use `type: validation_error` and include the affected fields in `details`. Business-rule errors identify the failed rule in `type`.
- `429`: Rate limit exceeded
- `500`: Internal server error
- `503`: The service is temporarily unavailable. If `Retry-After` is present, wait for that delay before retrying; otherwise, retry with exponential backoff. Reuse the same idempotency key and request when retrying a mutation.

---

[API](https://skmtc.dev/messagebird/apis/bird-api.md) · [All operations](https://skmtc.dev/messagebird/apis/bird-api/llms.txt) · [OpenAPI document](https://skmtc.dev/messagebird/apis/bird-api/revisions/6dfce1179799?raw)
