Перейти к содержимому

Add money to a running campaign

Это содержимое пока не доступно на вашем языке.

scope campaigns:spendwritesmoves money

Adds the money a quote priced to a RUNNING campaign’s budget, taken from the wallet, exactly as the workspace’s Add budget does.

Everything the agent is told about this tool

Adds the money a quote priced to a RUNNING campaign’s budget, taken from the wallet, exactly as the workspace’s Add budget does. First ask campaign_quote_issue with campaign and addBudget (minor units) and pass its quoteId here; what is added is what was quoted. THIS MOVES MONEY, so it may answer status: approval_required instead — then NOTHING was added: a person has been emailed and must approve in their workspace (approveAt). When that happens, tell the human and do NOT retry; check approval_status or events_list for campaign.budget_added or approval.rejected. The same limits and caps as a launch apply, and cap_exceeded is a refusal, not a question. Send an idempotencyKey. insufficient_balance, quote_stale, quote_expired and quote_used mean nothing was spent.

Name Type Required Description
quoteId string yes The quoteId that campaign_quote_issue returned for an addBudget quote. A quote is good once, for a few minutes, for the campaign as it was quoted.
idempotencyKey string no Any unique string for this attempt, for example a UUID. Sending the same key and body again returns the first answer instead of writing twice.
dryRun boolean no When true, runs every check and returns what would happen, and keeps nothing: no draft, no log entry, no event.

A write: send an idempotencyKey (any unique string for this one intent). A call with dryRun: true needs none.

curl https://countviews.com/api/public/v1/call \
-H "Authorization: Bearer $COUNTVIEWS_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"campaign_budget_add","arguments":{"quoteId":"0199aaaa-bbbb-7ccc-8ddd-eeeeffff0001","idempotencyKey":"topup-spring-launch-1"}}'