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

# API keys

> Create, scope, and revoke API keys for scripts and MCP clients.

API keys let scripts, tools, and [MCP clients](https://docs.puggy.dev/integrations/mcp.md) read your organization's sessions without signing in as you. Any member can create keys from **API Keys** in the sidebar.

## Create a key

1. Open **API Keys** and choose **Create key**.
2. Under **Name**, describe where the key is used, such as `Claude Desktop` or `CI`.
3. Under **Access**, choose its scopes (below). **Sessions → Read** is selected for you; at least one scope is required. Pick only what the tool needs.
4. Under **Expiry**, choose **Never**, **30 days**, **90 days**, or **Custom**. A key stops working at the end of the day it expires.
5. Check the summary in the footer (for example **1 scope · never expires**) and choose **Create key**.
6. Copy the key.

![The Create API key panel with Name, Access scopes for Sessions and Automation runs, and Expiry options Never, 30 days, 90 days, and Custom](https://mintcdn.com/anoclap/hpVVUQ1W_GXTEu9W/images/console/create-api-key-light.webp?fit=max\&auto=format\&n=hpVVUQ1W_GXTEu9W\&q=85\&s=d43d03f82f83cac891d9fc1f31c51bf5)

> [!WARNING]
>
> A key is shown once, when you create it. Store it somewhere safe, such as a password manager or your tool's secret storage. If you lose it, revoke it and create a new one.

Keys start with `pggy_live_`.

## Scopes

| Scope | Allows |
| - | - |
| `sessions:read` | List, view, and search sessions. This is all an MCP client needs to read evidence. |
| `sessions:write` | Create and modify sessions. |
| `automation:read` | View automation runs and retests. [Early access](https://docs.puggy.dev/early-access.md). |
| `automation:write` | Start and cancel automation runs and retests. [Early access](https://docs.puggy.dev/early-access.md). |

The scopes you can grant are limited by your role.

## Manage keys

![The API Keys page: Active keys, Revoked or expired, and Last request at the top, then the Keys and Connect an MCP client tabs and a table of keys with scopes, last used, expiry, and status](https://mintcdn.com/anoclap/hpVVUQ1W_GXTEu9W/images/console/api-keys-light.webp?fit=max\&auto=format\&n=hpVVUQ1W_GXTEu9W\&q=85\&s=7d63301ec0df99ec358f3f70aa19e5ac)

The **Keys** tab lists the keys you created, with their scopes, when they were last used, when they expire, and their status: **Active**, **Expired**, or **Revoked**. A revoked key's name is struck through. The cards at the top show how many keys are **Active**, how many are **Revoked or expired**, and when the **Last request** was made.

From a key's **⋯** menu you can:

* See its access log.
* **Revoke** it so it stops working immediately. It stays in the list, marked revoked.
* Delete it permanently.

You can revoke and delete only keys you created.

## Use a key

Send the key in the `X-Puggy-API-Key` header. To connect an AI tool, open the **Connect an MCP client** tab on the same page. See [MCP server](https://docs.puggy.dev/integrations/mcp.md).


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