AskAds

Developers

Quickstart

Make a key, make your first call, build a paused draft and ask a person to approve it. About two minutes.

1. Make a key

  1. Sign in at https://askads.app/app and open Developers, then API keys.
  2. Press New key. Give it a name you will recognise later, such as "Reporting script".
  3. Tick the scopes it needs. For this quickstart: Read, Build paused drafts and Ask for approval. What each scope allows.
  4. Copy the key. It starts with ask_key_ and is shown once. Keep it in an environment variable, never in code or a chat:
export ASKADS_API_KEY=ask_key_...

2. Your first call

curl https://askads.app/api/v1/me -H "Authorization: Bearer $ASKADS_API_KEY"
{
  "data": {
    "team": { "id": "usr_...", "name": "Sunrise Coffee", "ownerEmail": "[email protected]" },
    "person": { "id": "usr_...", "email": "[email protected]" },
    "role": "owner",
    "scopes": ["read", "drafts", "requests"],
    "canApprove": false
  }
}

canApprove is always false for a key, whatever your role. That is the money rule.

3. Read your ad accounts and a report

curl https://askads.app/api/v1/ad-accounts -H "Authorization: Bearer $ASKADS_API_KEY"

curl "https://askads.app/api/v1/ad-accounts/acc_123/report?period=last_7_days" \
  -H "Authorization: Bearer $ASKADS_API_KEY"

Lists come back as { "data": [ ... ], "hasMore": false, "nextCursor": null }. Pass ?cursor=<nextCursor> for the next page. Money is always { "amountMinor": 2500, "currency": "USD", "display": "$25.00" }.

If the list is empty, connect an ad platform on the website first. No ad platform is switched on for the public yet. Waiting for the platform's own approval: Meta (Facebook and Instagram), Google Ads, TikTok Ads, LinkedIn Ads, Microsoft Ads, Reddit Ads, X Ads, Pinterest Ads. Each platform switches on as its approval lands. The API, the CLI and the automations need no change when that happens: the platform just starts showing up in GET /status and GET /ad-accounts.

4. Build a paused draft

Everything you build is created paused and read back to make sure it is paused.

curl -X POST https://askads.app/api/v1/ad-accounts/acc_123/drafts \
  -H "Authorization: Bearer $ASKADS_API_KEY" \
  -H "Idempotency-Key: spring-launch-1" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Spring launch",
    "objective": "traffic",
    "dailyBudget": 30,
    "audience": { "countries": ["US"] },
    "ads": [{
      "name": "Spring 1",
      "headline": "Fresh roast, delivered",
      "primaryText": "Our spring blend is here.",
      "callToAction": "shop_now",
      "destinationUrl": "https://sunrise.example/spring"
    }]
  }'

Send an Idempotency-Key on every write. If the network drops and you send the same request again with the same key, you get the first answer back instead of a second draft.

5. Ask to launch it

curl -X POST https://askads.app/api/v1/approval-requests/launch \
  -H "Authorization: Bearer $ASKADS_API_KEY" \
  -H "Idempotency-Key: spring-launch-1-ask" \
  -H "Content-Type: application/json" \
  -d '{ "adAccountId": "acc_123", "level": "campaign", "id": "<campaignId from step 4>" }'

The answer holds an approvalRequest with status: "pending" and an approveUrl. The people in your team who may approve get an email with that link. One of them opens it, signs in and presses Approve. Every spending limit is checked again at that moment.

Your script can wait for the decision by reading GET /approval-requests/{id}, or by listening for the approval.approved webhook. There is no way to approve through the API: POST /approval-requests/{id}/approve always answers 403 approval_needs_a_person.

With the TypeScript SDK

npm install @askads/sdk
import { AskAds } from '@askads/sdk';

const askads = new AskAds({ apiKey: process.env.ASKADS_API_KEY });
const me = await askads.getMe();
for await (const account of askads.paginate('listAdAccounts')) console.log(account.name, account.platform);

The SDK sends an Idempotency-Key with every write, retries on 429 and 5xx (honouring Retry-After), and pages for you. More about the SDK.

With the CLI

npx askads login            # opens your browser; check the code and press Allow
npx askads whoami
npx askads accounts list
npx askads report acc_123 --period last_7_days

More about the CLI.

Next

This page as Markdown, for AI agents: /developers/quickstart.md