Launch a campaign
After this guide an agent can save a draft, price it, launch it, and hand over to the person when they must say yes. Scopes: campaigns:write for the draft, campaigns:spend for the quote and launch. Every write needs an idempotencyKey.
-
Check what is missing.
whoami→readiness.blockersandguide.nextBestAction. A company and money come first: Top up and set up the company. -
Save the draft. The same
externalRefupdates the same draft. Money is{ amount, currency }in cents.curl https://countviews.com/api/public/v1/call \-H "Authorization: Bearer $COUNTVIEWS_KEY" \-H "Content-Type: application/json" \-d '{"name":"campaign_draft_save","arguments":{"externalRef":"spring-2026","title":"Spring launch","kind":"clips","platforms":["youtube_shorts"],"topics":["gaming"],"budget":{"amount":50000,"currency":"EUR"},"rate":{"amount":100,"currency":"EUR"},"maxPayoutPerVideo":{"amount":20000,"currency":"EUR"},"idempotencyKey":"save-spring-2026-1"}}'{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "campaign_draft_save","arguments": {"externalRef": "spring-2026","title": "Spring launch","kind": "clips","platforms": ["youtube_shorts"],"topics": ["gaming"],"budget": {"amount": 50000,"currency": "EUR"},"rate": {"amount": 100,"currency": "EUR"},"maxPayoutPerVideo": {"amount": 20000,"currency": "EUR"},"idempotencyKey": "save-spring-2026-1"}}}{"externalRef": "spring-2026","title": "Spring launch","kind": "clips","platforms": ["youtube_shorts"],"topics": ["gaming"],"budget": {"amount": 50000,"currency": "EUR"},"rate": {"amount": 100,"currency": "EUR"},"maxPayoutPerVideo": {"amount": 20000,"currency": "EUR"},"idempotencyKey": "save-spring-2026-1"}The answer lists
missing. Fill each and save again untilcomplete: true. Ask the person for anything you would have to invent, such as the brief. -
Price it. Nothing is reserved by this call.
curl https://countviews.com/api/public/v1/call \-H "Authorization: Bearer $COUNTVIEWS_KEY" \-H "Content-Type: application/json" \-d '{"name":"campaign_quote_issue","arguments":{"campaign":"spring-2026","idempotencyKey":"quote-spring-2026-1"}}'{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "campaign_quote_issue","arguments": {"campaign": "spring-2026","idempotencyKey": "quote-spring-2026-1"}}}{"campaign": "spring-2026","idempotencyKey": "quote-spring-2026-1"}You get
quoteId,reserve(what the launch takes from the wallet),fee(our commission, inside it),covers(does the balance cover it;nullwithoutwallet:read) andrequiresApproval. The quote holds the price for 15 minutes and works once. Any edit to the draft makes it stale. -
Show the person the price. Reserve, fee, whether the balance covers it, and that a person must approve if
requiresApprovalis true. -
Launch.
curl https://countviews.com/api/public/v1/call \-H "Authorization: Bearer $COUNTVIEWS_KEY" \-H "Content-Type: application/json" \-d '{"name":"campaign_activate","arguments":{"quoteId":"<quoteId>","idempotencyKey":"launch-spring-2026-1"}}'{"jsonrpc": "2.0","id": 1,"method": "tools/call","params": {"name": "campaign_activate","arguments": {"quoteId": "<quoteId>","idempotencyKey": "launch-spring-2026-1"}}}{"quoteId": "<quoteId>","idempotencyKey": "launch-spring-2026-1"}status: "activated"means it is live and the budget is reserved.status: "approval_required"(HTTP 202) means nothing was spent: a person was emailed and approves in the workspace atapproveAt. -
If approval is required, wait. Do not call
campaign_activateagain. Pollapproval_statuswith theapprovalIdevery minute until it isapproved,rejectedorexpired, or watchevents_listforcampaign.activated,approval.rejected,approval.expired.
When a person is asked
Section titled “When a person is asked”| Situation | What happens |
|---|---|
| Key has no limits | Every launch asks a person. |
| Key’s first launch | Always asks, even with limits. |
| Launch above the key’s automatic limit | Asks. |
| Launch past the key’s daily or monthly cap | Refused with cap_exceeded. Not a question. |
| A person refuses | The key waits 60 minutes (approval_cooldown) before asking again. |
| Nobody answers | The request expires after 24 hours. |
At most 5 requests wait at once, and no launch through the API reserves more than €5,000. Over that, publish in the workspace.
What to tell the person
Section titled “What to tell the person”When it is live: the slug, the reserve and the fee. When it waits: what is being launched, how much, why they are asked (reason), where to approve (approveAt) and until when (expiresAt). When it is refused, say so and ask what to change before asking again.
Errors you will meet
Section titled “Errors you will meet”| Code | Do |
|---|---|
draft_incomplete |
Read missing, save, quote again. |
quote_stale, quote_expired |
Nothing was spent. Quote again. |
insufficient_balance |
Nothing was spent. Tell the person the shortfall and top up. |
entity_unverified |
Record the company with company_set. |
geography_unavailable |
Country targeting is not served yet. Save payableCountries: [] and quote again. |
over_ceiling |
Use a smaller budget or publish in the workspace. |