v4

latestOpenAPI 3.0.02026-08-04109113304.5 KB
Audiences

Update an Audience

Update an Audience for a Project

patch/audiences/{audience_id}

Path parameters

audience_idinteger required

The Audience ID of the Audience you want to change

Request body

archivedboolean

True if the Audience has been archived

conditionsstring

A string defining the targeting rules for an Audience

descriptionstring

A short description of the Audience

for_journeyboolean

Whether the Audience has been part of journey or not

namestring

The name of the Audience

segmentationboolean

True if the Audience is available for segmentation on the results page (Enterprise plans only)

Example request

{
  "name": "Spanish speaking San Franciscans"
}

Response

Return the created Audience

archivedboolean

Whether the Audience has been archived

conditionsstring

A string defining the targeting rules for an Audience

createdstring date-time

The time the Audience was initially created

descriptionstring

A short description of the Audience

experiment_countinteger

Number of experiments by audience_id

for_journeyboolean

Whether the Audience has been part of journey or not

idinteger

The unique identifier for the Audience

is_classicboolean

Whether or not Audience is a classic Audience. If true, the Audience is only compatible with classic Experiments. Otherwise, the Audience may be used in Optimizely X Campaigns.

last_modifiedstring date-time

The last time the Audience was modified

namestring

The name of the Audience

project_idinteger required

The ID of the Project the Audience was created in

segmentationboolean

True if the Audience is available for segmentation on the results page (Audiences can only be used for segmentation in Optimizely Classic). Set to False if you intend to use this Audience only in Optimizely X. Note that a maximum of 10 Audiences can have segmentation set to True in any given Optimizely Classic project.

Example response

{
  "conditions": "[\"and\", {\"type\": \"language\", \"value\": \"es\"}, {\"type\": \"location\", \"value\": \"US-CA-SANFRANCISCO\"}]",
  "description": "People that speak spanish and are in San Francisco",
  "experiment_count": 123,
  "id": 5000,
  "name": "Spanish speaking San Franciscans",
  "project_id": 1000
}