Skip to main content
POST
Create API key for service user

Permissions

Requires a service user with the ManageAccountServiceUsers permission at the enterprise level.

Authorizations

Authorization
string
header
required

Service User credential (prefix: cog_)

Path Parameters

service_user_id
string
required

Service user ID (prefix: service-user-)

Example:

"service-user-abc123def456"

Body

application/json
name
string
required
Required string length: 1 - 256
expires_at
integer | null

Optional expiration as a UNIX timestamp in seconds. Must be in the future if provided.

Response

Successful Response

Shared response model for API key creation/rotation (includes one-time token).

api_key_id
string
required
api_key_name
string
required
token
string
required

The raw API token. This is only shown once at creation/rotation time.