# Customer list audiences

Create a Snap Audience Match customer list with POST /v1/ads/audiences, add or remove hashed emails and phone numbers, and delete it.

import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

Build a Snap Audience Match list on a `snapchatads` account, then target it through `audienceInclude` or `audienceExclude` ([Targeting fields](/platforms/snapchat-ads/targeting)).

## Create an audience

Create the list with `POST /v1/ads/audiences` (`type: "customer_list"`), then upload members with `POST /v1/ads/audiences/{audienceId}/users`.

Snapchat matches on email and phone number. Send them in plaintext (SHA-256 hashed before they leave) or already hashed, up to 10,000 members per request.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: audience } = await zernio.adaudiences.createAdAudience({
  body: {
    accountId: '66b2e19d8c3f5a7e9d0b1c2d',
    adAccountId: '8f2c4a1e-3b5d-4c6e-9f7a-1b2c3d4e5f60',
    type: 'customer_list',
    name: 'Repeat buyers'
  }
});

const { data: upload } = await zernio.adaudiences.addUsersToAdAudience({
  path: { audienceId: audience.audience.id },
  body: { users: [{ email: 'jane@example.com' }, { phone: '+14155550123' }] }
});

console.log(upload.numReceived);
```
</Tab>
<Tab value="Python">
```python
audience = client.ad_audiences.create_ad_audience(
    account_id="66b2e19d8c3f5a7e9d0b1c2d",
    ad_account_id="8f2c4a1e-3b5d-4c6e-9f7a-1b2c3d4e5f60",
    type="customer_list",
    name="Repeat buyers",
)

upload = client.ad_audiences.add_users_to_ad_audience(
    audience_id=audience["audience"]["id"],
    users=[{"email": "jane@example.com"}, {"phone": "+14155550123"}],
)

print(upload["numReceived"])
```
</Tab>
<Tab value="curl">
```bash
curl -X POST "https://zernio.com/api/v1/ads/audiences" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "accountId": "66b2e19d8c3f5a7e9d0b1c2d", "adAccountId": "8f2c4a1e-3b5d-4c6e-9f7a-1b2c3d4e5f60", "type": "customer_list", "name": "Repeat buyers" }'

curl -X POST "https://zernio.com/api/v1/ads/audiences/66e5b2c3d4f5a6b7c8d9e0f2/users" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "users": [{ "email": "jane@example.com" }, { "phone": "+14155550123" }] }'
```
</Tab>
</Tabs>

Response (`201`):

```json
{
  "audience": { "id": "66e5b2c3d4f5a6b7c8d9e0f2", "name": "Repeat buyers", "type": "customer_list", "platform": "snapchat", "status": "processing" },
  "message": "Audience created"
}
```

Response (`200`):

```json
{ "message": "Users added", "numReceived": 2, "numInvalid": 0 }
```

## Remove members or delete

- `DELETE /v1/ads/audiences/{audienceId}/users` removes the members you send, hashed the same way, so each row removes exactly the person it added.
- `DELETE /v1/ads/audiences/{audienceId}` deletes the list on Snapchat.

`GET /v1/ads/audiences` lists the account's lists, including pixel, lookalike and engagement audiences made in Ads Manager.

## How it behaves

- Each upload adds to the list, so send larger lists as several uploads.
- The list reads `processing` while Snapchat matches members, `too_small` while too few have matched to deliver, and `ready` once it can be targeted.
- Phone numbers are hashed as country code and national number, without a `+`, `00` or trunk `0`, the way Snapchat matches them.

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| `numInvalid` above 0 | A member had neither an email nor a phone number | Send at least one per member, phones with their country code. |
| Audience reads `too_small` | Too few members matched | Upload more members. |

## Related

- [Targeting fields](/platforms/snapchat-ads/targeting): where `audienceInclude` and `audienceExclude` go.
- [Create ad audience](/ad-audiences/create-ad-audience): every field of the create.
- [Add users to ad audience](/ad-audiences/add-users-to-ad-audience): the member upload.