Sign inGet Started

List SMS messages

GET
/v1/sms/messages
for await (const msg of bird.sms.list({ direction: "outbound" })) {
  console.log(msg.id, msg.status);
}
Réponse200
{
  "data": [
    {
      "id": "sms_01krdgeqcxet5s7t44vh8rt9mg",
      "direction": "outbound",
      "status": "scheduled",
      "to": "+15551234567",
      "from": "+15557654321",
      "text": "Your order has shipped and is on its way.",
      "category": "transactional",
      "requested_language": "pt-BR",
      "resolved_language": "pt-BR",
      "template_id": "smt_01krdgeqcxet5s7t44vh8rt9mg",
      "template_version_id": "smv_01krdgeqcxet5s7t44vh8rt9mg",
      "template_content_hash": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "segments": {
        "count": 1,
        "encoding": "GSM_7BIT",
        "characters": 41
      },
      "cost": {
        "amount": "0.00990",
        "currency_code": "USD",
        "transaction_amount": "0.00790",
        "passthrough_amount": "0.00200"
      },
      "tags": [
        {
          "name": "category",
          "value": "welcome"
        }
      ],
      "options": {
        "smart_encoding": true
      },
      "carrier": "Verizon",
      "mcc_mnc": "311480",
      "last_error": {
        "code": "invalid_destination",
        "description": "Carrier filtered as spam"
      },
      "created_at": "2026-05-21T12:00:00Z"
    }
  ],
  "next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
  "prev_cursor": null,
  "refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}

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

Messages are retained for 30 days. A created_after earlier than that is accepted and raised to the retention bound rather than rejected, so a wider window returns what is still retained instead of failing. Messages older than the retention window cannot be retrieved.

Paramètres de requête

limitinteger

Maximum number of items to return per page.

starting_afterstring

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

ending_beforestring

Cursor from the prev_cursor or refresh_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order. prev_cursor returns the preceding page. refresh_cursor anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.

created_afterstring

Limits the response to resources created at or after this timestamp. Combine it with created_before to select a time window. Use an RFC 3339 timestamp with a timezone offset.

created_beforestring

Limits the response to resources created before this timestamp. Combine it with created_after to select a time window. Use an RFC 3339 timestamp with a timezone offset.

directionstring

Filter by direction. Omit for both.

Possible values: outbound, inbound

statusarray

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. scheduled and canceled are accepted but match nothing until send-later scheduling ships.

error_codearray

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_fraud_protection, blocked_by_recipient, landline_unreachable, content_rejected, sender_unregistered, recipient_opted_out, provider_unavailable, insufficient_balance, or unknown.

categorystring

Filter by category.

Possible values: transactional, marketing, authentication, service

tostring

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

fromstring

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

tagarray

Filter by tag. Accepts name to match any record carrying that tag name, or name:value to match a specific tag pair (for example category:welcome). Repeat the parameter to add more tags. A record must match every tag listed to be returned.

Contenu de la réponse

data
array of object
obligatoire

Page of SMS messages, newest first.

Afficher les attributs enfants
next_cursor
nullable string
obligatoire

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

prev_cursor
nullable string
obligatoire

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

refresh_cursor
nullable string
obligatoire

Refresh anchor, the first row of this response. Pass back as ending_before to fetch what precedes it in the current sort order. On a newest-first sort those are the items that have appeared since; on any other sort they are the items that sort earlier, so refreshing such a list means re-fetching it instead. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.

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