The Users API covers the full lifecycle of a GastroMóvil account: creating a new user, managing delivery addresses, submitting order ratings, and administrative user management. Registration and address creation are public or lightly guarded endpoints; the admin management endpoints (list, update, delete) are intended for back-office use. All endpoints are prefixed underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/lffiesco-svg/gastromovil/llms.txt
Use this file to discover all available pages before exploring further.
/usuarios/ as defined in usuarios/urls.py.
GastroMóvil uses a custom
Usuario model. The username field is set to the email address at registration time, and EmailBackend is the primary authentication backend — always use the email address when authenticating.Register a User
Creates a new user account and dispatches a welcome email via the Resend API. New users are always assigned thecliente role regardless of the payload.
POST /usuarios/api/registro/
Request Body
Must be the user’s email address. GastroMóvil sets
username = email internally.The user’s email address. Must pass strict format validation (regex + domain check) and must not be from a disposable mail service such as
mailinator.com or yopmail.com.Account password in plain text (sent over HTTPS). Write-only — never returned in responses.
Optional contact phone number.
Example Request
Responses
201 Created — account created and welcome email sent.
400 Bad Request — validation failed (invalid email, disposable domain, missing required field).
Create a Delivery Address
Adds a new delivery address record to the database. Theusuario field must be the ID of an existing user.
POST /usuarios/api/direcciones/crear/
Request Body
Primary key of the user this address belongs to.
Street name and number.
Neighbourhood or district.
Optional landmark or additional directions (e.g.
"Frente al parque").Whether this should be set as the user’s default delivery address. Defaults to
false.Example Request
Responses
201 Created
400 Bad Request — serializer validation errors.
List All Addresses
Returns all delivery address records in the database. Intended for administrative inspection.GET /usuarios/api/direcciones/
Example Request
Response
200 OK — array of address objects with all model fields.
Admin: List All Users
Returns a flat list of every user account with their key identifying fields. Intended for back-office dashboards.GET /usuarios/api/usuarios/
Example Request
Response
200 OK — array of user summary objects.
Primary key of the user.
The username (set to the email address on registration).
Email address of the user.
Account role. One of
cliente, restaurante, or repartidor.Admin: Update a User
Updatesusername, email, and/or rol for an existing user. Only the fields included in the request body are changed.
PUT /usuarios/api/usuarios/<pk>/editar/
Path Parameters
Primary key of the user to update.
Request Body
New username value.
New email address.
New role. Accepted values:
cliente, restaurante, repartidor.Example Request
Responses
200 OK
404 Not Found
Admin: Delete a User
Permanently removes a user account and all related data cascades.DELETE /usuarios/api/usuarios/<pk>/eliminar/
Path Parameters
Primary key of the user to delete.
Example Request
Responses
200 OK
404 Not Found
Web Auth Flows
The following routes serve the browser-rendered UI and are not intended for direct API consumption. They are documented here for completeness.Send Password Reset Code
POST /usuarios/recuperar/ — accepts an email form field, generates a 6-digit CodigoRecuperacion, and emails it to the user via Resend. Redirects to the code verification page on success.
Verify Code and Reset Password
POST /usuarios/verificar-codigo/ — accepts email, codigo, and password as JSON. Validates the code against the stored CodigoRecuperacion (with expiry check), updates the password, and returns {"ok": true, "redirect": "/login/"}.
Register via Web Form (with Email Verification)
POST /register/ (mapped in the root urls.py) — renders the HTML registration form. On valid submission, a 6-digit verification code is emailed to the user and the session stores the pending registration data. The user then completes registration at POST /usuarios/verificar-registro/ by submitting the code.