Skip to main content
PATCH
Update an API key

Authorizations

Authorization
string
header
required

JWT Bearer token authentication. Include your access token in the Authorization header as: Bearer YOUR_ACCESS_TOKEN

Example:

Path Parameters

service_account_id
string<uuid>
required

UUID of the service account

api_key_id
string<uuid>
required

UUID of the API key to update

Body

application/json

Request payload for updating an API key.

description
string | null

Updated description for this API key.

Example:

"Updated API key description"

name
string | null

Updated name for this API key.

Maximum string length: 255
Example:

"Updated API Key"

Response

API key updated successfully

Response model for API key operations.

created_at
string<date-time>
required
id
string<uuid>
required
modified_by
string
required
name
string
required

Human-readable name for this API key.

Maximum string length: 255
Example:

"API Key"

organization_id
string<uuid>
required

UUID of the organization this API key belongs to.

Example:

"550e8400-e29b-41d4-a716-446655440000"

token_prefix
string
required

Prefix of the authentication token for display purposes. Full token is only shown once during creation.

Maximum string length: 40
Example:

"saf_org_550e8400_abc123"

updated_at
string<date-time>
required
description
string | null

Optional description explaining the purpose and usage of this API key.

Example:

"API key for external integrations"

scopes
enum<string>[] | null

Surfaces this API key may call. 'mcp' allows the MCP server at /mcp/v2; 'api' allows the REST API. The legacy MCP server at /mcp exposes REST operations as tools, so it needs both. NULL (the default) allows every surface. A call outside the key's scopes gets 403 with error code 'api_key_scope': an MCP-only key (['mcp']) on any REST path or on /mcp.

A surface an API key may call.

Available options:
mcp,
api
Example:
service_account_id
string<uuid> | null

UUID of the service account this API key belongs to. NULL for user keys.

Example:

"550e8400-e29b-41d4-a716-446655440000"

user_id
string<uuid> | null

UUID of the user this API key belongs to. NULL for service account keys.

Example:

"550e8400-e29b-41d4-a716-446655440000"