Update an existing API key's properties.
PATCHhttps://api.aitronos.com/v1/organizations/{org_id}/api-keys/{key_id}
org_id string required
The organization ID.
key_id string required
The API key ID.
key_name string optional
Updated name for the API key.
usage_limit_chf number optional
Updated usage limit in CHF.
scopes array optional
Updated array of permission scopes.
expires_at string optional
Updated expiration date in ISO 8601 format.
The updated API key object.
Bash
- Bash
- Python
- JavaScript
curl "https://api.aitronos.com/v1/organizations/org_123abc/api-keys/ak_123abc456def789" \
-X PATCH \
-H "X-API-Key: $FREDDY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"key_name": "Updated Production API Key"
}'Response:
{
"id": "ak_123abc456def789",
"key_prefix": "oak_live_a1b2",
"organization_id": "org_123abc",
"key_name": "Updated Production API Key",
"is_active": true,
"usage_limit_chf": 1000.0,
"scopes": ["read:usage", "write:projects", "read:agents"],
"created_by": "usr_456def",
"created_at": "2025-11-05T10:00:00Z",
"expires_at": "2026-06-01T00:00:00Z"
}