> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Audience

> Permanently delete a custom audience from an Instagram ad account by id, including ones made in Ads Manager. Delete any lookalikes built on it first.

Delete a custom audience from an Instagram ad account. This is permanent: the audience disappears from Ads Manager too, and any running ad that targets it stops reaching those people.

<ul>
  <li>An audience that lookalikes are built on cannot be deleted. Delete those lookalikes first.</li>
  <li>Any custom audience on the ad account named by `accountId` can be deleted, including one created in Ads Manager. Any other id returns a `400` with `code: 101`.</li>
</ul>

## Header Parameters

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`
**Profile-Key** `string`

[Profile Key](https://www.ayrshare.com/docs/apis/overview.md#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## Path Parameters

**id** `string` *required*

The audience id, from [Audiences](https://www.ayrshare.com/docs/apis/ads/instagram/get-audiences.md).

## Query Parameters

**accountId** `string` *required*

The ad account the audience belongs to, with or without the `act_` prefix.

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890"
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";

fetch("https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890", {
      method: "DELETE",
      headers: {
        "Authorization": `Bearer ${API_KEY}`
      }
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

```python Python theme={"system"}
import requests

headers = {'Authorization': 'Bearer API_KEY'}

r = requests.delete('https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890', headers=headers)

print(r.json())
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "id": "23851234567890123",
  "deleted": true
}
```

```json 400: Lookalikes depend on it theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
  "details": "This audience cannot be deleted while lookalike audiences are built on it. Delete those lookalikes first."
}
```

```json 400: Not an audience of this account theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
  "details": "id 23851234567890123 is not a custom audience of ad account 123456789."
}
```

```json 400: Meta refused the request theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 369,
  "message": "Unable to delete the audience. Please try again.",
  "details": "Meta's reason"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.