POST - Create

Audience APIs allow brands to Create, Update, Replace, Remove, List and View Audiences.

Audiences are lists of Custom User IDs that can be used for targeting with Batch Platform, when performing Email Campaigns and Automations.

Audiences can also be associated with attributes that can be used for personalization purposes (more information here).

API Description

This API schema is available in the OpenAPI 3.1 format: View it online.

Request structure

Route

The Audience API exposes a POST endpoint that allows to create an audience:

https://api.batch.com/2.2/audiences/create

Headers and authentication

See Overview → Using Project APIs.

Post data

The body of the request must contain a valid JSON payload describing the operations to be executed on the audience.

Here is a how a complete JSON payload looks like:

{
  "name": "AUDIENCE_NAME",
  "display_name": "The audience description",
  "type": "custom_ids"
}

Let's see the parameters in detail.

IdDescription
namestring - Required
Name of the audience.
This name should be unique.

E.g.{"name":"AUDIENCE_NAME"}
typestring - Required
Type of the audience.
Only Customer User ID (custom_ids) type is accepted for the moment.

E.g.{"type":"custom_ids"}
display_namestring - Optional
Description of the audience.
E.g.{"display_name":"The audience description"}

Responses

Success

If the POST to the API endpoint is successful you will receive an HTTP 202 confirmation and a token.

{
  "indexing_token": "a0082dc6860938a26280bd3ba927303b"
}

Once you get your token, you can use it to check the indexing state of this update with the API.

Failure

If the POST data does not meet the API requirements you will receive an actionable error message. Contact us at support@batch.com if you need further support.

See the list of potential failures in the specification.