> For the complete documentation index, see [llms.txt](https://newdocs.keeper.io/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://newdocs.keeper.io/en/keeperpam/commander-cli/admin-rest-api.md).

# Admin REST API

## Overview

The Keeper Admin REST API provides scoped tokens for supported enterprise integrations. Use it to retrieve data for SIEM, CSPM, and billing systems.

The API performs these integrations without client-side data decryption. It does not require customer-hosted middleware.

{% hint style="info" %}
Use the [Service Mode REST API](/en/keeperpam/commander-cli/service-mode-rest-api.md) for broader platform or administration workflows. Service Mode exposes hundreds of Commander capabilities through a customer-hosted middleware service.
{% endhint %}

### Prerequisites

* Enterprise **Root Administrator** permissions (required to create API tokens).
* [**Keeper Commander**](/en/keeperpam/commander-cli/overview.md) **CLI** installed to create and manage API tokens.

### Manage API Tokens via Keeper Commander (CLI)

The **Commander** CLI includes a `public-api-key` command group with **list**, **generate**, and **revoke** operations. The snippets below summarize the most useful flows.

#### List API tokens

```bash
# Table view
public-api-key list

# JSON output to a file
public-api-key list --format json --output api_keys.json

# CSV export
public-api-key list --format csv --output api_keys.csv
```

#### Generate an API token

Each token is scoped to a specific integration, and grants access only to the API endpoints associated with that integration:

* `SIEM` — grants access to the SIEM / Audit Events API.
* `CSPM` — grants access to the Risk Management API.
* `BILLING` — grants access to the MSP Billing API.

```bash
# 30‑day SIEM key (Read) — for SIEM / Audit Events API
public-api-key generate --name "SIEM Integration" --integrations "SIEM:1" --expires 30d

# 30‑day CSPM key (Read) — for Risk Management API
public-api-key generate --name "CSPM Integration" --integrations "CSPM:1" --expires 30d

# 30‑day Billing key (Read) — for MSP Billing API
public-api-key generate --name "Billing Tool" --integrations "BILLING:1" --expires 30d

# Permanent key (never expires) with JSON output
public-api-key generate --name "Permanent Tool" --integrations "SIEM:1" --expires never --format json --output backup_key.json

```

**Integration and action codes**<br>

* Integrations: `SIEM` (SIEM / Audit Events API), `CSPM` (Risk Management API), `BILLING` (MSP Billing API)
* Actions: `1 = READ`, `2 = READ_WRITE`
* Expiration options: `24h`, `7d`, `30d`, `1y`, `never`

> Example: `--integrations "CSPM:1"` means CSPM (read), used for calling the Risk Management API.

#### Revoke an API token

```bash
# Interactive confirmation
public-api-key revoke <token_value>

# Force (no prompt)
public-api-key revoke <token_value> --force
```

### Security Notes

* Treat API tokens like passwords; rotate them on a schedule.
* Restrict permissions to the minimum required roles and actions.
* Prefer short expirations; use `never` only for special automation cases.
* Store tokens in a secure location (e.g., Keeper Vault).

### API Specs

* [ARAM Events](/en/keeperpam/commander-cli/admin-rest-api/aram-events.md)
* [Risk Management (CSPM)](/en/keeperpam/commander-cli/admin-rest-api/risk-management.md)
* [MSP Billing](/en/keeperpam/commander-cli/admin-rest-api/msp-billing.md)


---

# 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://newdocs.keeper.io/en/keeperpam/commander-cli/admin-rest-api.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.
