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

# Authentication

Circularo API v2 accepts exactly one credential: an API key, sent in the `Authorization` header. There are no login calls to make and no session to keep alive.

## What changes

| | API v1 | API v2 |
| - | - | - |
| Where the credential goes | `?token=<value>` in the query string | `Authorization: Bearer <api key>` header |
| What the credential can be | a session token from `POST /login`, or an API key | an API key |
| Obtaining it | `POST /login` with a username and password for a session token, then `POST /api/key` for an API key | created in the web app, then managed through `/api-keys` |
| Checking who you are | `GET /login` | `GET /me` |
| Ending a session | `GET /logout` | nothing to end; revoke the key instead |

Your existing API key keeps working — move it from the `token` query parameter into the `Authorization` header and change the base URL. Since release 26.1, API v1 accepts the key in the `Authorization` header too, so you can move it there before you switch.

**Before**

```http theme={null}
GET /api/v1/documents/Vt7RfKq2LmXe5ZwGyB4N?token=YOUR_API_KEY
```

**After**

```http theme={null}
GET /api/v2/documents/Vt7RfKq2LmXe5ZwGyB4N
Authorization: Bearer YOUR_API_KEY
```

The base URL is your environment's, plus `/api/v2`. For the sandbox, for example, it is `https://sandbox.circularo.com/api/v2`.

The header is also the better home for a secret: URLs tend to be written to logs more readily than headers are, so it is good hygiene to keep credentials out of them.

## No login endpoints

`POST /login`, `POST /login/unlock`, `POST /login/recovery` and `GET /logout` have no counterpart, and neither does any other way of exchanging a username and password for a token. An integration authenticates as itself, with a long-lived key, and never as a person typing a password.

Create your first key in the web app — [Get your first API key](https://developers.circularo.com/introduction/get-your-first-api-key.md) walks through it. From then on the API can create and revoke further keys itself; it just cannot mint the first one.

## Managing keys

```http theme={null}
POST /api/v2/api-keys
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "description": "Billing system, production"
}
```

The response is the only time you see the secret, so store it when you create it:

```text wrap theme={null}
HTTP/2 201

{
  "id": "Vp8kZ5UBq1nLxY2cF3aD",
  "apiKey": "cir_Vp8kZ5UBq1nLxY2cF3aD.WBv2Jc8lXo3pQ9rT5uYhZaEwSdFgHjKmNbVcXzLqRt0"
}
```

Three differences worth noting if you automate key rotation:

* **The secret is in `apiKey`, not `id`.** `POST /api/key` returned the key itself as `id`; `POST /api-keys` returns it as `apiKey`, and `id` is now the key's non-secret identifier.
* **Revoking takes the `id`.** `DELETE /api-keys/{id}` accepts only the identifier from the create response or from `GET /api-keys`; the full key value is refused.
* **`GET /api-keys` shows no part of the secret.** Each entry carries its `id`, `description`, `createdAt` and `lastUsedAt` — give every key a `description`, since that is how you tell keys apart.

## Checking the credential and the account

`GET /me` replaces `GET /login`. Besides identifying the account, it reports what the account is allowed to do — which signature and seal providers are available, whether it may share outside the organization, the signatures configured for it, its saved document views — so you can check a capability before you rely on it rather than discovering it in a `403`.

## What a rejected credential looks like

| Situation | Status |
| - | - |
| No credential, or an empty one | `401` |
| A revoked, unknown, malformed or lapsed key | `401` |
| A valid credential of the wrong kind (a session token) | `403` |
| The account has not been activated yet | `428` |
| The account is suspended | `403` |
| The account's subscription is no longer active | `402` |

The `428` is worth handling deliberately: it means a person has to activate the account before the integration can continue.

To cut an integration off, suspend its account or revoke the key.


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