curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890", {
method: "DELETE",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.delete('https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890', headers=headers)
print(r.json())
{
"status": "success",
"id": "23851234567890123",
"deleted": true
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "This audience cannot be deleted while lookalike audiences are built on it. Delete those lookalikes first."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id 23851234567890123 is not a custom audience of ad account 123456789."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to delete the audience. Please try again.",
"details": "Meta's reason"
}
Instagram Ads
删除受众
按 ID 永久删除 Instagram 广告账户中的自定义受众,包括在 Ads Manager 中创建的受众。请先删除基于它的类似受众。
DELETE
/
ads
/
instagram
/
audiences
/
{id}
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890", {
method: "DELETE",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.delete('https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890', headers=headers)
print(r.json())
{
"status": "success",
"id": "23851234567890123",
"deleted": true
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "This audience cannot be deleted while lookalike audiences are built on it. Delete those lookalikes first."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id 23851234567890123 is not a custom audience of ad account 123456789."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to delete the audience. Please try again.",
"details": "Meta's reason"
}
从 Instagram 广告账户中删除自定义受众。此操作是永久性的:受众也会从 Ads Manager 中消失,任何定位它的投放中广告都将不再触达这些人。
- 作为类似受众基础的受众无法删除。请先删除这些类似受众。
- 可以删除
accountId指定的广告账户上的任何自定义受众,包括在 Ads Manager 中创建的受众。任何其他 ID 都会返回带有code: 101的400。
请求头参数
路径参数
受众 ID,来自受众。
查询参数
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890", {
method: "DELETE",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.delete('https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890', headers=headers)
print(r.json())
{
"status": "success",
"id": "23851234567890123",
"deleted": true
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "This audience cannot be deleted while lookalike audiences are built on it. Delete those lookalikes first."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id 23851234567890123 is not a custom audience of ad account 123456789."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to delete the audience. Please try again.",
"details": "Meta's reason"
}