Skip to content
Product Docs

API Keys

List Api Keys
api_keys.list(APIKeyListParams**kwargs) -> SyncPaginatedCursor[APIKey]
GET/api/v1/beta/api-keys
Create Api Key
api_keys.create(APIKeyCreateParams**kwargs) -> APIKey
POST/api/v1/beta/api-keys
Delete Api Key
api_keys.delete(strapi_key_id) -> APIKeyDeleteResponse
DELETE/api/v1/beta/api-keys/{api_key_id}
ModelsExpand Collapse
class APIKey: …

Schema for an API Key.

id: str

Unique identifier

formatuuid
redacted_api_key: str

The key with its middle masked, except on the create response, which returns the full secret once and never again.

user_id: str
created_at: Optional[datetime]

Creation datetime

formatdate-time
expires_at: Optional[datetime]

When the API key expires. Null if the key never expires.

formatdate-time
key_type: Optional[Literal["agent", "user"]]
One of the following:
"agent"
"user"
metadata: Optional[Dict[str, object]]
name: Optional[str]
project_id: Optional[str]
role: Optional[Literal["admin", "agent_viewer", "viewer", "viewer_v2"]]

Role capping what this key may do. Null if the key authorizes as its owner.

One of the following:
"admin"
"agent_viewer"
"viewer"
"viewer_v2"
updated_at: Optional[datetime]

Update datetime

formatdate-time
class APIKeyDeleteResponse: …

Confirmation that a resource was deleted.

cache_ttl_seconds: int

Maximum seconds until cached information expires

minimum0
success: bool

Whether the resource was deleted