# Create API key

**POST** `/service-accounts/{id}/api-keys`

Creates an API key for a service account. Store the plaintext key from this response because it is shown once.

Authentication: bearerAuth
Required scopes: `api_key:create`
Allowed roles: `owner`, `admin`
Authorization: Create an API key.

## Parameters

- `id` (path string, required)

## Request body

- `application/json`: `CreateAPIKeyRequest` required.

## Responses

- `200`: API key created (plaintext key shown once)
- `default`: Error
