# Quickstart

## 1. Get a credential

Sign in to the customer portal and open **API**. You need one of these (see [Authentication](/authentication)):

- your account's **live key** (`rp_…`), shown once when the account is made or the key is rotated (**Delivery →
  Rotate key**), or
- a **named API key** (`rpk_…`) made under **API → API keys**: best for an integration, because you can limit it to the
  data it needs and revoke it on its own, or
- the **sandbox key** (`rpsb_…`) to try things against the delayed public sample.

Keep keys on your server. Never put a live or named key in a web page or a mobile app bundle.

## 2. Set two variables

The API lives under `/api/v1` on your RiskPilot address: the same origin as the customer portal (the portal's **API**
page shows a ready-made curl command with it).

```bash
export RISKPILOT_URL="https://your-riskpilot-host"   # no trailing slash
export RISKPILOT_KEY="rpk_…"                         # or rp_… / rpsb_…
```

## 3. List the newest ACTION signals

<CodeTabs>

```bash title="curl"
curl -sS "$RISKPILOT_URL/api/v1/customer/signals?classes=ACTION&limit=10" \
  -H "Authorization: Bearer $RISKPILOT_KEY"
```

```js title="JavaScript (Node 18+)"
const base = process.env.RISKPILOT_URL;
const key = process.env.RISKPILOT_KEY;

const res = await fetch(`${base}/api/v1/customer/signals?classes=ACTION&limit=10`, {
  headers: { Authorization: `Bearer ${key}` },
});
if (!res.ok) {
  const problem = await res.json().catch(() => ({}));
  throw new Error(`${res.status} ${problem.code ?? ""} ${problem.error ?? res.statusText}`);
}
const page = await res.json();
for (const signal of page.items) {
  console.log(signal.filedAt, signal.ticker ?? signal.issuerName, signal.className, signal.score, signal.headline);
}
console.log("requests left today:", res.headers.get("X-Quota-Remaining-Day") ?? "no daily quota");
```

```python title="Python (requests)"
import os
import requests

base = os.environ["RISKPILOT_URL"]
key = os.environ["RISKPILOT_KEY"]

res = requests.get(
    f"{base}/api/v1/customer/signals",
    params={"classes": "ACTION", "limit": 10},
    headers={"Authorization": f"Bearer {key}"},
    timeout=15,
)
if not res.ok:
    problem = res.json() if res.headers.get("content-type", "").startswith("application/json") else {}
    raise RuntimeError(f"{res.status_code} {problem.get('code', '')} {problem.get('error', res.reason)}")
page = res.json()
for signal in page["items"]:
    print(signal["filedAt"], signal["ticker"] or signal["issuerName"], signal["className"], signal["score"], signal["headline"])
print("requests left today:", res.headers.get("X-Quota-Remaining-Day", "no daily quota"))
```

</CodeTabs>

The answer is one page of signals:

```json
{
  "items": [
    {
      "filingId": "0001437749-26-031545",
      "filedAt": "2026-11-06T21:05:12.000Z",
      "ticker": "ACME",
      "issuerName": "Acme Corp",
      "issuerId": "0000123456",
      "family": "8-K",
      "className": "ACTION",
      "score": 87,
      "label": "PENDING",
      "headline": "Acme agrees to be acquired for $42 per share in cash"
    }
  ],
  "total": 1,
  "limit": 10,
  "offset": 0
}
```

With the sandbox key the same call answers from the delayed sample and adds `"sandbox": true` and `"delayHours": 24`.

## 4. Open one signal and its company

```bash
curl -sS "$RISKPILOT_URL/api/v1/customer/signals/0001437749-26-031545" \
  -H "Authorization: Bearer $RISKPILOT_KEY"

curl -sS "$RISKPILOT_URL/api/v1/customer/companies/0000123456?limit=5" \
  -H "Authorization: Bearer $RISKPILOT_KEY"
```

A signal or company outside your package answers `404`, exactly as if it did not exist.

## 5. Get new signals without polling

- [Webhooks](/webhooks): RiskPilot POSTs each new signal to your HTTPS endpoint, signed.
- [Live stream](/stream): keep a WebSocket open and receive each new signal within about a second.

## What can go wrong

| You get | Because | Do |
| --- | --- | --- |
| `401` | The key is wrong, revoked or rotated | Check the key; make a new one |
| `402` | The subscription does not allow access now (`code` says why) | Open **Billing** in the portal |
| `403 key_scope` | A named key without the scope this route needs | Add the scope (make a new key) or use another key |
| `403 sandbox_read_only` | The sandbox key on a route other than signals | Use a live or named key |
| `429` | Per-minute limit or a quota | Wait `Retry-After` seconds |

All errors and limits: [Quotas, limits and errors](/limits-and-errors).
