> For the complete documentation index, see [llms.txt](https://docs.peakcommerce.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peakcommerce.com/developers/admin-api/admin-api-keys.md).

# API Keys

Create, list, rotate, and revoke tenant API keys. All of these endpoints require a key with the `admin` scope. This is also the only way to mint **narrow-scoped** keys — the Settings → API Keys screen creates coarse single-scope keys, while this API accepts any combination from the full scope vocabulary. See [Authentication](/developers/api-reference/authentication.md) for how the scopes expand.

Accepted `scopes` values:

* `read` — coarse: read everything the coarse v1 surface exposes.
* `commerce` — coarse: `read` plus the cart/checkout commerce surface.
* `admin` — coarse: everything, including every narrow scope below.
* `journeys:read` — read journeys.
* `journeys:write` — create and edit journeys (implies `journeys:read`).
* `journeys:publish` — publish, deactivate, or delete live journeys (implies `journeys:read`).
* `journeys:delete` — delete draft or archived journeys (implies `journeys:read`).
* `pages:read` — read pages.
* `pages:write` — create and edit pages (implies `pages:read`).
* `pages:publish` — publish or unpublish pages (implies `pages:read`).
* `pages:delete` — delete pages (implies `pages:read`).
* `components:read` — read components.
* `components:write` — create and edit components (implies `components:read`).
* `components:delete` — delete components (implies `components:read`).

Reserved (accepted on create, no endpoint requires them yet): `productsets:read`/`write`/`delete`, `rules:read`/`write`/`delete`, `catalog:read` (the one narrow read that coarse `read`/`commerce` keys expand to), and `catalog:write-native`.

## Endpoints

### `GET /api/v1/api-keys`

{% openapi src="<https://api.peakcommerce.app/api/v1/openapi.json>" path="/api-keys" method="get" %}
<https://api.peakcommerce.app/api/v1/openapi.json>
{% endopenapi %}

*Notes, examples, or caveats for `GET /api-keys` go here.*

### `POST /api/v1/api-keys`

{% openapi src="<https://api.peakcommerce.app/api/v1/openapi.json>" path="/api-keys" method="post" %}
<https://api.peakcommerce.app/api/v1/openapi.json>
{% endopenapi %}

`scopes` is an array drawn from the values listed in the overview above (defaults to `["read"]`). One key may hold several narrow scopes — e.g. `["journeys:read", "journeys:write", "pages:read"]`. Remember `publish` is never implied by `write`: grant it explicitly only to keys that should change what is live. Narrow-scoped keys appear on the Settings → API Keys screen but are edited through this API so their grants aren't collapsed by the screen's single-scope picker.

### `DELETE /api/v1/api-keys/{id}`

{% openapi src="<https://api.peakcommerce.app/api/v1/openapi.json>" path="/api-keys/{id}" method="delete" %}
<https://api.peakcommerce.app/api/v1/openapi.json>
{% endopenapi %}

*Notes, examples, or caveats for `DELETE /api-keys/{id}` go here.*

### `POST /api/v1/api-keys/{id}/rotate`

{% openapi src="<https://api.peakcommerce.app/api/v1/openapi.json>" path="/api-keys/{id}/rotate" method="post" %}
<https://api.peakcommerce.app/api/v1/openapi.json>
{% endopenapi %}

Rotation preserves the key's full scope set — including narrow scopes — so it is always safe for narrow-scoped keys.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.peakcommerce.com/developers/admin-api/admin-api-keys.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
