Sign inGet Started

List messages

GET
/v1/email/messages
for await (const message of bird.email.list({ status: "bounced" })) {
  console.log(message.id);
}
Réponse200
{
  "data": [
    {
      "id": "em_01krdgeqcxet5s7t44vh8rt9mg",
      "from": {
        "email": "onboarding@messagebird.dev",
        "name": "Bird"
      },
      "to": [
        {
          "email": "delivered@messagebird.dev"
        }
      ],
      "subject": "Hello from Bird",
      "category": "marketing",
      "status": "accepted",
      "broadcast_id": "eb_01krdgeqcxet5s7t44vh8rt9mg",
      "accepted_count": 1,
      "processed_count": 0,
      "delivered_count": 0,
      "bounced_count": 0,
      "complained_count": 0,
      "deferred_count": 0,
      "rejected_count": 0,
      "open_count": 0,
      "click_count": 0,
      "track_opens": false,
      "track_clicks": false,
      "created_at": "2026-07-01T12:00:00Z"
    }
  ],
  "next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
  "prev_cursor": null,
  "refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}

Returns the workspace's sent and scheduled messages, newest first, as a cursor page. Each item has the aggregate delivery status and per-state recipient counts. Message bodies are omitted.

Combine filters to narrow the page:

  • Delivery status.
  • Category.
  • Tag.
  • The broadcast that sent the messages.
  • An exact to or from address.
  • A created_after or created_before time window.

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.

broadcast_idstring

Filter messages by broadcast ID.

statusstring

Filter by aggregate delivery status.

Possible values: scheduled, accepted, processed, deferred, delivered, partial_failure, bounced, complained, rejected, canceled

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.

categorystring

Filter by category.

Possible values: marketing, transactional

tostring

Filter by recipient address. Exact match against any to/cc/bcc recipient on the message. The address is normalized to lowercase before comparison.

fromstring

Filter by sender address. Exact match against the message from field. The address is normalized to lowercase before comparison.

Contenu de la réponse

data
array of object
obligatoire

Page of message objects.

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.