Skip to main content
POST
Create a custom audience on an Instagram ad account. Four kinds are supported, chosen by type:
  • website: people a Meta pixel saw on your site.
  • engagement: people who engaged with a Facebook Page, an Instagram account or a video.
  • lookalike: people like an audience you already have.
  • customerList: your own list of people, which you fill with hashed identifiers through Audience Members.
The new audience is returned under audience in the same shape as Audiences, with status.ready: false. Meta fills it over the next hours; list it to see when status.ready turns true, then use its id in targeting.audiences or targeting.excludedAudiences when you boost a post.
Before any audience can be created or used, a person with a role on the ad account must accept Meta’s Custom Audience terms once, at https://business.facebook.com/ads/manage/customaudiences/tos/?act=<ad account id>. Ayrshare cannot accept them for you. Until then this endpoint returns a 400 with code: 101, and details names the account and the page where the terms are accepted. Ad accounts shows whether they are accepted in tosAccepted.customAudienceTos.
Meta does not allow lookalike audiences on housing, employment or financial ads. A boost in one of those special ad categories can include or exclude website, engagement and customer-list audiences, but not a lookalike.

Header Parameters

Body Parameters

Every type takes these:
string
required
The ad account to create the audience on, from ad accounts, with or without the act_ prefix.
string
required
The name shown in Ads Manager.
string
required
website, engagement, lookalike or customerList. Each type takes only its own fields below. A field from another type returns a 400 with code: 101 naming it.
string
A new unique value, such as a UUID, for each new audience. If you repeat a request with the same key, Ayrshare returns the first response, marked idempotentReplayed: true, and creates no second audience. You can send the key as the Idempotency-Key header instead; if you send both, they must match. Reusing a key with a different request, or while the first request is still in progress, returns a 409. A 503 means the key could not be reserved and nothing was created: retry later with the same key.

Website audiences

string
required
The Meta pixel whose events build the audience.
number
required
How many days a visitor stays in the audience after their last visit, 1 to 180.
array
Keep only visits to URLs containing one of these strings, for example ["/pricing"].
string
Keep only visitors who fired this pixel event, for example Purchase or a custom event name. Leave it out to count every visit.

Engagement audiences

string
required
Where the engagement happened: page (a Facebook Page), instagram (an Instagram account) or video.
array
required
The Page ids, Instagram account ids or video ids to count engagement on, as strings.
string
required
The engagement counted. The values are Meta’s own names and depend on source:
  • page: page_engaged, page_visited, page_liked, page_messaged, page_cta_clicked, page_or_post_save, page_post_interaction
  • instagram: ig_business_profile_all, ig_business_profile_engaged, ig_business_profile_visit, ig_business_profile_ad_saved, ig_user_messaged_business, ig_ad_like, ig_ad_comment, ig_ad_share, ig_ad_save, ig_ad_cta_click, ig_ad_carousel_swipe, ig_organic_like, ig_organic_comment, ig_organic_share, ig_organic_save, ig_organic_swipe, ig_organic_carousel_swipe
  • video: video_watched, video_completed, video_view_10s, video_view_15s, video_view_25_percent, video_view_50_percent, video_view_75_percent
Any other value returns a 400 with code: 101 listing the values for that source.
number
required
How many days a person stays in the audience after they last engaged: 1 to 730 for page and instagram, 1 to 365 for video.

Lookalike audiences

string
required
The audience to find people like, from Audiences. Meta needs at least 100 people in it.
number
required
How large the lookalike is, as a whole percent of the people in the countries the boost targets: 1 (closest match) to 20 (widest reach).
boolean
Let Meta take seed people from other countries when a country has too few. Defaults to false.
A lookalike has no country of its own: the people come from the countries the boost’s targeting.locations names. Sending a country returns a 400 with code: 101. A lookalike takes Meta a few hours to fill.

Customer-list audiences

string
default:"USER_PROVIDED_ONLY"
Where the list’s data came from, in Meta’s terms: USER_PROVIDED_ONLY (people gave it to you), PARTNER_PROVIDED_ONLY (a partner gave it to you) or BOTH_USER_AND_PARTNER_PROVIDED.
A customer list starts empty. Add people with Audience Members. Hashed identifiers are still personal data: read that page before you upload a list.