Skip to main content
GET
/
audiences
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});

const audiences = await client.audiences.list();

console.log(audiences.items);
{
  "paging": {
    "cursor": "MTpFWUNFRkRRN0c1WERTRTU2",
    "more": true
  },
  "items": [
    {
      "id": "aud_01H8M...",
      "name": "Example Name",
      "description": "An example description.",
      "operator": "AND",
      "filter": {
        "filters": [
          {
            "operator": "string",
            "path": "string",
            "value": "string",
            "filters": [
              {
                "operator": "string"
              }
            ]
          }
        ]
      },
      "created_at": "2024-01-15T10:30:00.000Z",
      "updated_at": "2024-01-15T10:30:00.000Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

cursor
string | null

A unique identifier that allows for fetching the next set of audiences

Response

paging
Paging · object
required
items
Audience · object[]
required