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

# Authentication

> Sign in, send the token, pick a workspace.

## Sign in

1. `POST /sessions` with the user's email. A magic sign-in link is emailed to them.
2. `POST /sessions/magic` with the token from that link. The response contains an **auth token** and a **refresh token**.
3. When the auth token expires, `POST /sessions/refresh` with the refresh token to get a new pair.

## Send the token

Pass the auth token on every request:

```http theme={null}
Authorization: Bearer <auth_token>
```

A missing, expired or signed-out token returns `401 Unauthorized`.

## Pick a workspace

Most endpoints work inside one workspace. Send its id in a header:

```http theme={null}
X-Workspace-ID: <workspace_id>
```


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