Skip to main content

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 returns all reservations that have not yet been accepted by a lawyer — every document where reservation_accepted is false. These are incoming client requests that are still awaiting review. Results are sorted by _id in descending order (newest first) and are paginated via the Paginate middleware using URL path parameters.

Endpoint

POST /api/form/reserve/list/reservation-false

Authentication

Required. Include a valid JWT in the Authorization header as a Bearer token.
Authorization: Bearer <token>

Pagination

Pagination is controlled by two optional URL path parameters passed to the Paginate middleware before the main handler runs:
ParameterLocationDefaultDescription
perpagereq.params.perpage10Number of records to return per page.
pagreq.params.pag0Current page number. Pages greater than 1 are offset by pag - 1 (e.g., page 2 skips the first perpage records). Page 1 or any value ≤ 1 starts from the beginning (skip 0).
The middleware writes the computed values into req.body.skippag (how many records to skip) and req.body.limit (how many to return). These are used directly in the Mongoose query.

Request Body

No request body fields are required. Pagination is derived from URL path parameters as described above.

Example Request

curl -X POST https://your-api-domain.com/api/form/reserve/list/reservation-false \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Response

200 — Success

msj
string
A human-readable status message. Value: "Cargando reservas no aceptadas".
status
boolean
true when the request was handled successfully.
data
array
Array of FormReserve documents with reservation_accepted: false, sorted newest first.
pagination
object
Pagination metadata for the current response.
{
  "msj": "Cargando reservas no aceptadas",
  "status": true,
  "data": [
    {
      "_id": "64f3c7d4e8a11b002a4e9f33",
      "full_name": "Carlos Mendoza Reyes",
      "email": "carlos.mendoza@example.com",
      "phone": 5598765432,
      "required_service": "Derecho penal",
      "preferred_date": "2025-08-22",
      "preferred_hour": "09:00",
      "additional_message": "",
      "reservation_accepted": false,
      "createdAt": "2025-07-31T09:11:47.000Z",
      "updatedAt": "2025-07-31T09:11:47.000Z",
      "__v": 0
    }
  ],
  "pagination": {
    "pag": 0,
    "perpage": 10,
    "pags": 2
  }
}

401 — Missing Token

{
  "msj": "Sin autorizacion",
  "status": false
}

403 — Expired Token

{
  "msj": "Sesion finalizada",
  "status": false
}

403 — Invalid Token

Returned when the token 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. The response body is the raw error object thrown by the server.
Use this endpoint as your primary queue for reservations that need attention. A high pags value relative to the accepted list indicates a backlog of unreviewed client requests. Combine this endpoint with the Accept Reservation endpoint to process pending reservations one by one.

Build docs developers (and LLMs) love