Sign inGet Started

Create an Apple Messages for Business suppression

POST
/v1/amb/suppressions
const result = await bird.amb.suppressions.add({
  address: "opaque-customer",
  address_type: "opaque_user_id",
});
console.log(result);
Response200
{
  "id": "asp_01krdgeqcxet5s7t44vh8rt9mg",
  "business_account_id": "abz_01krdgeqcxet5s7t44vh8rt9mg",
  "address": "+15551234567",
  "address_type": "opaque_user_id",
  "reason": "manual",
  "origin": "user",
  "applies_to": "all",
  "source_message_id": "amb_01krdgeqcxet5s7t44vh8rt9mg",
  "source_event_id": "aev_01krdgeqcxet5s7t44vh8rt9mg",
  "ended_reason": "user",
  "source_end_message_id": "amb_01krdgeqcxet5s7t44vh8rt9mg"
}

Stops messages to an address, with reason manual, blocking every outbound path to it: operator and automated replies, API sends, typing indicators and invitations. Set business_account_id to stop the address for one account, or omit it to stop the address for every account in the workspace. The account must belong to the workspace; another workspace's account returns 404.

Adding is idempotent. A 201 means a new suppression was recorded, and a 200 means a manual one for that address and scope was already in place and is returned with last_asserted_at moved to this call, nothing else changed. An address already stopped for another reason, such as the customer having closed the conversation, still gets its own manual record, and messages stay stopped until every one of them has ended.

Request Payload

business_account_id
string

The business account to stop. Omit to stop the address for every account in the workspace. An account in another workspace returns 404.

address
string
required

The customer to stop messaging: a phone number in E.164 format with a leading plus sign, or the exact opaque identifier Apple supplied. address_type says which.

address_type
string
required

What kind of value address holds.

  • phone_number means address is the customer's phone number. Apple's CloseSession event carries a phone number rather than an opaque identifier, so a suppression opened by a close on a conversation identified by phone number takes this kind.
  • opaque_user_id means address is the opaque identifier Apple assigns to the customer's conversation with the business, stable across a close and a later re-initiation.

Possible values: phone_number, opaque_user_id

Response Payload

id
string
required
business_account_id
nullable string
required

The business account this stops. Null when it stops the address for every account in the workspace. A workspace-wide suppression covers the same address everywhere; it does not link the different opaque identifiers one person holds with different accounts.

address
string
required

The customer: a phone number in E.164 format, or the exact opaque identifier Apple supplied. address_type says which.

address_type
string
required

What kind of value address holds.

  • phone_number means address is the customer's phone number. Apple's CloseSession event carries a phone number rather than an opaque identifier, so a suppression opened by a close on a conversation identified by phone number takes this kind.
  • opaque_user_id means address is the opaque identifier Apple assigns to the customer's conversation with the business, stable across a close and a later re-initiation.

Possible values: phone_number, opaque_user_id

reason
string
required

Why messages are stopped. manual means your workspace added it through this API or the dashboard. opted_out means the customer or Apple signaled they should not be contacted, such as a close of the conversation. This list grows over time, so treat an unknown value as informational rather than rejecting the record.

Possible values (may grow over time): manual, opted_out

origin
string
required

How the suppression came to exist:

  • user: someone acting in the dashboard.
  • api_key: an API call.
  • close_session: Apple reporting that the customer closed the conversation.
  • gone: Apple refusing a send because the customer had closed the conversation.

user and api_key are the manual suppressions, the ones you can end. The two closes are the customer's own statement and end when they return. A customer declining or opting out of invitations by phone number is recorded as a preference rather than here.

Possible values (may grow over time): user, api_key, close_session, gone

applies_to
string
required

What this stops. all stops every outbound path to the address: operator and automated replies, API sends, typing indicators and invitations. invitations stops invitations to the phone number and leaves an open conversation reachable. Treat unrecognized values as stopping everything.

Possible values (may grow over time): all, invitations

blocking
boolean
required

Whether this is stopping messages right now; applies_to says what it stops. Always true in a list, which carries only the suppressions in force; false when you fetch one by ID that has since ended, which is also when ended_at is set.

source_message_id
nullable string
required

The outbound message Apple refused because the customer had closed the conversation, when that is what opened this. Null for a close Apple reported and for a manual suppression.

source_event_id
nullable string
required

The conversation event recording the close Apple reported, when that is what opened this. Null for a refused send and for a manual suppression.

effective_at
string
required

When the customer closed the conversation, as reported by Apple; when Apple refused a send because the conversation was closed; or when a manual suppression was added. This is what orders the list, and it can differ from created_at: earlier when a close reached us late, later when the customer closed the conversation again while this was in force, which moves it to that later close.

created_at
string
required

When we recorded it.

last_asserted_at
string

When we last recorded this suppression being stated. Later than created_at when your workspace added it again while it was already in force; a repeat adds no new record.

ended_at
nullable string
required

When this stopped applying. Null while it is still stopping messages.

ended_reason
nullable string
required

What ended it:

  • user: someone acting in the dashboard.
  • api_key: an API call.
  • reinitiated: the customer returning to the conversation they had closed.

A user or an API call can end a manual suppression and nothing else; a close is the customer's own statement and ends when they return.

Null while the suppression is in force.

Possible values (may grow over time): user, api_key, reinitiated

ended_effective_at
nullable string
required

When the customer returned to the conversation, as reported by Apple, or when your workspace ended it. Null while it is still stopping messages.

source_end_message_id
nullable string
required

The message the customer returned with, when there was one. Null while it is still stopping messages, and when something other than a customer message ended it: your workspace ending it, or the customer returning by accepting an invitation.

Continue with the documentation, guides and examples for this topic.