curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/snapchat/audiences \
-d '{"accountId": "5a0d1b2c-0000-4000-8000-000000000003", "type": "lookalike", "name": "Like my subscribers", "seedAudienceId": "8c1e2f3a-0000-4000-8000-000000000101", "countries": ["US", "GB"], "similarity": "balance"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/snapchat/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
accountId: "5a0d1b2c-0000-4000-8000-000000000003",
type: "lookalike",
name: "Like my subscribers",
seedAudienceId: "8c1e2f3a-0000-4000-8000-000000000101",
countries: ["US", "GB"],
similarity: "balance"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {
'accountId': '5a0d1b2c-0000-4000-8000-000000000003',
'type': 'lookalike',
'name': 'Like my subscribers',
'seedAudienceId': '8c1e2f3a-0000-4000-8000-000000000101',
'countries': ['US', 'GB'],
'similarity': 'balance'
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/ads/snapchat/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "8c1e2f3a-0000-4000-8000-000000000102",
"name": "Like my subscribers",
"type": "lookalike",
"size": { "lower": 0, "upper": 0 },
"status": { "ready": false, "code": null, "description": "NOT_READY" },
"created": "2026-12-02T12:00:00.000Z"
}
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "ratio is not a recognised field."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "event is required on snapchat: one of APP_INSTALL, PURCHASE, ..."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Snapchat's reason"
}
Snapchat Ads
Create Audience
Create a Snapchat customer list, website or lookalike audience segment to include or exclude when you boost a Snap with Ayrshare.
POST
/
ads
/
snapchat
/
audiences
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/snapchat/audiences \
-d '{"accountId": "5a0d1b2c-0000-4000-8000-000000000003", "type": "lookalike", "name": "Like my subscribers", "seedAudienceId": "8c1e2f3a-0000-4000-8000-000000000101", "countries": ["US", "GB"], "similarity": "balance"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/snapchat/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
accountId: "5a0d1b2c-0000-4000-8000-000000000003",
type: "lookalike",
name: "Like my subscribers",
seedAudienceId: "8c1e2f3a-0000-4000-8000-000000000101",
countries: ["US", "GB"],
similarity: "balance"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {
'accountId': '5a0d1b2c-0000-4000-8000-000000000003',
'type': 'lookalike',
'name': 'Like my subscribers',
'seedAudienceId': '8c1e2f3a-0000-4000-8000-000000000101',
'countries': ['US', 'GB'],
'similarity': 'balance'
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/ads/snapchat/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "8c1e2f3a-0000-4000-8000-000000000102",
"name": "Like my subscribers",
"type": "lookalike",
"size": { "lower": 0, "upper": 0 },
"status": { "ready": false, "code": null, "description": "NOT_READY" },
"created": "2026-12-02T12:00:00.000Z"
}
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "ratio is not a recognised field."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "event is required on snapchat: one of APP_INSTALL, PURCHASE, ..."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Snapchat's reason"
}
Create an audience segment on a Snapchat ad account. Three kinds are supported, chosen by
A Snapchat lookalike has no size percentage:
type:
customerList: your own list of people, which you fill with hashed identifiers through Audience Members.website: people your Snap Pixel saw fire one event on your site.lookalike: people in the countries you name who are like the people in one of your customer lists.
audience in the same shape as Audiences, with status.ready: false. Snapchat fills it over time. List it to see when status.ready turns true, then use its id in targeting.audiences or targeting.excludedAudiences when you boost a Snap.
- A boost can target a segment once Snapchat has matched enough people. Until then
status.readyisfalse. - An ad account holds at most 1,000 customer lists, and a segment name is at most 375 characters. Snapchat refuses more with
code: 369. - Snapchat cannot create engagement audiences here.
type: engagementreturns a400withcode: 101. - Send an
idempotencyKeyif you may retry: a retry with the same key and body returns the first response instead of creating a second segment.
Header Parameters
Body Parameters
Your Snapchat ad account ID to create the segment on, for example
5a0d0000-0000-4000-8000-000000000003.Customer list
No other fields. The list is empty, and keeps people until you remove them.customerFileSource is optional: Snapchat lists hold your own data only, so any value but USER_PROVIDED_ONLY returns code: 101.
Website
The pixel event a visitor must have fired, as Snapchat spells it:
PAGE_VIEW, VIEW_CONTENT, ADD_CART, START_CHECKOUT, PURCHASE, SIGN_UP, SUBSCRIBE, SEARCH, ADD_TO_WISHLIST, CUSTOM_EVENT_1 to CUSTOM_EVENT_5, or another of Snapchat’s pixel events. Required on Snapchat.urlContains is not supported on Snapchat: a Snapchat website segment keeps people by pixel event only, so it returns code: 101.
Lookalike
The customer list to find people like (
type: customerList in Audiences). Snapchat builds a lookalike only from a customer list, so a seed that is not one of your customer lists on this ad account (another kind of segment, another account’s segment, or a deleted one) returns code: 101.balance (the default) weighs closeness and size, similarity keeps the people most like the seed, and reach finds the most people.ratio and allowInternationalSeeds return code: 101.
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/snapchat/audiences \
-d '{"accountId": "5a0d1b2c-0000-4000-8000-000000000003", "type": "lookalike", "name": "Like my subscribers", "seedAudienceId": "8c1e2f3a-0000-4000-8000-000000000101", "countries": ["US", "GB"], "similarity": "balance"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/snapchat/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
accountId: "5a0d1b2c-0000-4000-8000-000000000003",
type: "lookalike",
name: "Like my subscribers",
seedAudienceId: "8c1e2f3a-0000-4000-8000-000000000101",
countries: ["US", "GB"],
similarity: "balance"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {
'accountId': '5a0d1b2c-0000-4000-8000-000000000003',
'type': 'lookalike',
'name': 'Like my subscribers',
'seedAudienceId': '8c1e2f3a-0000-4000-8000-000000000101',
'countries': ['US', 'GB'],
'similarity': 'balance'
}
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer API_KEY'}
r = requests.post('https://api.ayrshare.com/api/ads/snapchat/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "8c1e2f3a-0000-4000-8000-000000000102",
"name": "Like my subscribers",
"type": "lookalike",
"size": { "lower": 0, "upper": 0 },
"status": { "ready": false, "code": null, "description": "NOT_READY" },
"created": "2026-12-02T12:00:00.000Z"
}
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "ratio is not a recognised field."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "event is required on snapchat: one of APP_INSTALL, PURCHASE, ..."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Snapchat's reason"
}