Visibility: public · internal ( OpenAPI Custom Extension: x-visibility )
Generate a new API key scoped to a level in the resource hierarchy (organization, or project). The key’s effective privileges are evaluated dynamically at token-mint time — they are always the intersection of the key’s role list (if set) and the creating user’s current roles within the key’s scope boundary. This means the key automatically reflects role changes on the parent user: if the user gains or loses roles, the key’s effective access adjusts accordingly. Disabling or deleting the parent user effectively neutralizes all their keys.
The scope level may be constrained by org-level policy (e.g., an organization may prohibit organization-scoped keys to enforce least-privilege).
The secret value is returned only in this response and cannot be retrieved again. Store it securely.
If expiresAt is omitted, the organization’s default API key lifetime is applied. The value cannot exceed the org-level maximum.
Bearer token authentication using OAuth2/OIDC tokens
Human-readable display name.
1 - 255"CI/CD Pipeline Key"
The hierarchy level this key is scoped to. Subject to org-level policy (e.g., org may prohibit org-scoped keys).
organization, project "project"
Resource identifier for the scope target. Must be a resource the caller has access to:
"proj-abc123"
Optional description of the key's intended use.
1024Optional roles to scope down the key's privileges. Each must be a valid org-defined role slug the caller holds. If omitted, inherits the caller's full privileges within the key's scope boundary.
["viewer", "member"]Requested expiration timestamp. Cannot exceed the org-level maximum key lifetime. Defaults to org default if omitted.
API key created. Secret is included in this response only.
Full API key metadata plus the secret value. The secret is only returned at creation and rotation time.
Server-generated UUID. Immutable.
Human-readable display name for the API key.
1 - 255"CI/CD Pipeline Key"
The level in the resource hierarchy this key is scoped to. Determines the resource boundary for all operations performed with this key:
Combined with scopeId, this defines the key's blast radius. Subject to org-level policy constraints (e.g., an org may prohibit organization-scoped keys).
organization, project "project"
Resource identifier corresponding to the scope level:
"proj-abc123"
Current key status.
active, disabled, expired "active"
User ID of the principal who created this key. The key's privilege ceiling is derived from this user.
"user-xyz789"
Timestamp when the key was created.
Opaque, prefixed API key secret. Store securely — this value cannot be retrieved again.
"plt_sk_apikey-j2k3l4_a1b2c3d4e5f6..."
Server-defined URL for this resource.
"/v1/iam/api-keys/apikey-j2k3l4"
Optional description of the key's intended use.
1024Optional role bindings that act as a privilege ceiling for the key. Effective privileges are evaluated at token-mint time, not at key creation time:
Each role must be a valid org-defined role slug. At creation and update time, every listed role must be held by the caller; however, the key remains valid if the user later loses a listed role (it simply has no effect until the user regains it).
Effective privileges are always bounded by the key's scope (organization, or project).
["viewer", "member"]Key expiration timestamp. If not set at creation, defaults to the organization's configured maximum API key lifetime. Cannot exceed the org-level maximum.
Timestamp of the last metadata change (name, roles, status).
Timestamp of the most recent secret rotation. Null if never rotated.
Timestamp of the last successful token mint using this key.
IP address from which the key was last used.
"203.0.113.42"