# Authentication

Create a workspace API key, choose its scopes, send it as a bearer token and confirm that it works.

Every request to the API carries a credential in the `Authorization` header. For scripts, services and CI that credential is a **workspace API key**, which a workspace admin creates in the web workspace. This page covers the credential types, how to create and revoke a key, what each scope reaches and how to confirm that a key works.

## Credential types

| Credential | Format | Used by | Notes |
| --- | --- | --- | --- |
| Workspace API key | `ak_` followed by 43 random characters | Your scripts and services, and MCP clients once MCP access is open | Scoped, revocable and bound to one workspace. The credential this documentation assumes. |
| Browser session | A short-lived token that the web workspace manages | People signed in at centerofagentic.com | Carries the person's own role. Some operations accept nothing else. Agent browser sessions are currently unsupported and refused. |
| Device token | `abt_` followed by random characters | The macOS [desktop app](https://centerofagentic.com/download), which is an alpha | Issued when a person connects the app from a signed-in browser. Not intended for integrations. |

## Create an API key

- Sign in to the web workspace as a workspace admin and open **Settings → API access**.

- In the **API keys** card, enter a **Name** that says where the key will run, for example `CI pipeline`. Names are cut to 80 characters, and an empty name is stored as `API key`.

- Under **Scopes**, tick `read`, `run` or `admin`. `read` is preselected, and a key created with nothing ticked gets `read`.

- Select **Create key**. The key appears once, under "Copy this key now — it will not be shown again." Select **Copy**, store the key in your secret manager, then select **Done**.

The key is shown once

The platform keeps a hash of the key and its first 12 characters, which identify it in the list. Nobody, including a workspace admin, can display the full key again. If a key is lost, revoke it and create a new one.

The card lists each active key with its name, its first 12 characters, its scopes, the creation date and when it was last used. Scopes are fixed when the key is created: to change them, create a new key and revoke the old one. Creating and revoking a key are both written to the workspace audit log.

Key management needs a workspace admin's own browser session. The key endpoints under `/api/tenant/api-keys` refuse every API key with a `403`, even one with the `admin` scope, so keys cannot be used to list or create other keys.

## Send the key

Send the key as a bearer token on every request.

```bash
export COA_API_KEY="ak_..."

curl -s https://centerofagentic.com/api/me \
  -H "Authorization: Bearer $COA_API_KEY"
```

A key belongs to exactly one workspace. The server reads the workspace from the key, so no path, query or body parameter selects one. The same header is used on the MCP endpoint, which is closed today for every workspace, because Center of Agentic has not turned on the platform-wide switch that it controls. Once that switch is on, a key reaches MCP tools only when a workspace admin has also turned MCP on for the workspace and the key holds a grant. The workspace switch and the grants cannot be used yet either; [Controlling MCP access](https://centerofagentic.com/docs/mcp/client-grants) documents the controls as they are built.

## Scopes

| Scope | Reaches | Includes |
| --- | --- | --- |
| `read` | `GET` operations that accept API keys, such as listing and reading agents, receipts, audit entries and metrics, and the few read-only `POST` operations that the reference marks `read`, such as exporting a skill. | Nothing else |
| `run` | Operations that start or steer agent work, such as `POST /api/run`, `POST /api/run/stream`, `POST /api/run/job` and conversation turns. | `read` |
| `admin` | Every other `POST`, `PATCH`, `PUT` and `DELETE` operation that accepts API keys, unless its reference entry names a lower scope. | `run` and `read` |

The default is strict on purpose. A `GET` needs `read`, and every other method needs `admin` unless the operation lowers it, as running an agent does with `run`. Each operation in the [REST API reference](https://centerofagentic.com/docs/api) names the lowest scope that reaches it. A request without the required scope is refused before the operation runs:

```json
{
  "error": "insufficient_scope",
  "detail": "This API key does not have the 'run' scope required for POST /api/run."
}
```

The `admin` scope is not the workspace admin role. A key always acts with member-level standing, so operations reserved for an admin's own session refuse every key.

## Operations that need a signed-in person

Some operations accept only a browser session and answer an API key with `403`. The main groups are:

- Managing API keys, MCP client grants and the workspace MCP switch (`admin_required` or `capability_denied`).

- Creating and editing agents, and moving them through their lifecycle (`full_session_required`).

- Admin-only workspace settings such as budgets, retention windows and rate-limit overrides (`admin_required`).

- Registering external agents and issuing their credentials (`capability_denied`).

- Features built around a named person, such as Idea Room and business cases (`capability_denied`; business cases answer `business_case_human_required`).

The codes in brackets are what a key with the `admin` scope receives. A key whose scope is too low for the operation can get `insufficient_scope` instead. [Availability](https://centerofagentic.com/docs/surfaces) shows what a key can reach, capability by capability.

## Expiry and revocation

- Keys created in Settings do not expire. They work until they are revoked.

- **Revoke** in the API keys card applies to the next request. The key then gets `401 unauthenticated`, and revocation cannot be undone.

- A key depends on the admin who created it. Every request re-checks that this person is still an active member of the workspace. If they leave the workspace, if their account is banned or locked at the sign-in provider, or if their access profile is set to **Suspended**, the key stops authenticating. If their access profile is set to **Business Owner**, the key is refused with `403 capability_denied`.

- Keys issued to a registered [external agent](https://centerofagentic.com/docs/api/external-agents) are a separate kind. They carry only `run`, expire after seven days and are meant only for the external agent operation routes. Ordinary workspace routes answer `403 external_credential_not_supported`.

## Check a key

`GET /api/me` accepts any valid key, whatever its scopes, and returns the identity and workspace the key resolves to.

```json
{
  "userId": "api-key:5d0e7c2a-41b8-4c6f-9f0a-2b7e6d1c3a90",
  "role": "member",
  "access": {
    "profile": "admin",
    "capabilities": ["legacy:app"],
    "human": false
  },
  "tenant": {
    "id": "9b2d4c1e-7a3f-4f0b-8c6d-2e5a1b0f9c33",
    "clerkOrgId": "org_2xExampleWorkspace",
    "slug": "example-workspace"
  },
  "accessView": {
    "v": 1,
    "profile": "admin",
    "human": false,
    "capabilities": ["legacy:app"],
    "orgRole": "member",
    "credentialKind": "api_key",
    "permissionRegistryVersion": 1,
    "authorizationRevision": 0,
    "computedAt": "2026-11-20T09:14:03.120Z"
  }
}
```

- `userId` is `api-key:` followed by the key's id. Receipts and audit entries for work done with the key carry this value.

- `role` is always `member` for a key, and `accessView.credentialKind` is `api_key`.

- `tenant.id` is the workspace id, `tenant.slug` its short name (it can be `null`) and `tenant.clerkOrgId` its id at the sign-in provider.

- `access` and `accessView` are display hints for the web workspace, not permissions. `accessView` can be `null`.

The response does not list the key's scopes. To confirm a scope, call an operation that needs it: a missing scope returns `403 insufficient_scope` and names the scope required. Two calls check a scope without side effects:

- For `run`, send `POST /api/run` with the body `{}`. A key with the scope gets `400 missing_prompt` and nothing runs.

- For `admin`, send `POST /api/tenant/openrouter-test`. It asks OpenRouter to validate the stored model key and calls no model. A key with the scope gets `200`, or `400 no_key` when the workspace has no model key.

A `401` means the key is unknown, revoked, expired or no longer backed by an active member. See [Errors](https://centerofagentic.com/docs/api/errors).

## Handling keys safely

- Create one key per integration and name it for where it runs. You can then revoke one without touching the others, and the last-used time shows which keys are idle.

- Grant the lowest scope that works: `read` for reporting and monitoring, `run` for triggering agents, `admin` only when an operation needs it.

- Keep keys in a secret manager or your CI secret store. Never commit them, put them in a URL or ship them in browser or mobile code.

- Call the API from a server or a shell. The API sends no cross-origin (CORS) headers, so browsers block calls to it from pages on other sites.

- Rotate by creating a new key, deploying it, then revoking the old one.

- For long-lived integrations, have the key created by an admin account that will stay in the workspace.

## Next steps

- [**Quickstart** Use the key: list agents, run one and read its receipt.](https://centerofagentic.com/docs/quickstart)

- [**Errors** What each refusal means and how a client should react.](https://centerofagentic.com/docs/api/errors)

- [**Automation and CI** Keys in pipelines: scopes, storage, rotation and retries.](https://centerofagentic.com/docs/guides/automation)

Source: https://centerofagentic.com/docs/authentication

## Related pages

- [desktop app](https://centerofagentic.com/download)
- [Controlling MCP access](https://centerofagentic.com/docs/mcp/client-grants)
- [REST API reference](https://centerofagentic.com/docs/api)
- [Availability](https://centerofagentic.com/docs/surfaces)
- [external agent](https://centerofagentic.com/docs/api/external-agents)
- [Errors](https://centerofagentic.com/docs/api/errors)
- [Quickstart Use the key: list agents, run one and read its receipt.](https://centerofagentic.com/docs/quickstart)
- [Errors What each refusal means and how a client should react.](https://centerofagentic.com/docs/api/errors)
- [Automation and CI Keys in pipelines: scopes, storage, rotation and retries.](https://centerofagentic.com/docs/guides/automation)
