control_media_buy: pause or resume it, cancel it, or
change its budget caps, pacing, bidding or package controls. This page says what
the storefront checks first and what it answers.
Which storefronts serve it
A storefront that books through Apostra servescontrol_media_buy, and lists it
in media_buy.lifecycle_tools in its get_adcp_capabilities answer. A storefront
that sells through a platform adapter, such as Meta or TikTok, keeps
update_media_buy, which every storefront serves, and does not serve
control_media_buy.
What you send
Send the buy’smedia_buy_id, your account, the control fields, and the
revision from the latest get_media_buys read of that buy. revision is
required. The storefront compares it with the buy’s current revision before it
writes anything.
What the storefront checks
A buy that lists no actions allows no control: the storefront lists a buy’s
actions while it is active or paused, so a control of any other buy is refused
with
ACTION_NOT_ALLOWED (reason: no_actions_available). The reporting webhook
is not checked against an action.
Two controls at once
The storefront runs onecontrol_media_buy of a buy at a time. A second control
of the same buy waits for the first to finish, then reads the buy’s new revision
and is refused with CONFLICT if it sent the old one. So two controls sent at
the same revision never both apply: one does, and the other is told the
revision to resend with. A control that cannot start within about 20 seconds, because the
buy stayed busy or the storefront was already running as many controls as it
allows, is refused with SERVICE_UNAVAILABLE (retryable) and nothing is applied.
This guarantee covers controls against each other only. A change to the same buy
that is not a control_media_buy, such as an update_media_buy, a creative
change or a status update from the seller, does not wait for the lock. One that
lands between a control’s revision check and the seller’s answer is not
serialized with it. Read the buy again after a CONFLICT and send the control
with the revision you read.
What you get back
A control that was applied answersstatus: "completed" with:
A control that the seller queues for approval answers
status: "submitted" with
a task_id. Nothing has changed until the task completes. While it is queued, a second
control of the same buy is refused with CONFLICT (details.reason: update_pending_approval, mutation_outcome: not_applied), because the buy’s
revision has not moved yet; send it again once the update has been decided. An
update whose approval was granted but whose forward to the seller has run out of
retries no longer counts: it is finished, and the buy accepts controls again. If the storefront cannot read the buy’s pending updates, the control is refused
with SERVICE_UNAVAILABLE and mutation_outcome: not_applied; send it again.
If the control is applied but the buy’s new revision cannot be read, the answer
is SERVICE_UNAVAILABLE with mutation_outcome: applied. Do not resend the
control; read the buy with get_media_buys first. Every refusal carries
mutation_outcome on the error itself, so an agent knows whether the buy
changed.
A known limit
The revision check protects against anothercontrol_media_buy, not against every
writer. A write that is not a control (update_media_buy, an update entering approval, a late leg commit, a creative sync or poll) can commit between the revision check and the seller call. The storefront closes this by checking and advancing the
revision before it calls the seller, for control_media_buy and
update_media_buy together; that work is tracked as AI-23966.
What it does not do
control_media_buy does not change creatives, add products or packages, change
the flight, change prices, or change billing terms. Those go through their own
tasks or through a refined proposal. Sending an identical call again with the
same idempotency_key returns the first answer.
Turning it off
There is no separate switch forcontrol_media_buy. A storefront serves it
whenever it books through Apostra and is not a platform-adapter storefront. It
changes the buy it names, so it is not read-only: it takes the same effect as
update_media_buy with the same change.