One API key works for the REST API, the CLI, the SDK and the MCP server. API access comes with every plan.

## Create a key

1. Open **API Keys** in the sidebar.
2. Click **Create Key**.

![The API Keys page with the Create Key button framed](/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBmUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--da179fc572aae1d241bcd08e1fa12eab2cf66736/49-api-keys-desktop.png)

3. Give it a **Name** you will recognize, for example "CLI tool" or "CI/CD pipeline".
4. Under **Scopes**, choose what the key may do. Use **Select all** for full access.
5. Optionally set an **Expiration** date.
6. Click **Create**.

![The Create Key dialog with a name, scopes and an expiration date](/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBZZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--952546b5c7a0a72124aa7b6bcc09f6f4fb1d0531/49-create-key-dialog-desktop.png)

7. Copy the key straight away. It starts with `pq_live_` and is shown only once.

## Scopes

| Scope | Allows |
| --- | --- |
| `posts:read` | Read posts |
| `posts:write` | Create, update, publish and delete posts |
| `accounts:read` | Read connected accounts |
| `workspaces:read` | Read workspaces |
| `workspaces:write` | Create and update workspaces |
| `media:read` | Read media |
| `media:write` | Upload, move and delete media |

A request that needs a scope the key does not have is refused with `403`.

## Revoke a key

Click the trash icon next to the key and confirm **Revoke**. Anything using it loses access immediately.

## Rate limit

Requests are rate-limited per key. If you get a `429` response, wait for the time in the `Retry-After` header, then retry.

## Next

Start with the [API quick start](https://publishq.com/docs), or browse the [API reference](https://publishq.com/docs/posts/create-posts).
