Skip to content
Go to Boltz API

Revoke an API key

admin.api_keys.revoke(strapi_key_id) -> APIKeyRevokeResponse
POST/compute/v1/admin/api-keys/{api_key_id}/revoke

Revoke an API key

ParametersExpand Collapse
api_key_id: str
ReturnsExpand Collapse
class APIKeyRevokeResponse:
id: str

API key ID

allowed_ips: List[str]

IP addresses allowed to use this key. An empty array means all IPs are allowed.

created_at: datetime
formatdate-time
expires_at: Optional[datetime]

When the key expires. Null if the key does not expire.

formatdate-time
is_active: bool
key_prefix: str

First 12 characters of the key

key_type: Literal["admin", "workspace"]
Accepts one of the following:
"admin"
"workspace"
last_used_at: Optional[datetime]
formatdate-time
livemode: bool

Whether this is a live API key (false for test keys).

name: str

API key name

workspace_id: Optional[str]

Workspace ID if workspace-scoped

Revoke an API key

import os
from boltz_api import Boltz

client = Boltz(
    api_key=os.environ.get("BOLTZ_API_KEY"),  # This is the default and can be omitted
)
response = client.admin.api_keys.revoke(
    "api_key_id",
)
print(response.id)
{
  "id": "id",
  "allowed_ips": [
    "string"
  ],
  "created_at": "2019-12-27T18:11:19.117Z",
  "expires_at": "2019-12-27T18:11:19.117Z",
  "is_active": true,
  "key_prefix": "key_prefix",
  "key_type": "admin",
  "last_used_at": "2019-12-27T18:11:19.117Z",
  "livemode": true,
  "name": "name",
  "workspace_id": "workspace_id"
}
Returns Examples
{
  "id": "id",
  "allowed_ips": [
    "string"
  ],
  "created_at": "2019-12-27T18:11:19.117Z",
  "expires_at": "2019-12-27T18:11:19.117Z",
  "is_active": true,
  "key_prefix": "key_prefix",
  "key_type": "admin",
  "last_used_at": "2019-12-27T18:11:19.117Z",
  "livemode": true,
  "name": "name",
  "workspace_id": "workspace_id"
}