Skip to main content

Update an audience

A audience_id should be uniquely identifiable using a string ID that will not change.

Examples

JSON
{
"name": "Developers from San Francisco",
"filter": {
"operator": "AND",
"filters": [
{
"path": "location",
"operator": "EQ",
"value": "San Francisco"
},
{
"path": "job_title",
"operator": "EQ",
"value": "Developer"
}
]
}
}

The above will result with:

200
{
"audience": {
"id": "<audience-id>",
"name": "My favorite people",
"description": "People I like",
"created_at": "<iso-8601-formatted-string>",
"updated_at": "<iso-8601-formatted-string>",
"filter": {
"operator": "AND",
"filters": [
{
"path": "location",
"operator": "EQ",
"value": "San Francisco"
},
{
"path": "job_title",
"operator": "EQ",
"value": "Developer"
}
]
}
}
}
PUThttps://api.courier.com/audiences/:audience_id
Creates or updates audience.
PATH PARAMS
audience_idstringrequired
A unique identifier representing the audience id
BODY PARAM
idstring
A unique identifier representing the audience_id
namestring
The name of the audience
descriptionstring
A description of the audience
filteroneOfrequired
Either a single filter or a group of filters
operatorstring
The operator to use for filtering
valuestring
The value to use for filtering
pathstring
The attribe name from profile whose value will be operated against the filter value
Responses
AUTH TOKEN
curl --request PUT \
--url https://api.courier.com/audiences/my-favorite-developer-audience \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '
{
"id": "developer-audience",
"name": "Developer Audience",
"description": "Audience for developers"
}
'
Response Example
{
"undefined": {
"undefined": {
"id": "developer-audience",
"name": "Developer Audience",
"description": "Audience for developers",
"filter": {
"operator": "EQ",
"value": "engineer",
"path": "title"
}
}
}
}

Example

Method: PUT

URL: https://api.courier.com/audiences/abcdefgh12345678

Body:

{
"id": "abcdefgh12345678",
"name": "Developer Audience",
"description": "Audience for developers",
"filter": {
"Multiple Filters": {
"operator": "OR",
"filters": [
{
"operator": "EQ",
"value": "engineer",
"path": "title"
},
{
"operator": "EQ",
"value": "product manager",
"path": "title"
}
]
}
}
}