Tailored Audiences
Create a Tailored Audience on an X Ads account and upload its members by email.
A Tailored Audience is an X customer_list audience: you create it, then upload the emails of the people in it.
Create an audience
Create the audience with POST /v1/ads/audiences (type: "customer_list"), then upload members with POST /v1/ads/audiences/{audienceId}/users.
const { data: audience } = await zernio.adaudiences.createAdAudience({
body: {
accountId: '66b2e19d8c3f5a7e9d0b1c2d',
adAccountId: '18ce54d4x5t',
type: 'customer_list',
name: 'Trial signups'
}
});
const { data: upload } = await zernio.adaudiences.addUsersToAdAudience({
path: { audienceId: audience.audience.id },
body: { users: [{ email: 'jane@example.com' }, { email: 'sam@example.com' }] }
});
console.log(upload.numReceived);Response (201):
{
"audience": { "id": "66e5b2c3d4f5a6b7c8d9e0f1", "name": "Trial signups", "type": "customer_list", "platform": "twitter", "status": "pending" },
"message": "Audience created"
}Response (200):
{ "message": "Users added", "numReceived": 2, "numInvalid": 0 }Target it by passing its X custom audience id in audienceInclude or audienceExclude (Targeting fields).
How it behaves
- X matches on email and ignores
phone. - Zernio hashes every value with SHA-256 before it leaves.
- One upload takes at most 10,000 users.
- An audience must match at least 100 recently active users before X allows targeting against it, so its size reads as 0 until then.
customer_listis the only audience type on X.
If it fails
| Error | Cause | Fix |
|---|---|---|
422 with code feature_not_available | An audience type other than customer_list | Create a customer_list audience. |
400 on the upload | An empty users array, or a user with no email or phone | Send at least one user with an email. |
422 on the upload | The audience is not a customer_list, or has no X id yet | Upload to a customer_list audience that has finished creating. |
409 with code ads_connection_required | The xads account is inactive or needs reconnection | Reconnect it, then retry. |
Related
- Create ad audience: every field of the create.
- Add users to ad audience: the upload and its limits.
- Targeting fields: target or exclude the audience.
- Create a campaign: the request that carries
audienceInclude.
Was this page helpful?