Skip to content

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.

  1. Check what is missing. whoami → readiness.blockers and guide.nextBestAction. A company and money come first: Top up and set up the company.

  2. Save the draft. The same externalRef updates 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"}}'

    The answer lists missing. Fill each and save again until complete: true. Ask the person for anything you would have to invent, such as the brief.

  3. 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"}}'

    You get quoteId, reserve (what the launch takes from the wallet), fee (our commission, inside it), covers (does the balance cover it; null without wallet:read) and requiresApproval. The quote holds the price for 15 minutes and works once. Any edit to the draft makes it stale.

  4. Show the person the price. Reserve, fee, whether the balance covers it, and that a person must approve if requiresApproval is true.

  5. 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"}}'

    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 at approveAt.

  6. If approval is required, wait. Do not call campaign_activate again. Poll approval_status with the approvalId every minute until it is approved, rejected or expired, or watch events_list for campaign.activated, approval.rejected, approval.expired.

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.

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.

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.