curl --request POST \
--url https://api.apostra.com/api/v2/buyer/campaigns/{campaignId}/creatives/sync \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.apostra.com/api/v2/buyer/campaigns/{campaignId}/creatives/sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.apostra.com/api/v2/buyer/campaigns/{campaignId}/creatives/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"outcome": "synced",
"synced": [
{
"storefrontId": 4503599627370495,
"mediaBuyId": "<string>",
"status": "<string>",
"message": "<string>",
"errorCode": "<string>",
"heldCreatives": [
{
"creativeId": "<string>",
"reason": "destination_required",
"message": "<string>"
}
],
"unassignedCreatives": [
{
"creativeId": "<string>",
"reason": "no_package_accepts_format",
"message": "<string>"
}
]
}
],
"skipped": [
{
"mediaBuyId": "<string>",
"storefrontId": 4503599627370495,
"routeMediaBuyId": "<string>",
"reason": "NO_ROUTE_YET"
}
]
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Sync campaign creatives
Sync attached creatives to every eligible campaign media buy. Non-terminal buys without a route are returned in skipped and do not block eligible buys; terminal buys are excluded. Each creative is assigned only to the packages whose product accepts its format, and is sent with the one seller format option it fits when a single option resolves. The HTTP response remains 200 for per-buy failures, with status: error, the existing human-readable message, and an optional stable errorCode. Account-routing failures use MANAGED_ACCOUNT_LINKAGE_REQUIRED when the storefront relationship is not ready or source_account_not_bound when the selected inventory source lacks an active account. A creative held from delivery is never sent and its format is not compared; it is listed in the buy’s heldCreatives with its reason. A buy whose creatives are all held returns errorCode: CREATIVES_HELD_FROM_DELIVERY; a buy where no compared creative fits any product returns errorCode: NO_COMPATIBLE_CREATIVES; a buy where a creative’s pinned format no longer resolves to one option returns errorCode: CREATIVE_FORMAT_UNRESOLVED; a buy whose campaign holds a hosted audio or video file under 1,024 bytes returns errorCode: CREATIVE_ASSET_INVALID for every buy; and a buy whose media buy names no seller agent for the storefront returns errorCode: SELLER_AGENT_ROUTE_UNAVAILABLE. Nothing is sent for a buy that returns one of these five codes.
curl --request POST \
--url https://api.apostra.com/api/v2/buyer/campaigns/{campaignId}/creatives/sync \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.apostra.com/api/v2/buyer/campaigns/{campaignId}/creatives/sync"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.apostra.com/api/v2/buyer/campaigns/{campaignId}/creatives/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"outcome": "synced",
"synced": [
{
"storefrontId": 4503599627370495,
"mediaBuyId": "<string>",
"status": "<string>",
"message": "<string>",
"errorCode": "<string>",
"heldCreatives": [
{
"creativeId": "<string>",
"reason": "destination_required",
"message": "<string>"
}
],
"unassignedCreatives": [
{
"creativeId": "<string>",
"reason": "no_package_accepts_format",
"message": "<string>"
}
]
}
],
"skipped": [
{
"mediaBuyId": "<string>",
"storefrontId": 4503599627370495,
"routeMediaBuyId": "<string>",
"reason": "NO_ROUTE_YET"
}
]
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Response
Sync campaign creatives
Campaign creative-sync outcomes. Eligible buys are dispatched even when other non-terminal buys are skipped.
synced: every media buy took its creatives, none was left unassigned and none was skipped. partial: at least one media buy took its creatives, and another failed, was skipped or left a creative unassigned. failed: no media buy took any creative. The HTTP status is 200 in all three cases; read this field and each item.
synced, partial, failed