Introduction
Audiences give the ability to advertisers to define subsets of retailer visitors to be targeted in their campaigns. Audiences are built of one or multiple audience segments that can be combined using logical Algebra Nodes to define target campaigns’ audiences.create, update, delete) use a partial approval model. Even if some items in the request fail, the response will return 200 OK. Any failed items will be listed in the error section of the response with an error code and details.Examples of possible error codes:audience-not-found→ Audience is not found.name-must-be-unique→ Audience name must be unique.name-must-not-be-empty→ Audience name property must not be empty.
Endpoints
Verb | Endpoint | Description |
|---|---|---|
POST |
| Create audience(s) |
PATCH |
| Update audience(s) |
POST |
| Delete audience(s) |
Audience Attributes
Attribute | Data Type | Description |
|---|---|---|
| string | Audience ID, generated internally by Criteo Accepted values: string of int64 Writeable? N / Nullable? N |
| string | Audience name, arbitrary and changeable. Must be unique in the account level. Accepted values: up to 256 chars string Writeable? Y / Nullable? N |
| string | Audience description, arbitrary and changeable. Accepted values: up to 500 chars string Writeable? Y / Nullable? Y |
| string | Account ID associated with the Audience, generated internally by Criteo Accepted values: string of int64 Writeable? N / Nullable? N |
| string | Retailer ID associated with the Audience, generated internally by Criteo. Once created, the associated retailer cannot be changed Accepted values: string of int64 Writeable? N / Nullable? N |
| object | Algebra node with the definition of how the different audience segments are combined to create the audience, using logical operators Accepted values: see Algebra Nodes Writeable? Y / Nullable? N |
| list\ | Channels associated to the audience Accepted values: Writeable? N / Nullable? N |
| timestamp | Timestamp of Audience creation, in UTC Accepted values: Writeable? N / Nullable? N |
| string | User ID who created the Audience ( Accepted values: string Writeable? N / Nullable? Y |
| timestamp | Timestamp of last Audience update, in UTC Accepted values: Writeable? N / Nullable? N |
- Writeable (Y/N): Indicates if the field can be modified in requests.
- Nullable (Y/N): Indicates if the field can accept null/empty values.
- Primary Key: A unique, immutable identifier of the entity, generated internally by Criteo. Primary keys are typically ID fields (e.g.,
retailerId,campaignId,lineItemId) and are usually required in the URL path.
Create Audiences
This endpoint allows the creation of one or multiple audiences in a single request. Each audience must contain the required attributes marked above and is built of one or multiple segments. Sample RequestUpdate Audiences
This endpoint allows the modification of one or multiple audiences in a single request. Sample RequestDelete Audiences
This endpoint enables clients to delete one or multiple audiences in a single request. Sample RequestResponses
Responses | Description |
|---|---|
🔵
| Success. All audiences operations were performed successfully; some warnings/errors may be returned inline. |
🔴
| Bad request. Check request body formatting or missing required parameters. |
🔴
| Authentication error. Verify the API token. |
🔴
| Forbidden. The API client is not authorized to access this resource. |
Errors and warnings
Request Structure Errors
empty-data-object
Error: Cannot have an empty data objectMessage: The request must have at least one element in the data object.
empty-attributes-object
Error: Cannot have an empty attributes objectMessage: The request must have the attributes object provided.
non-parsable-id
Error: One or more IDs cannot be parsedMessage: All IDs in the audience object must be a valid numerical ID.
duplicate-id
Error: Audience ID cannot be duplicatedMessage: The data object must not have multiple audience objects with the same ID.
invalid-audience-type
Error: Audience type is invalidMessage:
abcdef is not a valid audience type.
payload-too-big
Error: Cannot create more than 10 audiences at a timeMessage: Each request must have at most 10 audience objects.
multiple-algebra-operators
Error: Cannot have an algebra node with multiple operators definedMessage: Each algebra node must have exactly one operator defined.
audience-algebra-cannot-be-null-or-empty
Error: Algebra cannot be null or emptyMessage: You must provide a definition for the algebra.
audience-algebra-too-deep
Error: Audience algebra too deepMessage: The audience algebra tree cannot have a depth greater than 10.
audience-algebra-has-too-many-segments
Error: Audience algebra has too many segmentsMessage: The audience algebra can include at most 10 segments defined inside.
Validation Errors
duplicate-name
Error: Cannot have duplicated audience namesMessage: Each audience in the request must have a unique name.
name-must-not-be-empty
Error: Audience name property must not be emptyMessage: Cannot have an empty name in a
create audience entity.
name-must-not-be-too-long
Error: Audience name property must not be too longMessage: Audience names must be no longer than 10 characters.
name-must-be-unique
Error: Audience name must be uniqueMessage: Another audience exists with the name:
abcdef.
audiences-limit-reached
Error: Too many audiencesMessage: Advertiser(s) 30, 40 have reached the number of allowed audiences.
audience-algebra-must-be-limited
Error: Audience algebra must be limitedMessage: The audience algebra does not limit the amount of users it targets.
audience-algebra-and-or-nodes-must-include-more-than-one-node
Error: “And”/“or” nodes must include more than one nodeMessage: The audience algebra “and” and “or” nodes must include more than one node, otherwise use an
audienceSegmentId node.
audience-channel-must-be-valid
Error: Audience channel must be validMessage: The audience’s algebra contains incompatible segment channels.
audience-channel-must-match-line-item-channel
Error: Audience channel must match line item channelMessage: Your audience algebra contains segments which are incompatible with one or more line items.
audience-retailer-must-match-segment-retailers
Error: Audience retailer must match segment retailersMessage: The segments: 30, 40 don’t match the audience retailer. You must include only segments with the same retailer as the audience.
audience-must-contain-only-existing-segments
Error: Audience must contain only existing segmentsMessage: The segments: 30, 40 don’t exist. You must include only existing segments.
audience-must-not-be-used-in-line-item
Error: Audience must not be used in a line itemMessage: The audience must be removed from all line items to be able to delete it.
Account & Retailer Errors
account-must-exist
Error: Account must existMessage: The account used must exist.
account-must-be-active
Error: Account must be activeMessage: The account used must be active.
account-must-be-supply
Error: Account must be supplyMessage: The account used must be a supply account.
retailer-must-be-authorized
Error: Retailer must be authorizedMessage: The retailer associated with the account must be authorized.
retailer-must-be-live
Error: Retailer must be liveMessage: The retailer used must be live.
Pagination Errors
pagination-is-required
Error: Pagination is requiredMessage: Pagination is required when no entity IDs are provided in the filters.
pagination-limit-cannot-be-zero
Error: Pagination limit cannot be zeroMessage: Pagination limit must be greater than 0 when offset is positive.
pagination-limit-invalid
Error: Pagination limit is invalidMessage: Pagination limit must be a positive number lower than 10 (current limit set to 10).
pagination-offset-invalid
Error: Pagination offset is invalidMessage: Pagination offset must be a positive number.