POST /api/users/{user_id}/deactivate
Sets a user’s is_active flag to false, immediately preventing the user from authenticating. This endpoint is restricted to administrators.
Restriction: Administrators cannot deactivate other administrator accounts. Attempting to deactivate an admin user returns 403.
Authentication
Requires a valid Bearer access token. The authenticated user must have the admin role.Path Parameters
The ID of the user to deactivate.
Request Body
No request body is required.Response
true when the deactivation succeeds.Human-readable confirmation message.
The updated user object with
is_active: false.Errors
| Status | Description |
|---|---|
401 | Missing or invalid access token. |
403 | The authenticated user is not an admin, or the target user is an administrator. |
404 | No user exists with the given user_id. |