OverviewProductsPlatformsAPI ReferenceResources

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.

TypeScript
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):

JSON
{
  "audience": { "id": "66e5b2c3d4f5a6b7c8d9e0f1", "name": "Trial signups", "type": "customer_list", "platform": "twitter", "status": "pending" },
  "message": "Audience created"
}

Response (200):

JSON
{ "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_list is the only audience type on X.

If it fails

ErrorCauseFix
422 with code feature_not_availableAn audience type other than customer_listCreate a customer_list audience.
400 on the uploadAn empty users array, or a user with no email or phoneSend at least one user with an email.
422 on the uploadThe audience is not a customer_list, or has no X id yetUpload to a customer_list audience that has finished creating.
409 with code ads_connection_requiredThe xads account is inactive or needs reconnectionReconnect it, then retry.
Was this page helpful?

On this page