Skip to main content
PATCH
Update API Key Scopes
Each scope grants a role on a specific resource:

Valid Roles by Resource Type

The executor role is legacy and is normalized to viewer internally, but still grants run permission.

Path Parameters

api_key_id
string
required

Body

application/json

Request model for updating API key scopes.

scopes
ApiKeyScope · object[]
required

Updated list of resource scopes.

Minimum array length: 1

Response

Successful Response

Response model for API key (excludes sensitive data).

created_by
string
required

member_id of the creator.

id
string
required

The unique identifier of the API key.

key_prefix
string
required

Display prefix (e.g., 'sk_tu_abc...').

name
string
required

Human-readable name for the API key.

org_id
string
required

WorkOS organization ID.

created_at
string<date-time> | null

When the key was created.

description
string | null

Optional description.

last_used_at
string<date-time> | null

When the key was last used.

revoked_at
string<date-time> | null

When the key was revoked (soft delete).

scopes
ApiKeyScope · object[]

List of resource scopes for this API key.

sharing_group_ids
string[]

Groups that receive default admin grants on resources created by this key.