v1

latestOpenAPI 3.1.02026-07-13250151.3 KB
api-keys

Create a new API key for a workspace the user owns/admins; returns the secret key exactly once.

Cookie session only — never inspects Authorization header; pm_live_ Bearer NOT accepted. Caller must be admin or owner of workspaceId (workspace_members.role). Requested scopes are capped to deriveScopesFromRole(role); exceeding them is a 403. Billing-gated on the api_keys metric (403 with plan_limit_reached body). The secret 'key' (format pm_live_<64 hex chars>) is returned ONLY in this 201 response and can never be retrieved again — afterward only keyPrefix is exposed.

post/api/v1/api-keys

Request body

namestring required

Human label for the key.

workspaceIdstring required

Workspace the key belongs to; caller must be admin/owner.

scopesstring[]

Subset of read | write | admin. Defaults to ['read','write']. Must be non-empty and within the scopes the caller's role permits.

Response

Key created; secret 'key' returned once.

object required