Sign inGet Started

List an audience's contacts

GET
/v1/audiences/{audience_id}/contacts
for await (const member of bird.audiences.listContacts(
  "adn_01krdgeqcxet5s7t44vh8rt9mg",
)) {
  console.log(member.contact.id, member.joined_at);
}
Odpowiedź200
{
  "data": [
    {
      "contact": {
        "id": "con_01krdgeqcxet5s7t44vh8rt9mg",
        "email": "alice@acme.com",
        "phone_number": "+31612345678",
        "audiences": [
          {
            "id": "adn_01krdgeqcxet5s7t44vh8rt9mg",
            "name": "Newsletter subscribers"
          }
        ],
        "created_at": "2026-05-20T09:14:52Z",
        "updated_at": "2026-05-25T16:42:01Z"
      },
      "joined_at": "2026-05-21T10:30:00Z",
      "audiences": [
        {
          "id": "adn_01krdgeqcxet5s7t44vh8rt9mg",
          "name": "Newsletter subscribers"
        }
      ]
    }
  ],
  "next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
  "prev_cursor": null,
  "refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}

Lists the contacts in a static audience as a cursor page, ordered by the time each contact joined the audience, most recent first. Each entry is the contact together with the time it joined.

Parametry

audience_idstring

ID of the audience whose contacts to list.

Parametry zapytania

qstring

Case-insensitive substring match against a contact's email address or the digits in its international phone number.

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.

Treść odpowiedzi

data
array of object
wymagane

Page of audience members, each a contact paired with the time it joined the audience.

Pokaż atrybuty podrzędne
data.contact
object
wymagane
Pokaż atrybuty podrzędne
data.joined_at
string
wymagane

When this contact joined the audience. Members are listed in join order, most recent first.

data.audiences
array of object

The audiences this contact belongs to, including the one being listed, most-recently-joined first.

Pokaż atrybuty podrzędne
data.audiences.id
string
wymagane

ID of the referenced audience.

data.audiences.name
string
wymagane

The audience's display name.

next_cursor
nullable string
wymagane

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

prev_cursor
nullable string
wymagane

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

refresh_cursor
nullable string
wymagane

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.

Przejdź do dokumentacji, przewodników i przykładów dotyczących tego tematu.