# 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](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](/developers/authentication#scopes).
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:

```bash
export ASKADS_API_KEY=ask_key_...
```

## 2. Your first call

```bash
curl https://askads.app/api/v1/me -H "Authorization: Bearer $ASKADS_API_KEY"
```

```json
{
  "data": {
    "team": { "id": "usr_...", "name": "Sunrise Coffee", "ownerEmail": "ann@sunrise.example" },
    "person": { "id": "usr_...", "email": "ann@sunrise.example" },
    "role": "owner",
    "scopes": ["read", "drafts", "requests"],
    "canApprove": false
  }
}
```

`canApprove` is always `false` for a key, whatever your role. That is [the money rule](/developers/money-rule).

## 3. Read your ad accounts and a report

```bash
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.

```bash
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

```bash
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

```bash
npm install @askads/sdk
```

```ts
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](/developers/sdk).

## With the CLI

```bash
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](/developers/cli).

## Next

- [Webhooks](/developers/webhooks): hear about approvals, launches and pauses as they happen.
- [Agents and MCP](/developers/mcp): give Claude Code, Codex or Cursor the same tools.
- [API reference](/developers/api): every operation.
