Bulk revoke API keys for a user¶
POST /api/v1/api-keys/bulk-revoke
Revokes all active API keys for a specific user. Regular users can only bulk revoke their own keys. Admins can bulk revoke any user's keys.
Authorization¶
Request body¶
Required.
Content type: application/json
Schema: object
| Property | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Username whose keys should be revoked |
Example:
Responses¶
| Status | Description | Response body |
|---|---|---|
200 OK | OK response. | object
|
400 Bad Request | Bad Request. Invalid request. |
|
401 Unauthorized | Unauthorized response. | None |
403 Forbidden | Forbidden. User trying to revoke another user's keys. |
|
500 Internal Server Error | Internal Server Error | None |
200 OK response body
| Property | Type | Required | Description |
|---|---|---|---|
revokedCount | integer | No | Number of keys that were revoked |
message | string | No | Success message |
Example request¶
curl -X POST "/maas/api/v1/api-keys/bulk-revoke" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username": "alice"
}'
Example response¶
200 OK, application/json