End a campaign
scope campaigns:spendwrites
Ends a running campaign, as the End button does.
Everything the agent is told about this tool
Ends a running campaign, as the End button does. If no clip is still being measured or decided it ends now and its whole reserve returns to the balance (returned). Otherwise it becomes closing: no new takes or clips, the clips already running are paid from the reserve (stillReserved) and the rest returns when the last is done (campaign.ended tells you). It cannot be undone, so it ends nothing unless you send confirm: true: without it the answer is what ending WOULD do (confirmed: false) and the campaign is untouched. Show the brand that preview, and send confirm: true only when it says yes. Name the campaign by slug or externalRef. A real ending needs an idempotencyKey; dryRun: true also ends nothing. A key that no person has given limits to does not end a campaign alone: its confirm: true answers status: approval_required and ENDS NOTHING until a person approves in the workspace (approveAt) - tell the human and do NOT ask again; read approval_status or events_list for campaign.ended or approval.rejected. The preview says requiresApproval.
Arguments
Section titled “Arguments”| Name | Type | Required | Description |
|---|---|---|---|
campaign |
string |
yes | The campaign’s slug, or the externalRef you gave it. |
confirm |
boolean |
no | Ending cannot be undone, so nothing ends unless this is true. Leave it out (or false) to see exactly what ending would do — what comes back and what stays reserved — and end nothing. |
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.
Example
Section titled “Example”curl https://countviews.com/api/public/v1/call \ -H "Authorization: Bearer $COUNTVIEWS_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"campaign_end","arguments":{"campaign":"spring-launch","confirm":false}}'{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "campaign_end", "arguments": { "campaign": "spring-launch", "confirm": false } }}{ "campaign": "spring-launch", "confirm": false}