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

# API keys

> How to create, use, rotate and revoke API and MCP keys.

An API key looks like `bkg_live_` followed by 48 hexadecimal characters. It is a secret: whoever has it queries as you
and uses your quota.

> [!WARNING]
>
> Never publish your key or commit it to a repository. If it leaks, revoke it right away and create a new one.

## Personal keys

Each person creates their own keys from the app. The same key works for the REST API (`/v1`) and for the MCP.

**1. Open your name's menu**

At [app.blockgence.com](https://app.blockgence.com), top right → **MCP…**.

**2. Create the key**

*Crear clave* (create key), with a name that says where you will use it (for example, «reporting server» or «Cursor on my
laptop»).

**3. Copy it right then**

The value is shown **only once**. After that only its prefix remains, so you can recognize it in the list.

You can have up to **5 personal keys** at a time. Use one per client or machine: if one is compromised, you revoke only
that one. Revocation is immediate and done from the same place.

Each key has your organization's plan and acts as you: it sees your cases and your labels, and what it queries is
counted against your account.

## Organization keys

An `admin` can create keys that do not belong to a person, for integrations: **Administración → keys de la organización** (administration → organization keys).

* They act as the organization and use its quota.
* They see the organization's cases and the ones it shares. Cases they create are born shared with the organization, so
  they do not become unreachable if the key is revoked.
* They can be **limited to resources** of the API (`scopes`): for example, only `trace` and `cases`. Outside them they
  return `403` with `error: "key_scope"`.
* They can be **read-only** (`read_only`), with the same rules as the `viewer` role.
* They stop working if revoked or if the organization is deactivated (`401`).

## Using the key

Send it with every request, in either of the two headers:

```bash Authorization: Bearer theme={null}
curl https://app.blockgence.com/v1/account \
  -H "Authorization: Bearer bkg_live_…"
```

```bash X-API-Key theme={null}
curl https://app.blockgence.com/v1/account \
  -H "X-API-Key: bkg_live_…"
```

Details in [Authentication](https://docs.blockgence.com/en/api/authentication.md).

## Apps connected through OAuth

If you connect Blockgence to an assistant that supports sign-in (for example, a claude.ai connector), you do not paste
any key: the app gets a key of yours that expires daily and renews itself. You see and disconnect them under
**MCP… → Aplicaciones conectadas** (connected apps); disconnecting revokes the connection and all its keys instantly. See
[Connect to the MCP](https://docs.blockgence.com/en/mcp/connect.md).


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