v1

latestOpenAPI 3.1.0MIT2026-07-173438118.7 KB
API Keys

Update an API key

Errors

Returns error if API key not found, access denied, or database update error

put/api/api-keys/{api_key_id}

Path parameters

api_key_idstring uuid required

UUID of the API key to update

Request body

expiresAtstring date-time nullable

Update the expiration date

isActiveboolean nullable

Change the active status of the key

namestring nullable

New name for the API key (optional)

permissionsstring[] nullable

Updated permissions array (optional)

Example request

{
  "expiresAt": "2024-06-01T00:00:00Z",
  "isActive": false,
  "name": "Updated API Key Name",
  "permissions": [
    "read:posts"
  ]
}

Response

API key updated successfully

createdAtstring date-time nullable

When this API key was originally created

expiresAtstring date-time nullable

Expiration timestamp after which key becomes invalid

idstring uuid required

Unique identifier for this API key in responses

isActiveboolean required

Current activation status of this API key

keyPrefixstring required

Key prefix for visual identification in API key lists

lastUsedAtstring date-time nullable

Timestamp when the key was last used

namestring required

Descriptive name for this API key

permissionsstring[] required

Permissions granted to this API key for resource access

updatedAtstring date-time nullable

API key last update timestamp

userIdstring uuid required

Owner user identifier

Example response

{
  "createdAt": "2023-01-01T00:00:00Z",
  "expiresAt": "2024-01-01T00:00:00Z",
  "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "isActive": true,
  "keyPrefix": "pk_live_",
  "lastUsedAt": "2023-01-01T12:00:00Z",
  "name": "Production API Key",
  "permissions": [
    "read:posts",
    "write:posts"
  ],
  "updatedAt": "2023-01-01T12:00:00Z",
  "userId": "b2c3d4e5-6f78-9012-bcde-f12345678901"
}