PATCH
/api/admin/api-keys/{api_key_id}AdminUpdate an API key
name renames the key's label; allow_any_audience toggles the key's permission to send to any recipient. The key's ID, secret and scope entries are unchanged either way.
operationId
updateApiKeyAdmin: API KeysAuthentication & permissionsAdmin
Platform administrators only
- Accepted credentials
- Access token (Bearer)
Authorization: Bearer <JWT> - Access token (cookie)
cookie "access_token_schemavaults-mail"
- Access token (Bearer)
- Who may call
- Platform administrators only
Path parameters
| Name | Type | Description |
|---|---|---|
| api_key_id* | string (uuid) | ID of the API key. |
Request body
Required
application/json
UpdateApiKeyRequestBody
| Property | Type | Description |
|---|---|---|
| name | string | Human-facing API key label (1-64 characters). minLength: 1maxLength: 64 |
| allow_any_audience | boolean | When true, the key may send to ANY recipient and its audience allowlists are ignored. |
JSONExample
"name""marketing-site"
"allow_any_audience"true
Responses
application/json
| Property | Type | Description |
|---|---|---|
| success* | true | |
| data* | ApiKeyRecord | An API key as returned by the admin endpoints. Never includes the secret hash or the plaintext token. |
| api_key_id* | string (uuid) | |
| name* | string | minLength: 1maxLength: 64 |
| key_prefix* | string | minLength: 1 |
| created_at* | number | minimum: 0 |
| created_by_user_id* | string (uuid) | |
| last_used_at* | number | null | null | minimum: 0 |
| revoked_at* | number | null | null | minimum: 0 |
| allow_any_audience* | boolean | |
| message* | string |
JSONExample
"success"true
"data"
"api_key_id""123e4567-e89b-12d3-a456-426614174000"
"name""string"
"key_prefix""string"
"created_at"1.5
"created_by_user_id""123e4567-e89b-12d3-a456-426614174000"
"last_used_at"1.5
"revoked_at"1.5
"allow_any_audience"true
"message""string"
Example request
bashcurl
curl -X PATCH 'https://mail.schemavaults.com/api/admin/api-keys/<api_key_id>' \
-H 'Authorization: Bearer <access_token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "marketing-site",
"allow_any_audience": true
}'