curl -X PATCH "https://api.danubeai.com/v1/api-keys/key_abc123" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null,
"max_spend_per_call_cents": null,
"max_spend_per_day_cents": 500,
"require_confirmation": true
}
}'
{
"id": "key_abc123",
"key_prefix": "nQ3vX8pK",
"name": "My Production Key",
"created_at": "2026-01-15T10:00:00Z",
"last_used": "2026-09-01T18:22:10Z",
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null,
"max_spend_per_call_cents": null,
"max_spend_per_day_cents": 500,
"require_confirmation": true
}
}
API Keys
Update API Key
Rename an API key or replace its permissions without rotating the secret
PATCH
/
v1
/
api-keys
/
{key_id}
curl -X PATCH "https://api.danubeai.com/v1/api-keys/key_abc123" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null,
"max_spend_per_call_cents": null,
"max_spend_per_day_cents": 500,
"require_confirmation": true
}
}'
{
"id": "key_abc123",
"key_prefix": "nQ3vX8pK",
"name": "My Production Key",
"created_at": "2026-01-15T10:00:00Z",
"last_used": "2026-09-01T18:22:10Z",
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null,
"max_spend_per_call_cents": null,
"max_spend_per_day_cents": 500,
"require_confirmation": true
}
}
Overview
Changes a key’s name and/or permissions in place. The key material is untouched, so agents that already hold the key keep working with the new rules on their next call. Use this to tighten an allow-list, add a spend cap, or turn on the confirmation requirement for destructive calls without re-pasting a new secret into every agent config. Permissions are replaced as a whole. To change one field, read the key first (GET /v1/api-keys) and send the full object back with the change.
Auth: JWT (dashboard) or an API key belonging to the same account.
Path Parameters
string
required
The API key UUID to update
Body
Send at least one field.string
New display name. Leading and trailing whitespace is trimmed; an empty name is rejected.
object
Replacement permissions. Send
{} (or an object whose fields are all null) for full access.Show Permissions object
Show Permissions object
string[] | null
Service UUIDs this key may call.
null means all services.string[] | null
Tool UUIDs this key may call.
null means all tools. Services and tools are combined with OR.integer | null
Refuse any single call priced above this amount.
integer | null
Refuse calls once the key’s spend for the current UTC day would exceed this amount.
boolean | null
When
true, destructive tool calls (non-GET methods, or tools flagged destructive) return 409 confirmation_required with a short-lived confirm_token; the call goes through only when it is repeated with that token. The token is bound to the key, the tool and the exact arguments, and expires after five minutes.string
Name of the agent this key belongs to
string
One of
coding_agent, assistant, workflow, service, otherstring
One line on what the key is for
Response
The updated key, in the same shape asGET /v1/api-keys. The secret is never returned here.
string
API key UUID
string
First 8 characters of the key
string
Key name
string
Creation timestamp
string
Last usage timestamp
object
Permissions as stored.
null means unrestricted.Errors
| Status | Meaning |
|---|---|
| 400 | Empty body, or an empty name |
| 404 | No active key with that id belongs to this account |
key.update with the list of changed fields.
Example
curl -X PATCH "https://api.danubeai.com/v1/api-keys/key_abc123" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null,
"max_spend_per_call_cents": null,
"max_spend_per_day_cents": 500,
"require_confirmation": true
}
}'
{
"id": "key_abc123",
"key_prefix": "nQ3vX8pK",
"name": "My Production Key",
"created_at": "2026-01-15T10:00:00Z",
"last_used": "2026-09-01T18:22:10Z",
"permissions": {
"allowed_services": ["service_uuid_1"],
"allowed_tools": null,
"max_spend_per_call_cents": null,
"max_spend_per_day_cents": 500,
"require_confirmation": true
}
}
