curl --request PATCH \
--url https://api.apostra.com/api/v2/buyer/media-buys/{mediaBuyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.apostra.com/api/v2/buyer/media-buys/{mediaBuyId}"
payload = { "name": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.apostra.com/api/v2/buyer/media-buys/{mediaBuyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"mediaBuy": {
"mediaBuyId": "mb_ETBn4gJ9Wu",
"name": "<string>",
"status": "PENDING_APPROVAL",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"channelGroup": {
"channelGroupId": "<string>",
"name": "<string>"
},
"campaignId": "cmp_ETBn4gJ9Wu",
"sourceStatus": "<string>",
"archivedAt": "2023-11-07T05:31:56Z",
"pendingAt": "storefront",
"reconciliation": {
"required": true,
"since": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pendingChange": {
"status": "PENDING_APPROVAL",
"differences": {
"endTime": {
"live": "<string>",
"proposed": "<string>"
},
"budget": {
"live": 123,
"proposed": 123
},
"creatives": {
"live": [
"<string>"
],
"proposed": [
"<string>"
]
}
},
"pendingAt": "storefront",
"reason": "Extended to 8/11 with W5+W6 gross budget",
"proposalId": "uprop_abc1234567"
},
"pendingReason": "forward_failed_needs_correction",
"pendingSince": "2023-11-07T05:31:56Z",
"errorCode": "product_no_longer_available",
"errorOwner": "buyer_input",
"sourceMessage": "<string>",
"forwardedAt": "2023-11-07T05:31:56Z",
"buyerReference": "sf:42:sf_mb_1783031864469_8pbc8mmr",
"warnings": [
"<string>"
],
"startTime": "<string>",
"endTime": "<string>",
"optimizationGoals": [
{
"kind": "metric",
"metric": "clicks",
"standard": "mrc",
"vendor": {
"domain": "<string>",
"brand_id": "<string>",
"countries": [
"<string>"
],
"industries": [
"<string>"
],
"data_subject_contestation": {},
"brand_kit_override": {
"logo": {
"asset_type": "image",
"url": "<string>",
"width": 4503599627370496,
"height": 4503599627370496,
"file_size_bytes": 4503599627370496,
"pixel_ratio": 1,
"state_id": "<string>",
"breakpoint_id": "<string>",
"focal_point": [
123
],
"format": "<string>",
"alt_text": "<string>",
"provenance": {
"digital_source_type": "digital_capture",
"synthetic_depiction": true,
"ai_tool": {
"name": "<string>",
"version": "<string>",
"provider": "<string>"
},
"human_oversight": "none",
"declared_by": {
"role": "creator",
"agent_url": "<string>"
},
"declared_at": "<string>",
"created_time": "<string>",
"c2pa": {
"manifest_url": "<string>"
},
"embedded_provenance": [
{
"method": "manifest_wrapper",
"provider": "<string>",
"standard": "<string>",
"verify_agent": {
"agent_url": "<string>",
"feature_id": "<string>"
},
"embedded_at": "<string>"
}
],
"watermarks": [
{
"media_type": "audio",
"provider": "<string>",
"verify_agent": {
"agent_url": "<string>",
"feature_id": "<string>"
},
"c2pa_action": "c2pa.watermarked.bound",
"embedded_at": "<string>"
}
],
"disclosure": {
"required": true,
"jurisdictions": [
{
"country": "<string>",
"regulation": "<string>",
"region": "<string>",
"label_text": "<string>",
"render_guidance": {
"persistence": "continuous",
"min_duration_ms": 4503599627370496,
"positions": [
"prominent"
],
"ext": {}
}
}
]
},
"verification": [
{
"verified_by": "<string>",
"result": "authentic",
"verified_time": "<string>",
"confidence": 0.5,
"details_url": "<string>"
}
],
"ext": {}
}
},
"colors": {
"primary": "<string>",
"secondary": "<string>",
"accent": "<string>"
},
"voice": "<string>",
"tagline": "<string>"
}
},
"reach_unit": "individuals",
"target_frequency": {
"window": {
"interval": 4503599627370496,
"unit": "seconds"
},
"min": 4503599627370496,
"max": 4503599627370496
},
"view_duration_seconds": 1,
"target": {
"kind": "cost_per",
"value": 1
},
"priority": 4503599627370496
}
],
"goalCommitment": {
"source": "proposal",
"kind": "guaranteed",
"askedGoal": {
"kind": "metric",
"subject": "<string>",
"eventTypes": [
"<string>"
],
"target": {
"kind": "cost_per",
"value": 123
},
"vendor": {
"domain": "<string>",
"brandId": "<string>"
},
"metricId": "<string>"
},
"answeredTarget": {
"kind": "cost_per",
"value": 123
},
"meetsAskedTarget": true,
"goalAnswers": [
{
"productId": "<string>",
"pricingOptionId": "<string>",
"pricingModel": "<string>",
"fixedPrice": 123,
"currency": "<string>",
"deliveryType": "guaranteed",
"measurementTerms": null,
"sellerOptimizationGoals": [
"<unknown>"
],
"askedGoal": {
"kind": "metric",
"subject": "<string>",
"eventTypes": [
"<string>"
],
"target": {
"kind": "cost_per",
"value": 123
},
"vendor": {
"domain": "<string>",
"brandId": "<string>"
},
"metricId": "<string>"
},
"answeredTarget": {
"kind": "cost_per",
"value": 123
},
"commitment": "guaranteed",
"storefrontId": "<string>",
"goalCoverage": {
"coversPrimaryGoal": true,
"uncovered": [
{
"priority": 123,
"code": "goal_kind_not_declared"
}
]
}
}
],
"proposalVersionId": "<string>"
},
"frequencyCap": {
"level": "mediaBuy",
"requested": {
"maxImpressions": 4503599627370495,
"per": "individuals",
"window": {
"interval": 4503599627370495,
"unit": "seconds"
}
},
"status": "requested",
"effective": {
"maxImpressions": 4503599627370495,
"per": "individuals",
"window": {
"interval": 4503599627370495,
"unit": "seconds"
}
}
},
"pausedBy": "buyer",
"pauseRequestedAt": "2023-11-07T05:31:56Z"
},
"warnings": [
"<string>"
]
}{
"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": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Update media buy
Partially update a single media buy, resolved top-level by mediaBuyId — the owning campaign is resolved server-side, consistent with GET /media-buys/. Rejected outright (not a warning) when it would violate a campaign invariant: currency (a product’s replacement pricing option settles in a different currency than this buy), budget headroom (the update would exceed the campaign’s remaining all-in budget), or mode compatibility (the campaign is directed and has no platform-managed update path). A flight date outside the campaign’s current window is not a failure — the campaign flight is widened to cover it and a warning is returned.
curl --request PATCH \
--url https://api.apostra.com/api/v2/buyer/media-buys/{mediaBuyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.apostra.com/api/v2/buyer/media-buys/{mediaBuyId}"
payload = { "name": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.apostra.com/api/v2/buyer/media-buys/{mediaBuyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"mediaBuy": {
"mediaBuyId": "mb_ETBn4gJ9Wu",
"name": "<string>",
"status": "PENDING_APPROVAL",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"channelGroup": {
"channelGroupId": "<string>",
"name": "<string>"
},
"campaignId": "cmp_ETBn4gJ9Wu",
"sourceStatus": "<string>",
"archivedAt": "2023-11-07T05:31:56Z",
"pendingAt": "storefront",
"reconciliation": {
"required": true,
"since": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pendingChange": {
"status": "PENDING_APPROVAL",
"differences": {
"endTime": {
"live": "<string>",
"proposed": "<string>"
},
"budget": {
"live": 123,
"proposed": 123
},
"creatives": {
"live": [
"<string>"
],
"proposed": [
"<string>"
]
}
},
"pendingAt": "storefront",
"reason": "Extended to 8/11 with W5+W6 gross budget",
"proposalId": "uprop_abc1234567"
},
"pendingReason": "forward_failed_needs_correction",
"pendingSince": "2023-11-07T05:31:56Z",
"errorCode": "product_no_longer_available",
"errorOwner": "buyer_input",
"sourceMessage": "<string>",
"forwardedAt": "2023-11-07T05:31:56Z",
"buyerReference": "sf:42:sf_mb_1783031864469_8pbc8mmr",
"warnings": [
"<string>"
],
"startTime": "<string>",
"endTime": "<string>",
"optimizationGoals": [
{
"kind": "metric",
"metric": "clicks",
"standard": "mrc",
"vendor": {
"domain": "<string>",
"brand_id": "<string>",
"countries": [
"<string>"
],
"industries": [
"<string>"
],
"data_subject_contestation": {},
"brand_kit_override": {
"logo": {
"asset_type": "image",
"url": "<string>",
"width": 4503599627370496,
"height": 4503599627370496,
"file_size_bytes": 4503599627370496,
"pixel_ratio": 1,
"state_id": "<string>",
"breakpoint_id": "<string>",
"focal_point": [
123
],
"format": "<string>",
"alt_text": "<string>",
"provenance": {
"digital_source_type": "digital_capture",
"synthetic_depiction": true,
"ai_tool": {
"name": "<string>",
"version": "<string>",
"provider": "<string>"
},
"human_oversight": "none",
"declared_by": {
"role": "creator",
"agent_url": "<string>"
},
"declared_at": "<string>",
"created_time": "<string>",
"c2pa": {
"manifest_url": "<string>"
},
"embedded_provenance": [
{
"method": "manifest_wrapper",
"provider": "<string>",
"standard": "<string>",
"verify_agent": {
"agent_url": "<string>",
"feature_id": "<string>"
},
"embedded_at": "<string>"
}
],
"watermarks": [
{
"media_type": "audio",
"provider": "<string>",
"verify_agent": {
"agent_url": "<string>",
"feature_id": "<string>"
},
"c2pa_action": "c2pa.watermarked.bound",
"embedded_at": "<string>"
}
],
"disclosure": {
"required": true,
"jurisdictions": [
{
"country": "<string>",
"regulation": "<string>",
"region": "<string>",
"label_text": "<string>",
"render_guidance": {
"persistence": "continuous",
"min_duration_ms": 4503599627370496,
"positions": [
"prominent"
],
"ext": {}
}
}
]
},
"verification": [
{
"verified_by": "<string>",
"result": "authentic",
"verified_time": "<string>",
"confidence": 0.5,
"details_url": "<string>"
}
],
"ext": {}
}
},
"colors": {
"primary": "<string>",
"secondary": "<string>",
"accent": "<string>"
},
"voice": "<string>",
"tagline": "<string>"
}
},
"reach_unit": "individuals",
"target_frequency": {
"window": {
"interval": 4503599627370496,
"unit": "seconds"
},
"min": 4503599627370496,
"max": 4503599627370496
},
"view_duration_seconds": 1,
"target": {
"kind": "cost_per",
"value": 1
},
"priority": 4503599627370496
}
],
"goalCommitment": {
"source": "proposal",
"kind": "guaranteed",
"askedGoal": {
"kind": "metric",
"subject": "<string>",
"eventTypes": [
"<string>"
],
"target": {
"kind": "cost_per",
"value": 123
},
"vendor": {
"domain": "<string>",
"brandId": "<string>"
},
"metricId": "<string>"
},
"answeredTarget": {
"kind": "cost_per",
"value": 123
},
"meetsAskedTarget": true,
"goalAnswers": [
{
"productId": "<string>",
"pricingOptionId": "<string>",
"pricingModel": "<string>",
"fixedPrice": 123,
"currency": "<string>",
"deliveryType": "guaranteed",
"measurementTerms": null,
"sellerOptimizationGoals": [
"<unknown>"
],
"askedGoal": {
"kind": "metric",
"subject": "<string>",
"eventTypes": [
"<string>"
],
"target": {
"kind": "cost_per",
"value": 123
},
"vendor": {
"domain": "<string>",
"brandId": "<string>"
},
"metricId": "<string>"
},
"answeredTarget": {
"kind": "cost_per",
"value": 123
},
"commitment": "guaranteed",
"storefrontId": "<string>",
"goalCoverage": {
"coversPrimaryGoal": true,
"uncovered": [
{
"priority": 123,
"code": "goal_kind_not_declared"
}
]
}
}
],
"proposalVersionId": "<string>"
},
"frequencyCap": {
"level": "mediaBuy",
"requested": {
"maxImpressions": 4503599627370495,
"per": "individuals",
"window": {
"interval": 4503599627370495,
"unit": "seconds"
}
},
"status": "requested",
"effective": {
"maxImpressions": 4503599627370495,
"per": "individuals",
"window": {
"interval": 4503599627370495,
"unit": "seconds"
}
}
},
"pausedBy": "buyer",
"pauseRequestedAt": "2023-11-07T05:31:56Z"
},
"warnings": [
"<string>"
]
}{
"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": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Path Parameters
Body
Partial update for a single media buy, resolved top-level by mediaBuyId. Rejected outright (not warned) when it would violate a campaign invariant: currency (a product's replacement pricing option settles in a different currency), budget headroom (the update would exceed the campaign's remaining all-in budget), or mode compatibility (the campaign is directed — its mirrored media buy has no platform-managed update path).
Response
Update media buy
The updated media buy (why-visibility fields included) plus any non-blocking warnings.