curl -X POST "https://api.danubeai.com/v1/api-keys/key_abc123/rotate" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
{
"id": "key_abc123",
"key": "nQ3vX8pK2mT7rW9jY5uB1cD4fH6gL0aZsEiOqUtMk7w",
"key_prefix": "nQ3vX8pK",
"name": "My Production Key",
"created_at": "2026-01-15T10:00:00Z",
"last_used": null,
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null
}
}
API Keys
Rotate API Key
Rotate an API key, generating new key material while preserving name and permissions
POST
/
v1
/
api-keys
/
{key_id}
/
rotate
curl -X POST "https://api.danubeai.com/v1/api-keys/key_abc123/rotate" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
{
"id": "key_abc123",
"key": "nQ3vX8pK2mT7rW9jY5uB1cD4fH6gL0aZsEiOqUtMk7w",
"key_prefix": "nQ3vX8pK",
"name": "My Production Key",
"created_at": "2026-01-15T10:00:00Z",
"last_used": null,
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null
}
}
Overview
Rotates an existing API key by generating new key material. The old key is immediately invalidated and a new plaintext key is returned. The key’s name and permissions are preserved. Auth: A dashboard session (Authorization: Bearer <jwt>) or an API key (danube-api-key).
Important: The new plaintext key is shown only once in this response. Store it securely.
Path Parameters
Response
Example
curl -X POST "https://api.danubeai.com/v1/api-keys/key_abc123/rotate" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
{
"id": "key_abc123",
"key": "nQ3vX8pK2mT7rW9jY5uB1cD4fH6gL0aZsEiOqUtMk7w",
"key_prefix": "nQ3vX8pK",
"name": "My Production Key",
"created_at": "2026-01-15T10:00:00Z",
"last_used": null,
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null
}
}
