Skip to main content
PUT
/
audiences
/
{audience_id}
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 audience = await client.audiences.update('audience_id');

console.log(audience.audience);
{
  "audience": {
    "id": "<string>",
    "name": "<string>",
    "description": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "operator": "AND",
    "filter": {
      "filters": [
        {
          "operator": "<string>",
          "path": "<string>",
          "value": "<string>",
          "filters": "<array>"
        }
      ]
    }
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

audience_id
string
required

A unique identifier representing the audience id

Body

application/json
name
string | null

The name of the audience

description
string | null

A description of the audience

operator
enum<string> | null

The logical operator (AND/OR) for the top-level filter

Available options:
AND,
OR
filter
AudienceFilterConfig · object

Filter configuration for audience membership containing an array of filter rules

Response

200 - application/json
audience
Audience · object
required