<Intro>

<EndpointHeader />

<Description>

Returns the workspace's SMS messages as a cursor-paginated list, newest first. Filter by direction, status, category, recipient, sender, failure reason, tag, or creation time; pass the response's `next_cursor` back as `starting_after` to fetch the next page. To follow a single message's delivery, use [Get an SMS message](/docs/api/reference/get-sms-message) instead.

</Description>

</Intro>

<Parameters in="query">

<Parameter name="limit" type="integer">

<Description>

Maximum number of items to return per page.

</Description>

</Parameter>

<Parameter name="starting_after" type="string">

<Description>

Cursor from the `next_cursor` field of a previous list response. Returns items immediately after the cursor position in the current sort order.

</Description>

</Parameter>

<Parameter name="ending_before" type="string">

<Description>

Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.

</Description>

</Parameter>

<Parameter name="created_after" type="string">

<Description>

Return only resources created at or after this timestamp (inclusive lower bound). Combine with `created_before` to filter to a time window. RFC 3339 / ISO 8601 with timezone.

</Description>

</Parameter>

<Parameter name="created_before" type="string">

<Description>

Return only resources created strictly before this timestamp (exclusive upper bound). Combine with `created_after` to filter to a time window. RFC 3339 / ISO 8601 with timezone.

</Description>

</Parameter>

<Parameter name="direction" type="string">

<Description>

Filter by direction. Omit for both.

</Description>

<Description>

Possible values: `outbound`, `inbound`

</Description>

</Parameter>

<Parameter name="status" type="array">

<Description>

Keep only messages whose current `status` matches; repeat the parameter to match any of several. One of `scheduled`, `accepted`, `sent`, `delivered`, `undelivered`, `failed`, `rejected`, `canceled`, `expired`, or `received`.

</Description>

</Parameter>

<Parameter name="error_code" type="array">

<Description>

Keep only messages whose failure reason (`last_error.code`) matches; repeat the parameter to match any of several. One of `invalid_destination`, `unreachable`, `blocked_by_carrier`, `blocked_by_recipient`, `landline_unreachable`, `content_rejected`, `sender_unregistered`, `recipient_opted_out`, `provider_unavailable`, `insufficient_balance`, or `unknown`.

</Description>

</Parameter>

<Parameter name="category" type="string">

<Description>

Filter by category.

</Description>

<Description>

Possible values: `transactional`, `marketing`, `authentication`, `service`

</Description>

</Parameter>

<Parameter name="to" type="string">

<Description>

Filter by recipient phone number (E.164 exact match).

</Description>

</Parameter>

<Parameter name="from" type="string">

<Description>

Filter by sender (E.164, alphanumeric, or short code; exact match).

</Description>

</Parameter>

<Parameter name="tag" type="array">

<Description>

Filter by tag. Accepts `name` to match any message carrying that tag name, or `name:value` to match a specific tag pair (e.g. `category:welcome`). Repeat the parameter to AND-combine several tag filters.

</Description>

</Parameter>

</Parameters>

<Payload kind="response">

<Field name="data" type="array of object" required>

<Description>

Page of SMS messages, newest first.

</Description>

<FieldChildren kind="response">

<Field name="id" type="string" prefix="data." required>

<Description>

ID of the message (`sms_`-prefixed), assigned when the send is accepted. Pass it as `message_id` to the get-message endpoint.

</Description>

</Field>

<Field name="direction" type="string" prefix="data." required>

<Description>

Whether the message was sent from a Bird sender (`outbound`) or received from a subscriber (`inbound`).

</Description>

<Description>

Possible values: `outbound`, `inbound`

</Description>

</Field>

<Field name="status" type="object" prefix="data." required />

<Field name="to" type="string" prefix="data." required>

<Description>

Recipient phone number in E.164 format.

</Description>

</Field>

<Field name="from" type="string" prefix="data." required>

<Description>

Sender the message was sent from: an E.164 number, an alphanumeric sender ID, or a short code.

</Description>

</Field>

<Field name="text" type="string" prefix="data." required>

<Description>

The message body as sent. For a template send, this is the rendered text after parameter substitution.

</Description>

</Field>

<Field name="category" type="nullable string" prefix="data.">

<Description>

Content classification supplied on the send. Null for inbound messages.

</Description>

</Field>

<Field name="segments" type="object" prefix="data." required>

<Description>

Segment breakdown for the body.

</Description>

<FieldChildren kind="response">

<Field name="count" type="integer" prefix="data.segments." required>

<Description>

Number of segments the body is split into. Each segment is a billable unit.

</Description>

</Field>

<Field name="encoding" type="string" prefix="data.segments." required>

<Description>

Encoding used for the body. `GSM_7BIT` fits 160 characters in a single segment (153 per part when multi-segment); `UCS2` is used when the body contains any character outside the GSM 03.38 alphabet (emoji, CJK, some accented characters) and fits 70 characters in a single segment (67 per part when multi-segment).

</Description>

<Description>

Possible values: `GSM_7BIT`, `UCS2`

</Description>

</Field>

<Field name="characters" type="integer" prefix="data.segments." required>

<Description>

Character count of the body under the selected encoding.

</Description>

</Field>

</FieldChildren>

</Field>

<Field name="cost" type="nullable object" prefix="data.">

<Description>

Cost of the message. Null until the message has been priced.

</Description>

