# Getting started

The HiringBranch public API gives your systems the results of the candidates in your workspace: their
scores, ranking, review decisions and activity. This page takes you from nothing to your first page of
results.

## Before you start

- **API access is on for your workspace.** HiringBranch turns it on. If you don't see **API keys** in the
  dashboard's menu, ask your HiringBranch contact.
- **You are an admin of the workspace.** Only admins see the API keys page.

## 1. Create an API key

1. In the dashboard, open **API keys** and select **Create key**.
2. Give the key a name that says which system uses it, such as `Workday sync`.
3. Pick when it expires: 7 days, 30 days, 90 days, 1 year, a date of your choice, or never. 90 days is
   the default. Keys that never expire are harder to keep safe, so prefer a date.
4. Select **Create key**, then **Copy key**, and store the key where your system keeps its secrets.

The key is shown once. HiringBranch keeps only a fingerprint of it, so if you lose it, create a new one or
rotate this one.

A key starts with `hbk_` and reads your workspace only.

## 2. Make your first call

Send the key in the `Authorization` header:

```bash
curl "https://pub.hiringbranch.com/v1/results?limit=5" \
  -H "Authorization: Bearer hbk_your_key"
```

The answer is a page of results, oldest change first:

```json
{
  "data": [
    {
      "id": "8c41aa10-5a2b-4c4e-9d0e-2f6c1b7ad2f0",
      "status": "COMPLETED",
      "candidate": { "email": "ana.silva@example.com", "firstName": "Ana", "lastName": "Silva" },
      "role": { "name": "Bilingual Customer Support", "status": "ACTIVE" },
      "overall": { "score": 78, "tier": "PASS", "cefr": "B2", "percentile": 71 }
    }
  ],
  "nextCursor": "eyJsaW1pdCI6IjUiLCJhZnRlcklkIjoiOGM0MWFhMTAtNWEyYi00YzRlLTlkMGUtMmY2YzFiN2FkMmYwIiwidXBkYXRlZEFmdGVyIjoiMjAyNi0xMC0yMlQwOToxNTowMy4xMjM0NTYwWiJ9"
}
```

Each result carries more fields than shown here. The [API reference](/api) lists them all.

## 3. Get the next page

Send `nextCursor` back as `cursor`, and nothing else:

```bash
curl "https://pub.hiringbranch.com/v1/results?cursor=eyJsaW1pdCI6IjUiLCJhZnRlcklkIjoiOGM0MWFhMTAtNWEyYi00YzRlLTlkMGUtMmY2YzFiN2FkMmYwIiwidXBkYXRlZEFmdGVyIjoiMjAyNi0xMC0yMlQwOToxNTowMy4xMjM0NTYwWiJ9" \
  -H "Authorization: Bearer hbk_your_key"
```

When `nextCursor` is `null`, you have every result. [Paging and sync](/paging-and-sync) explains how to
keep your copy up to date from there.

## Next

- [Authentication](/authentication): how keys work, and how to rotate or revoke one.
- [Paging and sync](/paging-and-sync): filters, cursors and staying in sync.
- [Errors](/errors): every error and what to do about it.
- [Rate limits](/rate-limits): how many calls you can make.
