> For the complete documentation index, see [llms.txt](https://doc.batch.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.batch.com/developer/api/mep/custom-audience/1.1/list.md).

# GET - List

The Custom Audience API 1.1 only accepts install IDs for the moment. For audiences with custom user IDs or advertising IDs, the version 1.0 should be used.

The Custom Audience API enables you to create, update, delete and list custom audiences. A **custom audience** can contain a list of custom user IDs, advertising IDs *(GAID or IDFA)* or install IDs.

This is useful to target segments with push notifications or In-App messages, either they are coming from your userbase or created by third-party tools.

Custom audiences created using the API can be targeted from Batch’s dashboard or the Campaigns API.

**NOTE**: Custom Audiences with install IDs are only supported from the 1.1 version of the Custom Audience API. Also note that this version doesn't support custom user IDs and advertising IDs for the moment.

### Request structure

#### Route

The Custom Audience API exposes a GET endpoint that allows to list custom audiences :

`https://api.batch.com/1.1/BATCH_API_KEY/custom-audience`

Here is a valid cURL example:

```bash
curl -H "Content-Type: application/json" -H "X-Authorization: BATCH_REST_API_KEY" -X GET "https://api.batch.com/1.1/BATCH_API_KEY/custom-audience"
```

The `BATCH_API_KEY` value is either your **Live**, **Dev** or **SDK** Batch API key from the settings page of your app within the dashboard (⚙ Settings → General).

#### Headers

In order to authenticate with the API, you need to provide your **company REST API Key** as the value of the `X-Authorization` header. You can find it in ⚙ Settings → General.

#### Get parameters

<table data-full-width="true"><thead><tr><th width="123">Id</th><th width="694">Description</th></tr></thead><tbody><tr><td><code>from</code></td><td><strong>Integer</strong> - <em>Optional, Default : 0</em><br>Value used for pagination : it indicates the offset of the first custom audience to be returned. Custom audiences are ordered by creation date (from the most recent to the oldest).<br><em>E.g.</em><code>"/custom-audience?from=10"</code></td></tr><tr><td><code>limit</code></td><td><strong>Integer</strong> - <em>Optional, Default : 10, Max : 100</em><br>Value that indicates the number of custom audiences to be returned per API call.<br><em>E.g.</em><code>"/custom-audience?limit=20"</code></td></tr></tbody></table>

Here is an example of a valid cURL CLI request, which would return 5 custom audiences, starting from the 10th audience :

```
curl -H "Content-Type: application/json" -H "X-Authorization: BATCH_REST_API_KEY" -X GET
"https://api.batch.com/1.1/BATCH_API_KEY/custom-audiences?from=10&limit=5"
```

### Responses

#### Success

If the GET to the API endpoint is successful you will receive an **HTTP 200** confirmation and information about your audiences.

```json
{
  "custom_audiences": [
    {
      "name": "audience2",
      "type": "custom_ids",
      "description": "The audience2 description",
      "nb_ids": 23764,
      "created": "2018-06-29T14:59:03",
      "updated": "2018-06-29T15:07:32"
    },
    {
      "name": "audience1",
      "type": "advertising_ids",
      "description": "The audience1 description",
      "nb_ids": 16743,
      "created": "2018-06-29T13:12:09",
      "updated": "2018-06-29T13:42:59"
    }
  ]
}
```

#### 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.

* `AUTHENTICATION_INVALID` (Http status code: 401, Error code: 10)
* `API_MISUSE` (Http status code: 403, Error code: 12)
* `ROUTE_NOT_FOUND` (Http status code: 404, Error code: 20)
* `MISSING_PARAMETER` (Http status code: 400, Error code: 30)
* `MALFORMED_PARAMETER` (Http status code: 400, Error code: 31)
* `MALFORMED_JSON_BODY` (Http status code: 400, Error code: 32)
* `SERVER_ERROR` (Http status code: 500, Error code: 1)
* `MAINTENANCE_ERROR` (Http status code: 503, Error code: 2)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.batch.com/developer/api/mep/custom-audience/1.1/list.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
