Create a user
POST/api/auth/users
Creates a new user account.
Body parameters
The new user’s email address. Must be a valid email and unique in the system.
The user’s full name. Minimum 2 characters.
The initial password. Minimum 6 characters.
The user’s role. One of
ADMIN, MESA, AREA, or USUARIO.The area to assign the user to. Typically required when
rol is AREA.The user’s phone number. Maximum 30 characters.
Error responses
| Status | Description |
|---|---|
401 Unauthorized | Missing or invalid Bearer token. |
403 Forbidden | Authenticated user does not have the ADMIN role. |
409 Conflict | A user with the given email already exists. Response: {"detail": "Email ya existe"}. |
422 Unprocessable Entity | The request body failed validation. |
List all users
GET/api/auth/users
Returns the full list of user accounts.
Response
Returns an array of user objects. Each object contains:Unique identifier for the user.
The user’s email address.
The user’s full name.
The user’s role:
ADMIN, MESA, AREA, or USUARIO.The area the user belongs to, if set.
The user’s phone number, if set.
Whether the user account is active.
Error responses
| Status | Description |
|---|---|
401 Unauthorized | Missing or invalid Bearer token. |
403 Forbidden | Authenticated user does not have the ADMIN role. |
Update a user
PATCH/api/auth/users/{user_id}
Partially updates an existing user. Only include the fields you want to change — all fields are optional.
Path parameters
The unique identifier of the user to update.
Body parameters
New email address for the user.
New full name for the user.
New password. Minimum 6 characters.
New role. One of
ADMIN, MESA, AREA, or USUARIO.New area assignment for the user.
New phone number. Maximum 30 characters.
Set to
false to deactivate the user account, or true to reactivate it. Deactivated users cannot log in.Error responses
| Status | Description |
|---|---|
401 Unauthorized | Missing or invalid Bearer token. |
403 Forbidden | Authenticated user does not have the ADMIN role. |
404 Not Found | No user exists with the given user_id. |
422 Unprocessable Entity | The request body failed validation. |
Delete a user
DELETE/api/auth/users/{user_id}
Permanently removes a user account.
Path parameters
The unique identifier of the user to delete.
Error responses
| Status | Description |
|---|---|
401 Unauthorized | Missing or invalid Bearer token. |
403 Forbidden | Authenticated user does not have the ADMIN role. |
404 Not Found | No user exists with the given user_id. |