The admin user-management endpoints let administrators suspend and reinstate user accounts without deleting them. Blocking a user immediately invalidates all of their active Sanctum tokens, preventing further API access. Unblocking resets the user’s status toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Jcofles/Proyecto-web/llms.txt
Use this file to discover all available pages before exploring further.
inactivo so they can log in again. Both endpoints are protected by auth:sanctum middleware and should be further restricted to admin-role users in production.
Block a user
Sets the target user’sstatus_id to the bloqueado status and deletes all of their active Sanctum tokens, immediately ending every session.
The numeric ID of the user to block. Sourced from the
users table. Returns 404 if the user is not found.What happens when a user is blocked
status_idis updated to the ID of thebloqueadorecord inuser_status.- All Sanctum personal access tokens owned by the user are deleted from
personal_access_tokens. - The user’s next login attempt will be rejected (login logic checks
status_id). - No data is deleted — the account is fully recoverable by calling the unblock endpoint.
Unblock a user
Resets the target user’sstatus_id to inactivo, which permits them to log in again.
The numeric ID of the user to unblock. Returns
404 if the user is not found.Unblocking sets the status to
inactivo, not activo. The user must complete the normal login flow (including any 2FA steps) to obtain a new token and become fully active.Response fields
Human-readable confirmation of the action performed.
The user’s primary key.
The user’s display name.
The user’s email address.
The user’s resolved status name after the operation.
"bloqueado" after blocking; "inactivo" after unblocking.User status reference
| Status | Description |
|---|---|
activo | Account in good standing. Can access all authenticated endpoints. |
inactivo | Account exists but the user is not currently logged in (default after unblock). |
bloqueado | Account suspended. All tokens revoked; login is denied. |
Error responses
401 Unauthorized — missing or invalid Bearer tokenuserId does not match any user