Skip to content

Quickstart

After this page you have a working key, a first answer from whoami, and you know the four calls that take a draft to a live campaign.

  1. Make a key. In the dashboard open Agent, press Connect an agent, pick the preset Read only, name the key and copy it. It is shown once.

    export COUNTVIEWS_KEY=cvk_…
  2. Ask who the key is. whoami needs no scope and changes nothing.

    curl https://countviews.com/api/public/v1/call \
    -H "Authorization: Bearer $COUNTVIEWS_KEY" \
    -H "Content-Type: application/json" \
    -d '{"name":"whoami","arguments":{}}'
  3. Read the answer.

    Field Means
    workspace, key name, scopes which brand this is and what the key may call. A tool outside the scopes is refused
    limits calls per minute; the key’s own spending limits (autoActivateUpTo, dailyCap, monthlyCap, null = none, so every launch waits for a person); clips it may decide per day
    readiness canLaunch, blockers, next, and the company on record (missing, submitted, verified)
  4. Look at the account. Try campaigns_list and wallet_statement. Both are reads.

    curl https://countviews.com/api/public/v1/call \
    -H "Authorization: Bearer $COUNTVIEWS_KEY" \
    -H "Content-Type: application/json" \
    -d '{"name":"campaigns_list","arguments":{"status":"all"}}'

A Read key stops at step 4. To go further, make a key with the Drafts preset (saves drafts) and then Launch (prices and launches, and asks a person first). Presets are explained in permissions.

Tool What happens
campaign_draft_save stores the draft; lists what is still missing. No money
campaign_quote_issue prices it: reserve, fee, covers, requiresApproval. Returns a quoteId, valid 15 minutes, single use. No money
campaign_activate takes only the quoteId. Answers activated or approval_required. Reserves the budget
approval_status after approval_required only: pending, approved, rejected, expired
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"}}'

Amounts are {amount, currency} in cents. externalRef is yours: saving again with it updates the same draft.

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"}}'
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 from the quote>","idempotencyKey":"launch-spring-2026-1"}}'