Create a workspace-managed API key

Creates a WORKSPACE, STACK or assigned-USER workspace-managed key through the existing key lifecycle. Scope and target are immutable. Configured expiration is inclusive through that UTC day. Initial stack permissions receive the requested default stack levels. Returns a one-time token and Location of token-free metadata. Credentials are excluded from logs and replay storage; a keyed repeat returns idempotency_outcome_unknown (409) without re-executing while retained. Inspect inventory before deliberately recovering an uncertain result. User-owned self-service keys are not provisioned here. Requires workspace-level API access management permission.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Request body to create a workspace-managed key with explicit scope and configured permissions.

string
required
length between 0 and 4096

Display name, unique among workspace-managed keys.

string | null

Optional description; null clears it.

date | null

Last valid day, inclusive, in UTC. Null means no configured expiration.

string
enum
required

What the API key reaches. A WORKSPACE key reaches the workspace's stacks, a STACK key only the stack in stack_id, and a USER key is assigned to the member in member_id. User-owned keys use the member's current permissions; workspace-managed keys assigned to a user retain their configured permissions.

Allowed:
string | null
^stack_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

Public id that is created from the type prefix of the corresponding resource and its UUID. I.e : For a stack, a valid value would be : stack_0197c8f2-5a6b-7cde-8f12-3456789abcde

string | null
^wsu_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

Public id composed of the resource type prefix and its UUID.

workspace_permissions
object
required

Request body to replace all fourteen configured workspace permission levels of an active workspace-managed WORKSPACE or USER key. Every level is required. Billing subscription and workspaces must remain NO_ACCESS.

default_stack_permissions
object
required

Request body to replace all nine configured default stack permission levels of an active workspace-managed API key. Every level is required; workspace permissions, scope and stack permissions remain unchanged.

stack_permission_stack_ids
array of strings | null, unique

Optional stacks that get their own stack permissions for WORKSPACE scope, starting with the default stack levels. Omitted or null creates none; these are permission exceptions, not a replacement for scope.

stack_permission_stack_ids
Headers
string
length between 1 and 255

Optional unique key for best-effort duplicate suppression of this one-time response. The original successful response is returned to the caller but never retained in API log bodies or Redis replay results. Only an unresolved reservation is retained for 24 hours by default; a matching retry returns 409 idempotency_outcome_unknown without repeating the operation or revealing its secret. A concurrent request returns 409 idempotency_key_in_use; a changed request returns 422 idempotency_key_mismatch. An unavailable reservation store returns 503 before execution. A 4xx rejection releases its reservation; interruption after execution or loss of the success response requires inspection and a deliberate new operation. Redis expiry/eviction or explicit server-side disabling removes protection; this is not durable exactly-once execution. Use the target GET to inspect current metadata and obtain its validator, then a new key only when intentionally rotating again.

string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json