Approve Opportunity
Approve one opportunity that waits for your decision. AIclicks reserves the price from the deposit and closes the deal.
curl --request POST \
--url https://api.aiclicks.io/api/v1/outreach/opportunities/0b9c8d7e-6f5a-4b3c-8d2e-1a0b9c8d7e6f/approve \
--header 'Authorization: Bearer ak_live_xxx' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: approve-0b9c8d7e' \
--data '{
"max_price_cents": 35000,
"note": "Approved by the client on 2 Dec."
}'
import httpx, os
resp = httpx.post(
"https://api.aiclicks.io/api/v1/outreach/opportunities/0b9c8d7e-6f5a-4b3c-8d2e-1a0b9c8d7e6f/approve",
headers={
"Authorization": f"Bearer {os.environ['AICLICKS_API_KEY']}",
"Idempotency-Key": "approve-0b9c8d7e",
},
json={"max_price_cents": 35000},
)
resp.raise_for_status()
print(resp.json()["data"]["status"]) # approved
const resp = await fetch(
"https://api.aiclicks.io/api/v1/outreach/opportunities/0b9c8d7e-6f5a-4b3c-8d2e-1a0b9c8d7e6f/approve",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AICLICKS_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "approve-0b9c8d7e",
},
body: JSON.stringify({ max_price_cents: 35000 }),
},
);
const { data } = await resp.json();
console.log(data.status); // approved
{
"data": {
"id": "0b9c8d7e-6f5a-4b3c-8d2e-1a0b9c8d7e6f",
"external_id": "opp_99121",
"status": "approved",
"action_required": false,
"approved_price_cents": 35000,
"campaign_balance_cents": 285000,
"updated_at": "2026-12-02T09:47:30.000Z"
},
"generated_at": "2026-12-02T09:47:30.120Z"
}
{
"detail": "Insufficient balance: 20000 cents available, 35000 cents required."
}
{
"detail": "Opportunity is 'outreached' and does not wait for approval."
}
Approves one opportunity with the status action_needed. AIclicks reserves estimated_price_cents from the campaign deposit, closes the deal with the publisher and moves the opportunity to approved. When the link is live, the status becomes completed and you get the opportunity.completed webhook.
You can send a lower price with max_price_cents. This is a counter-offer: the opportunity goes back to processing, and AIclicks negotiates again. When the publisher answers, the opportunity comes back to action_needed with the new quote. AIclicks never spends more than the price you approved.
This is a billed write. The approved price is reserved from the deposit at once. If balance_cents is lower than the price, the call returns 402 and nothing changes. Pay the Stripe payment link or bank transfer that AIclicks sent you, and try again when the payment settles.
Path parameters
UUID of the opportunity.
Body parameters
The highest price you accept. Defaults to estimated_price_cents. A value lower than the quote starts a counter-offer.
Change the preferred anchor text before the deal closes.
Change the client page that the link points to before the deal closes.
A note that AIclicks stores in the opportunity history.
Errors
balance_cents of the campaign is lower than the price.
The opportunity does not exist.
The opportunity is not action_needed, or the price would take spent_cents + reserved_cents above budget_cents of the campaign ("Over budget: ..."). Raise the budget with Update Campaign and try again. A repeat approve on an approved opportunity returns 200 with the current state.