> ## Documentation Index
> Fetch the complete documentation index at: https://solidroad.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Send your API key as a bearer token. Its scopes control what it can read.

## Send your key

Send your API key in the `Authorization` header of every request:

```bash theme={null}
curl https://api.solidroad.com/v2/people \
  -H "Authorization: Bearer $SOLIDROAD_API_KEY"
```

The API keys that you use for version 1 also work for version 2. You do not need a new key.

## Get a key

1. Sign in to your Solidroad workspace.
2. Open [Settings](https://app.solidroad.com/admin/dashboard/settings) and find the **API keys** section.
3. Create a key for your integration.

To create a key, you need permission to manage settings.

A key belongs to its workspace. It reads that workspace's data and no other.

> [!WARNING]
>
> Keep your API key secret. Do not put it in version control, in a URL or in code that runs in a browser.

## Scopes

Most endpoints need one scope, and a key reads an endpoint only if it has that scope. `GET /v2/deletions` needs any one of `assignments:read`, `attempts:read`, `people:read` and `simulations:read`, and lists only the kinds of record that the key's scopes can read.

| Scope | Endpoints |
| - | - |
| `assignments:read` | `GET /v2/assignments`, `GET /v2/assignments/{id}`, `GET /v2/assignments/{id}/enrollments`, `GET /v2/enrollments` |
| `attempts:read` | `GET /v2/attempts`, `GET /v2/attempts/{id}`, `GET /v2/attempts/{id}/transcript` |
| `people:read` | `GET /v2/people`, `GET /v2/people/{id}` |
| `groups:read` | `GET /v2/groups`, `GET /v2/groups/{id}`, `GET /v2/groups/{id}/members`, `GET /v2/groups/{id}/leads` |
| `scorecards:read` | `GET /v2/scorecards`, `GET /v2/scorecards/{id}`, `GET /v2/scorecards/{id}/versions`, `GET /v2/scorecards/{id}/versions/{versionId}` |
| `simulations:read` | `GET /v2/simulations`, `GET /v2/simulations/{id}`, `GET /v2/simulations/{id}/versions` |

Every key has these scopes today, including keys made before scopes existed.

## Authentication errors

| Status | `code` | Cause | What to do |
| - | - | - | - |
| 401 | `unauthorized` | The `Authorization` header is missing, or the key is not valid or was revoked. | Check the key, or create a new one. |
| 403 | `insufficient_scope` | The key does not have the scope that the endpoint needs. `detail` names the scope. | Use a key that has the scope. |
| 403 | `forbidden` | Your workspace cannot use this feature or plan. | Contact your Solidroad admin. |

```json theme={null}
{
  "type": "https://docs.solidroad.com/api/errors/unauthorized",
  "title": "The API key is missing or not valid",
  "status": 401,
  "detail": "Send your API key as `Authorization: Bearer <key>`.",
  "instance": "abc12-1793279628409-14eba17502cd",
  "code": "unauthorized"
}
```

All error responses have this shape. Read [Errors](https://solidroad.mintlify.site/api-reference/v2/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.