# API keys and connections (https://docs.palpable.technology/docs/developers/api-keys)

Palpable has three kinds of credential for your own code and AI apps, plus the secret that signs webhooks.

| | Looks like | Opens | Made in | Revoked in |
| --- | --- | --- | --- | --- |
| Project key | `pk_` + 64 hex characters | One project: the [project API](/docs/developers/project-api) and [saved readings](/docs/developers/readings) | The project's **Manage API** | The project's **Manage API** |
| Account key (legacy) | `pk_` + 48 hex characters | Every project its person owns, **read-only** | **Settings → Developer → API keys** | The same page |
| AI app connection | `pal_…`, held by the app | The [MCP server](/docs/developers/mcp), with PAL's reach | The app's sign-in, approved in the browser | **Settings → AI apps** |
| Webhook signing secret | `whsec_…` | Nothing. It only signs what Palpable sends you. | With the [webhook](/docs/developers/webhooks) | Delete the webhook |

## Project keys [#project-keys]

Use these for your own apps.

1. Open the project, open its settings (the gear), and choose **Manage API**.
2. Press **New key**. The key appears at the top of the list.
3. Press **Copy**. The key is shown once and can't be shown again. Keep it in your app's `.env` file, with the **Project ID** shown below the keys (**Copy ID**).
4. A new key can only view. To let it also set variables, work the project's parts and see its camera, switch on **Can control** on its row.

Rename a key by editing its name on its row. Make one key per app, so you can revoke one without touching the others.

A key opens only the project it was made in, and only while the person who made it can still open that project. If they lose access, every socket using the key closes with code `4401`. Keys made in the app don't expire.

**Manage API** lists each key with its first characters and whether an app is connected with it now.

**Revoke:** press **Revoke…** next to the key, then **Revoke**. Every socket using it closes at once with code `4401`, and new requests get `403`.

## Account keys (legacy) [#account-keys-legacy]

Account keys come from before project keys. They are listed in **Settings → Developer → API keys** as **Account key (legacy)**.

- An account key opens every project its person owns, on the project API and saved readings.
- **It connects read-only**, even if it was made with **Can control** on. Writes answer `FORBIDDEN`.
- A socket opened with one gets a `notice` with code `LEGACY_ACCOUNT_KEY`, once.

Replace an account key with a project key for each project.

**Revoke:** press the trash button next to the key, then **Delete**. Open sockets using it close at once.

## AI app connections [#ai-app-connections]

Each AI app you connect to the MCP server gets its own connection. **Settings → AI apps** lists them, with when each was connected and last used.

**Revoke:** tap the unlink button next to the app and confirm. The app stops working at once: every request checks the connection.

## Keeping credentials safe [#keeping-credentials-safe]

- Never paste a key into a prompt or a chat. Keep it in a `.env` file or a server's environment, and keep `.env` out of git.
- Give an app the least it needs. Leave **Can control** off for anything that only shows things.
- A web page may hold a view-only key: anyone who opens the page can read it, and it can only read.
- A key with **Can control** on belongs on your server. Anyone who has it can work the project's parts and watch its camera. The page asks your server, and your server asks Palpable.
- Revoke anything you no longer use.