Documentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/despacho-backend/llms.txt
Use this file to discover all available pages before exploring further.
This endpoint permanently removes a reservation record from the MongoDB database. The server first verifies that a document matching the provided reservationId exists; if found, it is hard-deleted using deleteOne. There is no soft-delete mechanism and no recycle bin — once a reservation is removed it cannot be recovered. Only authenticated lawyers may call this endpoint.
Endpoint
POST /api/form/reserve/remove/reservation/:reservationId
Authentication
Required. Include a valid JWT in the Authorization header as a Bearer token.
Authorization: Bearer <token>
Path Parameters
The MongoDB ObjectId of the reservation to delete. This value is the _id field on any reservation document returned by the list or create endpoints.
Request Body
No request body is required for this endpoint.
Example Request
curl -X POST https://your-api-domain.com/api/form/reserve/remove/reservation/64f3a2b1c9e77b001f3d8a12 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Responses
200 — Reservation Deleted
The reservation was found and permanently removed from the database.
{
"msj": "Reserva eliminada exitosamente.",
"status": true
}
404 — Reservation Not Found
Returned when no document exists in the database for the provided reservationId.
{
"msj": "Reserva no encontrada.",
"status": false
}
401 — Missing Token
Returned when the Authorization header is absent from the request.
{
"msj": "Sin autorizacion",
"status": false
}
403 — Expired Token
Returned when the JWT is present but the session has expired.
{
"msj": "Sesion finalizada",
"status": false
}
403 — Invalid Token
Returned when the JWT is present but fails signature verification or is otherwise malformed.
{
"msj": "<err.message>. Rechazo en la conexion",
"status": false
}
404 — Lawyer User Not Found
Returned by the Token middleware when the token is valid but the associated lawyer user no longer exists in the database.
{
"msj": "Usuario no encontrado",
"status": false
}
500 — Server Error
Returned when an unexpected error occurs on the server (e.g., a database failure during the delete operation). The response body is the raw error object thrown by the server.
Deletion via this endpoint is permanent and irreversible. There is no soft-delete flag, no archive, and no way to recover a reservation once it has been removed. Ensure you have confirmed the correct reservationId before calling this endpoint, and consider building a confirmation step into any admin UI that invokes it.