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

# 管理者向けREST API

## 概要

Keeper管理者向けREST APIでは、エンタープライズ連携向けのスコープ付きトークンを発行できます。SIEM、CSPM、課金システム向けのデータの取得に利用します。

クライアント側でのデータ復号は不要で、顧客ホスト型のミドルウェアも必要ありません。

{% hint style="info" %}
より広範なプラットフォームや管理ワークフローには、[サービスモードREST API](/keeperpam/jp/commander-cli/service-mode-rest-api.md)をご利用ください。サービスモードでは、顧客ホスト型のミドルウェアサービスを通じて、コマンダーの多数の機能を利用できます。
{% endhint %}

### 要件 <a href="#prerequisites" id="prerequisites"></a>

* エンタープライズ**ルート管理者権限** (APIトークンの作成に必須)
* APIトークンの作成および管理用に[**Keeperコマンダー**](https://github.com/Keeper-Security/gitbook-jp-secrets-manager/tree/main/commander-cli/README.md)**CLI**がインストール済み

### コマンダー (CLI) でAPIトークンを管理する <a href="#manage-api-tokens-via-keeper-commander-cli" id="manage-api-tokens-via-keeper-commander-cli"></a>

コマンダーCLIには、`public-api-key` コマンドグループがあり、**list**、**generate**、**revoke**の各操作を実行できます。以下は、よく使用される操作の例です。

#### APIトークンの一覧表示 <a href="#list-api-tokens" id="list-api-tokens"></a>

```bash
# テーブル形式で表示
public-api-key list

# JSON形式でファイルに出力
public-api-key list --format json --output api_keys.json

# CSV形式でエクスポート
public-api-key list --format csv --output api_keys.csv
```

#### APIトークンの生成 <a href="#generate-an-api-token" id="generate-an-api-token"></a>

各トークンは特定の連携専用で、その連携に関連するAPIエンドポイントにのみアクセスできます。

* **SIEM:** SIEM / 監査イベントAPIへのアクセス許可
* **CSPM:** リスク管理APIへのアクセス許可
* **BILLING:** MSP課金APIへのアクセス許可

```bash
# 30日間有効のSIEMキー (読み取り)。SIEM / 監査イベントAPI向け
public-api-key generate --name "SIEM Integration" --integrations "SIEM:1" --expires 30d

# 30日間有効のCSPMキー (読み取り)。リスク管理API向け
public-api-key generate --name "CSPM Integration" --integrations "CSPM:1" --expires 30d

# 30日間有効の課金キー (読み取り)。MSP課金API向け
public-api-key generate --name "Billing Tool" --integrations "BILLING:1" --expires 30d

# 永続キー (有効期限なし) をJSON形式で出力
public-api-key generate --name "Permanent Tool" --integrations "SIEM:1" --expires never --format json --output backup_key.json

```

**連携とアクションコード**<br>

* **連携:** `SIEM` (SIEM / 監査イベントAPI)、`CSPM` (リスク管理API)、`BILLING` (MSP課金API)
* **アクション:** `1 = READ`、`2 = READ_WRITE`
* **有効期限のオプション:** `24h`、`7d`、`30d`、`1y`、`never`

{% hint style="info" icon="pencil-line" %}
例: `--integrations "CSPM:1"` はCSPM (読み取り) を意味し、リスク管理APIの呼び出しに使用します。
{% endhint %}

#### APIトークンの取り消し <a href="#revoke-an-api-token" id="revoke-an-api-token"></a>

```bash
# 対話式で確認して取り消し
public-api-key revoke <token_value>

# 強制的に取り消し (確認なし)
public-api-key revoke <token_value> --force
```

### セキュリティに関する注意事項 <a href="#security-notes" id="security-notes"></a>

* APIトークンはパスワードと同様に扱い、定期的にローテーションしてください。
* 必要最小限のロールと操作に権限を制限してください。
* 有効期限はできるだけ短く設定し、無期限は特別な自動化用途に限って使用してください。
* トークンは安全な場所 (例: Keeperボルト) に保管してください。

### API仕様 <a href="#api-specs" id="api-specs"></a>

* [ARAMイベント](/keeperpam/jp/commander-cli/admin-rest-api/aram-events.md)
* [リスク管理 (CSPM)](/keeperpam/jp/commander-cli/admin-rest-api/risk-management.md)
* [MSP課金](/keeperpam/jp/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://docs.keeper.io/keeperpam/jp/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.
