Documentation
Sign inGet started

List SMS suppressions

GET
/v1/sms/suppressions
for await (const suppression of bird.smsSuppressions.list()) {
  console.log(suppression.originator, suppression.destination, suppression.reason);
}
Returns the suppressions currently stopping your messages, most recent opt-out first. Pass destination to look up one subscriber before sending to them.
A suppression covers one sender and one subscriber, so the same number can appear more than once: opting out of one of your senders does not opt out of the others.
Suppressions that have ended are not listed. A subscriber who opted out and then opted back in is reachable again, so they are not on this list, and what you have here is the answer to "who can I not message right now".
Abfrageparameter
destination
string
Return only suppressions for this subscriber, in E.164 format. Exact match, not a prefix: a phone number is not a string a partial match is meaningful on.
originator
string
Return only suppressions covering this sender.
reason
string
Return only suppressions with this reason:
  • keyword_stop: The subscriber texted a stop keyword to the sender.
  • carrier_opted_out: Their carrier reported the opt-out.
  • manual: Added through this API or the dashboard.
Possible values: keyword_stop, carrier_opted_out, manual
limit
integer
Maximum number of items to return per page.
starting_after
string
Cursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.
ending_before
string
Cursor from the prev_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order.
Antwort-Payload
data
array of object
erforderlich
Page of suppressions, most recent opt-out first.
Untergeordnete Attribute anzeigen
data.id
string
erforderlich
data.destination
string
erforderlich
The subscriber, in E.164 format.
data.originator
string
erforderlich
The sender this stops. A suppression covers one sender, so your other senders still reach this subscriber. Opting out of one of your programmes is not opting out of all of them.
data.reason
string
erforderlich
data.origin
string
erforderlich
data.applies_to
string
erforderlich
data.blocking
boolean
erforderlich
Whether this is stopping messages right now. 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.
data.source_sms_id
nullable string
The inbound message the subscriber opted out with, or the outbound message whose delivery report reported the opt-out. Null when neither applies.
data.effective_at
string
erforderlich
When the subscriber opted out, as reported by whoever reported it. This is what orders one subscriber's history, and it can be earlier than created_at when a message reached us late.
data.ended_at
nullable string
When this stopped applying. Null while it is still stopping messages.
data.ended_reason
nullable string
What ended it. Null while it is still stopping messages.
data.ended_effective_at
nullable string
When the subscriber opted back in, as reported. Null while it is still stopping messages.
data.source_end_sms_id
nullable string
The inbound message the subscriber opted back in with, when there was one. Null while it is still stopping messages, and when something other than a start keyword ended it.
data.created_at
string
erforderlich
When we recorded it.
data.last_asserted_at
string
erforderlich
When we last recorded the subscriber opting out of this sender. Later than created_at when they texted a stop keyword again while already suppressed, which adds no new record but does earn another confirmation reply.
next_cursor
nullable string
erforderlich
Cursor for the next page. Pass back as starting_after to advance forward. Null when no next page exists.
prev_cursor
nullable string
erforderlich
Cursor for the previous page. Pass back as ending_before to step backward. Null when no previous page exists.
refresh_cursor
nullable string
erforderlich
Refresh anchor. Pass back as ending_before later to fetch items that have appeared since this response. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.