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 is the public-facing endpoint that allows prospective clients to submit an appointment reservation request to the law firm. No authentication token is needed — any visitor can call this endpoint to express interest in a consultation. Once submitted, the reservation is stored in the database with reservation_accepted set to false and remains pending until a lawyer reviews and accepts it.

Endpoint

POST /api/form/reserve/create

Authentication

None. This endpoint is publicly accessible and does not require an Authorization header.

Request Body

full_name
string
required
The client’s full legal name.
email
string
required
The client’s email address. Used for confirmation notifications once the reservation is accepted.
phone
number
required
The client’s contact phone number. Must be a numeric value (no dashes or spaces).
required_service
string
required
The area of law for which the client is seeking consultation. Must be exactly one of the following allowed values:
  • Derecho civil
  • Derecho familiar
  • Derecho mercantil
  • Derecho penal
  • Derecho laboral
  • Derecho inmobiliario
preferred_date
string
required
The client’s preferred appointment date. Recommended format: YYYY-MM-DD (e.g., "2025-08-15").
preferred_hour
string
required
The client’s preferred appointment time. Recommended format: HH:MM in 24-hour notation (e.g., "10:30").
additional_message
string
An optional free-text message from the client providing additional context about their legal matter.

Example Request

curl -X POST https://your-api-domain.com/api/form/reserve/create \
  -H "Content-Type: application/json" \
  -d '{
    "full_name": "María García López",
    "email": "maria.garcia@example.com",
    "phone": 5512345678,
    "required_service": "Derecho familiar",
    "preferred_date": "2025-08-15",
    "preferred_hour": "10:30",
    "additional_message": "Necesito asesoría sobre un proceso de divorcio."
  }'

Responses

200 — Reservation Created

The reservation was saved successfully. The client should be informed that they will receive a notification once a lawyer accepts their request.
{
  "msj": "Reserva creada correctamente. Cuando tu reserva sea confirmada te notificaremos",
  "status": true,
  "data_response": {
    "_id": "64f3a2b1c9e77b001f3d8a12",
    "full_name": "María García López",
    "email": "maria.garcia@example.com",
    "phone": 5512345678,
    "required_service": "Derecho familiar",
    "preferred_date": "2025-08-15",
    "preferred_hour": "10:30",
    "additional_message": "Necesito asesoría sobre un proceso de divorcio.",
    "reservation_accepted": false,
    "createdAt": "2025-07-30T14:22:10.000Z",
    "updatedAt": "2025-07-30T14:22:10.000Z",
    "__v": 0
  }
}

403 — Missing Required Fields

Returned when one or more required fields are absent from the request body.
{
  "msj": "Completa todos los campos",
  "status": false
}

500 — Server Error

Returned when an unexpected error occurs on the server (e.g., database connectivity issues). The response body is the raw error object thrown by the server.
The reservation_accepted field is automatically set to false when a reservation is first created. It will remain false until an authenticated lawyer explicitly accepts it via the Accept Reservation endpoint.

Build docs developers (and LLMs) love