Ads · Ad Accounts
Adds account sitelinks. Works with Google Ads.
POST
https://api.pozy.ai/v1/ads/accounts/sitelinksGoogle WorkspaceaddAccountSitelinks
Guide: Google Ads
Request
Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the ads resource group disabled get 403 resource_group_disabled. Authentication
Request body
application/json, required
accountIdstringrequiredMatches
^[a-fA-F0-9]{24}$.adAccountIdstringMatches
^\d+$.customerIdstringdeprecatedMatches
^\d+$.sitelinksarray of objectrequiredAt least 1 item. Up to 20 items.
textstringrequired1 to 25 characters.
linkUrlstring (URL)requireddescription1string1 to 35 characters.
description2string1 to 35 characters.
Example
curl -X POST "https://api.pozy.ai/v1/ads/accounts/sitelinks" \
-H "Authorization: Bearer $POZY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountId": "696e0b682d0a31188e7a2ba9",
"sitelinks": [
{
"text": "Hello from Pozy",
"linkUrl": "https://pozy.ai/media/example-1.jpg"
}
]
}'const res = await fetch("https://api.pozy.ai/v1/ads/accounts/sitelinks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POZY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
accountId: "696e0b682d0a31188e7a2ba9",
sitelinks: [
{
text: "Hello from Pozy",
linkUrl: "https://pozy.ai/media/example-1.jpg"
}
]
}),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);import os
import requests
resp = requests.post(
"https://api.pozy.ai/v1/ads/accounts/sitelinks",
headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
json={
"accountId": "696e0b682d0a31188e7a2ba9",
"sitelinks": [
{
"text": "Hello from Pozy",
"linkUrl": "https://pozy.ai/media/example-1.jpg",
},
],
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())Response
201 on success
customerIdstringsitelinksarray of objectassetIdstringtextstring1 to 25 characters.
linkUrlstring (URL)description1string1 to 35 characters.
description2string1 to 35 characters.
201 response
{
"customerId": "691909ff82eb5ed7c816716d",
"sitelinks": [
{
"assetId": "649acf9abd13dbccc57b6012",
"text": "Hello from Pozy",
"linkUrl": "https://pozy.ai/media/example-1.jpg",
"description1": "string",
"description2": "string"
}
]
}Errors
Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:
| 400 | invalid_request_error | A parameter or body field is missing or invalid. param names it. |
| 401 | authentication_error | The API key is missing, revoked or expired. |
| 403 | permission_error | The key is read-only, scoped to other profiles, or has this resource group disabled. |
| 429 | rate_limit_error | Too many requests this minute. Wait for Retry-After seconds. |
Every code is listed in Errors.
More in Ad Accounts
GETList comments on an adPOSTReply to an ad commentPOSTHide or unhide an ad commentDELDelete an ad commentGETList TikTok Business CentersGETAd account change / audit logGETA/B tests and lift studiesGETList Instagram ad identitiesGETList Instagram posts to boostGETList advertisable appsGETGet iOS 14 campaign limitsGETBusinesses listGETBusiness usersGETPage users of a businessPOSTAssign a user to a PageDELRemove a user from a PageGETList ad labelsPOSTCreate a Google Ads labelPATCHUpdate a Google Ads labelDELRemove a Google Ads labelPOSTAttach a Google Ads labelDELDetach a Google Ads labelGETList high-demand periodsPOSTSchedule a budget increaseGETList value rule setsPOSTCreate a value rule setGETRead a value rule setPUTReplace a value rule setDELDelete a value rule setGETList negative keyword listsPOSTCreate a negative keyword listGETGet a negative keyword listPUTRename a negative keyword listDELDelete a negative keyword listPUTReplace negative list keywordsGETList account calloutsPOSTAdd account calloutsPUTUpdate account calloutsDELRemove account calloutGETList account sitelinksPUTUpdate account sitelinksDELRemove account sitelinkGETList account snippetsPOSTAdd account snippetsPUTUpdate account snippetsDELRemove account snippetGETGet manager account hierarchyPOSTInvite a client account to a managerPATCHAccept, decline, cancel or end a manager linkGETGet ad account billingPOSTSet up ad account billing (monthly invoicing)GETList user access invitationsPOSTInvite a user to an ad account by emailDELRevoke a user access invitationGETList invitations awaiting multi-party approvalDELWithdraw an invitation awaiting multi-party approvalGETAd account usersPOSTAssign a user to an ad accountDELRemove a user from an ad accountGETAd account financesGETCheck an ad account before creating adsGETRead an ad account's campaigns and ad sets liveGETList ad accountsPOSTCreate ad accountPATCHUpdate ad account settingsGETGet ad account DSA defaultsGETGet DSA recommendationsGETList custom conversionsPOSTCreate custom conversionGETList TikTok ad pixels