curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/reddit/audiences \
-d '{"accountId": "a2_abcdefg", "name": "Site visitors 30d", "type": "website", "pixelId": "t2_pixel123", "retentionDays": 30, "event": "purchase"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/reddit/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
}
r = requests.post('https://api.ayrshare.com/api/ads/reddit/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "ca.129482487242999",
"name": "Site visitors 30d",
"type": "website",
"size": null,
"status": { "ready": false, "code": null, "description": "PENDING" },
"created": "2026-12-02T10:05: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": "retentionDays on reddit is at most 90."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Reddit's reason"
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Reddit's reason"
}
Reddit Ads
Audience बनाएँ
अपनी customer list या website visitors की Reddit custom audience बनाएँ, ताकि पोस्ट boost करते समय उसे शामिल या बाहर कर सकें।
POST
/
ads
/
reddit
/
audiences
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/reddit/audiences \
-d '{"accountId": "a2_abcdefg", "name": "Site visitors 30d", "type": "website", "pixelId": "t2_pixel123", "retentionDays": 30, "event": "purchase"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/reddit/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
}
r = requests.post('https://api.ayrshare.com/api/ads/reddit/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "ca.129482487242999",
"name": "Site visitors 30d",
"type": "website",
"size": null,
"status": { "ready": false, "code": null, "description": "PENDING" },
"created": "2026-12-02T10:05: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": "retentionDays on reddit is at most 90."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Reddit's reason"
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Reddit's reason"
}
Reddit ad account पर custom audience बनाएँ। दो प्रकार समर्थित हैं, जिन्हें
Reddit पर
type से चुना जाता है:
customerList: लोगों की आपकी अपनी सूची, जिसे आप Audience Members के ज़रिए hashed identifiers से भरते हैं।website: वे लोग जिन्हें आपके Reddit pixel ने आपकी साइट पर देखा।
audience के अंतर्गत उसी रूप में लौटाई जाती है जैसी Audiences में, status.ready: false के साथ। Reddit समय के साथ उसे भरता है। यह देखने के लिए उसे सूचीबद्ध करें कि status.ready कब true होता है, फिर जब आप कोई पोस्ट boost करें, तो उसका id targeting.audiences या targeting.excludedAudiences में उपयोग करें।
- Reddit यहाँ engagement या lookalike audiences नहीं बना सकता।
type: engagementयाtype: lookalikeभेजने परcode: 101वाला400लौटाया जाता है। - किसी boost द्वारा target किए जाने से पहले audience में कम से कम 1,000 matched लोग होने चाहिए।
हैडर पैरामीटर
बॉडी पैरामीटर
दोनों types ये लेते हैं:customerList या website। हर type सिर्फ़ नीचे दिए अपने fields लेता है। किसी दूसरे type का field उसके नाम के साथ code: 101 वाला 400 लौटाता है।हर नई audience के लिए एक नया unique मान, जैसे UUID। अगर आप उसी key से request दोहराते हैं, तो Ayrshare पहला response लौटाता है,
idempotentReplayed: true से चिह्नित, और दूसरी audience नहीं बनाता। आप key को इसके बजाय Idempotency-Key header में भी भेज सकते हैं; अगर दोनों भेजते हैं, तो वे मेल खाने चाहिए। किसी अलग request के साथ, या जब पहला request अभी चल रहा हो, key दोबारा उपयोग करने पर 409 मिलता है। 503 का मतलब है कि key reserve नहीं हो सकी और कुछ भी नहीं बना: उसी key से बाद में फिर कोशिश करें।Customer-list audiences
Customer list कोई अन्य required field नहीं लेती और खाली शुरू होती है। Audience Members से लोग जोड़ें। Hashed identifiers फिर भी personal data हैं: सूची upload करने से पहले वह पेज पढ़ें। Reddit परcustomerFileSource तभी स्वीकार किया जाता है जब वह USER_PROVIDED_ONLY हो: Reddit सिर्फ़ आपकी अपनी सूचियाँ लेता है।
Website audiences
सिर्फ़ उन विज़िटर को रखें जिन्होंने यह event trigger किया। Reddit के standard events
PAGE_VISIT, VIEW_CONTENT, SEARCH, ADD_TO_CART, ADD_TO_WISHLIST, PURCHASE, LEAD और SIGN_UP हैं, किसी भी letter case में। कोई भी अन्य मान custom event के नाम के रूप में भेजा जाता है। हर visit गिनने के लिए इसे छोड़ दें।urlContains स्वीकार नहीं किया जाता: Reddit की website audience में कोई URL filter नहीं होता।
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/reddit/audiences \
-d '{"accountId": "a2_abcdefg", "name": "Site visitors 30d", "type": "website", "pixelId": "t2_pixel123", "retentionDays": 30, "event": "purchase"}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/reddit/audiences", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
"accountId": "a2_abcdefg",
"name": "Site visitors 30d",
"type": "website",
"pixelId": "t2_pixel123",
"retentionDays": 30,
"event": "purchase"
}
r = requests.post('https://api.ayrshare.com/api/ads/reddit/audiences', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"audience": {
"id": "ca.129482487242999",
"name": "Site visitors 30d",
"type": "website",
"size": null,
"status": { "ready": false, "code": null, "description": "PENDING" },
"created": "2026-12-02T10:05: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": "retentionDays on reddit is at most 90."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "Reddit's reason"
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to create the audience. Please try again.",
"details": "Reddit's reason"
}