Skip to main content
PATCH
/
auth
/
api-keys
/
{key_id}
Update Api Key
curl --request PATCH \
  --url http://localhost:8000/auth/api-keys/{key_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Production Integration Key",
  "scopes": [
    "documents:read",
    "documents:write"
  ]
}
'
{
  "created_at": "2024-01-01T00:00:00Z",
  "id": "cc0e8400-e29b-41d4-a716-446655440000",
  "is_active": true,
  "key_prefix": "fac_abc",
  "last_used_at": "2024-06-01T12:00:00Z",
  "name": "Production Integration Key",
  "scopes": [
    "documents:read",
    "documents:write"
  ]
}

Headers

authorization
string | null
x-api-key
string | null
x-tenant-id
string | null

Path Parameters

key_id
string<uuid>
required

Cookies

factio_access_token
string | null

Body

application/json

Schema for updating an API key (partial update).

name
string | null

Human-readable name for the API key

Maximum string length: 255
scopes
string[] | null

List of scopes/permissions for this API key

Response

Successful Response

Schema for API key response (key_hash is never exposed).

id
string<uuid>
required
name
string
required
key_prefix
string
required
scopes
string[] | null
required
is_active
boolean
required
created_at
string<date-time>
required
last_used_at
string<date-time> | null
required