Skip to main content

PATCH /api/users//deactivate

Deactivates a user account, preventing them from accessing the system. This endpoint requires write privileges or admin role.

Authentication

This endpoint requires JWT authentication with one of the following:
  • WRITE_PRIVILEGES authority
  • ADMIN role

Path Parameters

id
UUID
required
The unique identifier of the user to deactivate

Response

This endpoint returns no content on success (HTTP 204).

Error Codes

  • 204 - User deactivated successfully (no content returned)
  • 401 - Unauthorized: Missing or invalid JWT token
  • 403 - Forbidden: Insufficient permissions
  • 404 - Not Found: User does not exist

Example Request

curl -X PATCH https://api.example.com/api/users/550e8400-e29b-41d4-a716-446655440000/deactivate \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Success Response

HTTP/1.1 204 No Content

Example Error Response

{
  "timestamp": "2026-03-04T10:30:00Z",
  "requestId": "abc123-def456",
  "message": "User not found",
  "detail": "Usuario con id 550e8400-e29b-41d4-a716-446655440000 no encontrado"
}

Notes

  • This operation changes the user’s status to INACTIVO
  • Once deactivated, the user will not be able to authenticate or access the system
  • Deactivating a user does not delete their data; it can be reversed using the activate endpoint
  • This action is logged in the audit log with module “USUARIOS” and action “DESACTIVAR_USUARIO”

Build docs developers (and LLMs) love