<FieldChildren kind="response">

<Field name="currency_code" type="string" prefix="data.cost.">

<Description>

ISO 4217 currency code for the cost amount. Omitted when the cost is not denominated in a currency (for example a zero-priced internal send).

</Description>

</Field>

<Field name="amount" type="string" prefix="data.cost." required>

<Description>

Total cost as a decimal string: the per-segment rate multiplied by the segment count, plus any surcharges.

</Description>

</Field>

<Field name="breakdown" type="object" prefix="data.cost.">

<Description>

Per-component cost breakdown. Returned on single-message reads; omitted from list rows.

</Description>

<FieldChildren kind="response">

<Field name="per_segment" type="string" prefix="data.cost.breakdown." required>

<Description>

Per-segment price as a decimal string.

</Description>

</Field>

<Field name="segments" type="integer" prefix="data.cost.breakdown." required>

<Description>

Number of billable segments.

</Description>

</Field>

<Field name="country_code" type="string" prefix="data.cost.breakdown." required>

<Description>

ISO 3166-1 alpha-2 destination country the price was resolved for.

</Description>

</Field>

<Field name="carrier_surcharge" type="string" prefix="data.cost.breakdown." required>

<Description>

Carrier surcharge component as a decimal string (for example US 10DLC fees). `0.0000` when none applies.

</Description>

</Field>

</FieldChildren>

</Field>

</FieldChildren>

</Field>

<Field name="tags" type="array of object" prefix="data.">

<Description>

Structured `{name, value}` filter labels applied to this message.

</Description>

<FieldChildren kind="response">

<Field name="name" type="string" prefix="data.tags." required>

<Description>

Tag name. ASCII letters, digits, underscore, and hyphen only. Case-sensitive. Maximum 32 characters.

</Description>

</Field>

<Field name="value" type="string" prefix="data.tags." required>

<Description>

Tag value. ASCII letters, digits, underscore, and hyphen only. Case-sensitive. Maximum 64 characters.

</Description>

</Field>

</FieldChildren>

</Field>

<Field name="metadata" type="object" prefix="data.">

<Description>

Arbitrary JSON metadata stored on the message and echoed in webhook payloads.

</Description>

</Field>

<Field name="validity_period" type="integer" prefix="data.">

<Description>

How long, in seconds, Bird keeps trying to deliver before the message transitions to `expired`.

</Description>

</Field>

<Field name="carrier" type="nullable string" prefix="data.">

<Description>

Carrier that handled the message, when known. Populated once a delivery receipt identifies it.

</Description>

</Field>

<Field name="mcc_mnc" type="nullable string" prefix="data.">

<Description>

Mobile country code and mobile network code of the carrier, when known.

</Description>

</Field>

<Field name="last_error" type="nullable object" prefix="data.">

<Description>

Failure detail on a terminally failed or rejected message. Present only when the message failed.

</Description>

<FieldChildren kind="response">

<Field name="code" type="string" prefix="data.last_error." required>

<Description>

Bird-stable failure reason. `invalid_destination`: the number is not assigned, ported out, or malformed. `unreachable`: handset off or out of coverage. `blocked_by_carrier`: the carrier filtered the message. `blocked_by_recipient`: the recipient device blocked the sender. `landline_unreachable`: the destination is a landline that does not accept SMS. `content_rejected`: the carrier rejected the content. `sender_unregistered`: the sender is not registered for the destination. `recipient_opted_out`: the recipient is on a suppression list. `provider_unavailable`: an upstream failure after retries. `insufficient_balance`: the workspace wallet had insufficient balance to send the message. `unknown`: an unmapped failure.

</Description>

<Description>

Possible values: `invalid_destination`, `unreachable`, `blocked_by_carrier`, `blocked_by_recipient`, `landline_unreachable`, `content_rejected`, `sender_unregistered`, `recipient_opted_out`, `provider_unavailable`, `insufficient_balance`, `unknown`

</Description>

</Field>

<Field name="description" type="string" prefix="data.last_error." required>

<Description>

Human-readable explanation of the failure.

</Description>

</Field>

<Field name="carrier_error_code" type="nullable string" prefix="data.last_error.">

<Description>

Raw carrier-supplied error code, when available, for low-level debugging.

</Description>

</Field>

<Field name="occurred_at" type="string" prefix="data.last_error." required>

<Description>

When the failure occurred.

</Description>

</Field>

</FieldChildren>

</Field>

<Field name="created_at" type="string" prefix="data." required>

<Description>

When the message was accepted (outbound) or received (inbound).

</Description>

</Field>

<Field name="sent_at" type="nullable string" prefix="data.">

<Description>

When the message was handed to the carrier. Null until then.

</Description>

</Field>

<Field name="delivered_at" type="nullable string" prefix="data.">

<Description>

When delivery was confirmed. Null until then.

</Description>

</Field>

</FieldChildren>

</Field>

<Field name="next_cursor" type="nullable string" required>

<Description>

Cursor for the next page. Pass back as `starting_after` to advance forward. Null when no next page exists.

</Description>

</Field>

<Field name="prev_cursor" type="nullable string" required>

<Description>

Cursor for the previous page. Pass back as `ending_before` to step backward. Null when no previous page exists.

</Description>

</Field>

<Field name="refresh_cursor" type="nullable string" required>

<Description>

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`.

</Description>

</Field>

</Payload>