# Quickstart

> Send a Request from your code, answer it on your phone, and read the Response back.

Kiwi Studio's invoice came in as a PDF, and your agent read it. Before filing it, the agent asks you on your phone, waits, and goes on with your answer. This page sends that Request. It takes a few minutes.

## Get a test key

Create a free account in the [dashboard](https://app.nibify.app/sign-up). Your first Project is already there, with a `test` API key: copy it, it is shown once. It starts with `sk_test_`.

Then install the Nibify app on your phone from the App Store or Google Play, and sign in with the same account, or scan the QR code the dashboard shows. A Request goes to every phone you are signed in on.

## Install the SDK

```bash
npm install @nibify/sdk
```

With curl there is nothing to install.

## Send the Request

Put your key in place of `sk_test_…` and run it.

TypeScript:

```ts
import { Nibify } from '@nibify/sdk';

const nibify = new Nibify({ apiKey: 'sk_test_…' });

const result = await nibify.ask({
  sender: { name: 'invoice-flow' },
  notification: {
    title: 'Kiwi Studio invoice: $1,240, due Oct 30',
    body: 'Read from the PDF. File it as consulting, or fix it first.',
    quickActions: [
      { name: 'file', label: 'File it' },
      { name: 'fix', label: 'Fix it' },
    ],
  },
});

if (result.status === 'answered') {
  result.response.actionName; // 'file'
}
```

curl:

```bash
curl -X POST https://api.nibify.app/v1/requests \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "sender": { "name": "invoice-flow" },
    "notification": {
      "title": "Kiwi Studio invoice: $1,240, due Oct 30",
      "body": "Read from the PDF. File it as consulting, or fix it first.",
      "quickActions": [
        { "name": "file", "label": "File it" },
        { "name": "fix", "label": "Fix it" }
      ]
    }
  }'
```

This Request has no Surface, only its notification: a title, a line, and two `quickActions`, **File it** and **Fix it**. `file` and `fix` are the names your code gets back.

## Answer on your phone

The notification arrives within seconds. Press **File it** on it, from the lock screen.

## Read the answer

With the SDK, `ask` returns when you answer: `result.status` is `answered` and `result.response.actionName` is `file`.

With curl, `POST /v1/requests` answered `201` with a `requestId`. Ask for its Response:

```bash
curl "https://api.nibify.app/v1/requests/msg_…/response?wait=30" \
  -H "Authorization: Bearer sk_test_…"
```

```json
{
  "requestId": "msg_…",
  "status": "answered",
  "createdAt": "2026-10-12T09:00:00Z",
  "expiresAt": null,
  "environment": "test",
  "deliveredAt": "2026-10-12T09:00:02Z",
  "readAt": null,
  "contentDeletedAt": null,
  "response": {
    "responseId": "res_…",
    "actionName": "file",
    "sourceComponentId": "notification",
    "context": {},
    "clientTimestamp": "2026-10-12T09:00:41Z",
    "answeredAt": "2026-10-12T09:00:41Z"
  }
}
```

The call returns as soon as you answer. If 30 seconds pass first, it returns `"status": "pending"`: call it again.

## Next

- [Wait for the answer](https://nibify.app/docs/wait-for-the-answer): Get the answer back by waiting for it with ask() or the long poll, or by a callback when your code cannot wait.
- [Concepts](https://nibify.app/docs/requests-and-notifications)
