The
apikeys client methods are currently in BETA. The API may change without notice. A one-time warning is emitted on first use.Create issues user keys; CreateServiceKey issues service keys.
List API Keys
List returns a paginated list of API keys. Defaults to a page size of 50.
Signature:
Create a User API Key
Create issues a POST to create a new user API key and returns the created key, including the secret token. The secret is only returned at creation time.
Signature:
Create a Service API Key
CreateServiceKey creates a new service API key whose bot user is bound to one or more organizations, each containing one or more spaces. At least one OrgBinding — with a non-empty OrgID and at least one SpaceBinding — is required. Role assignments are optional: when a role is left zero, the server applies its default role at that scope. Build role assignments with the AssignPredefinedOrgRole/AssignCustomOrgRole, AssignPredefinedSpaceRole/AssignCustomSpaceRole, and AssignPredefinedAccountRole/AssignCustomAccountRole helpers.
Signature:
Refresh an API Key
Refresh rotates the secret on an existing API key and returns the new key value. ExpiresAt is optional; when zero, the refreshed key has no expiration.
Signature:
Revoke an API Key
Revoke sets an API key’s status to revoked by ID. The key stops working immediately; revoking an already-revoked key is a no-op and still succeeds.
Signature: