---
title: "Create scoped agent API key"
method: POST
path: "/v1/admin/agent-keys"
tags: ["Operations"]
---

# Create scoped agent API key

`POST /v1/admin/agent-keys`

## Request

- Base URL: `https://loppee.com`
- URL: `https://loppee.com/v1/admin/agent-keys`
- Auth: HTTP bearer

Creates one scoped agent API key and returns the raw key once. Human AAL2 admin only; admin-agent keys cannot issue credentials.

## Request body

- CreateAgentApiKeyRequest
  - `account_id` string, required
  - `label` string
  - `allowed_actions` string[]
  - `allowed_business_ids` string[]
  - `monthly_quota` number
  - `rate_limit_per_minute` number
  - `notes` string

## Response `200`

CreateAgentApiKeyResponse

- CreateAgentApiKeyResponse
  - `status` 'created', required
  - `created_by` string, required
  - `key` object, required
    - `id` string, nullable, required
    - `account_id` string, required
    - `label` string, required
    - `key_prefix` string, required
    - `key_last_four` string, required
    - `allowed_actions` string[], required
    - `allowed_business_ids` string[], required
    - `monthly_quota` number, required
    - `rate_limit_per_minute` number, required
    - `created_at` string, required
  - `raw_key` string, required
  - `one_time_display` unknown, required

## Other responses

- `400`: ErrorResponse
- `401`: ErrorResponse
- `403`: ErrorResponse
- `429`: RateLimitError
- `default`: ErrorResponse

---

[API](https://skmtc.dev/loppee/apis/loppee-business-registry-api-for-external-agents.md) · [All operations](https://skmtc.dev/loppee/apis/loppee-business-registry-api-for-external-agents/llms.txt) · [OpenAPI document](https://skmtc.dev/loppee/apis/loppee-business-registry-api-for-external-agents/revisions/37285f7cddcd?raw)
