Skip to main content

Endpoint

GET /api/reservations/professional/:professionalId

Description

Retrieves all reservations assigned to a specific professional by their ID. See implementation in server/src/modules/reservations/reservations.controller.ts:109-127.

Authentication

This endpoint requires Bearer token authentication. Include your access token in the Authorization header.

Path Parameters

professionalId
string
required
The unique identifier of the professional whose reservations you want to retrieveExample: prof456

Response

status
number
HTTP status code (200 for success)
message
string
Success message including the professional ID
data
array
Array of reservation objects for the specified professional

Example Request

curl -X GET https://your-domain.com/api/reservations/professional/prof456 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json"

Example Response

{
  "status": 200,
  "message": "SOLICITASTE TODAS LAS RESERVAS DEL PROFESIONAL CON EL ID: prof456 EXITOSAMENTE",
  "data": [
    {
      "id": "res789",
      "client_id": "abc123",
      "professional_id": "prof456",
      "start_time": "2026-03-15T10:00:00Z",
      "end_time": "2026-03-15T11:00:00Z",
      "status": "CONFIRMED",
      "session_modality": "Virtual",
      "created_at": "2026-03-10T08:30:00Z"
    },
    {
      "id": "res790",
      "client_id": "def456",
      "professional_id": "prof456",
      "start_time": "2026-03-16T14:00:00Z",
      "end_time": "2026-03-16T15:00:00Z",
      "status": "PENDING",
      "session_modality": "Presencial",
      "created_at": "2026-03-11T09:15:00Z"
    }
  ]
}

Error Responses

Bad Request

{
  "statusCode": 400,
  "message": "Error al obtener las reservas del profesional",
  "error": "Bad Request"
}

Unauthorized

{
  "statusCode": 401,
  "message": "Token inválido o expirado",
  "error": "Unauthorized"
}

Use Cases

  • Display a professional’s schedule and appointments
  • Build a calendar view for professionals
  • Show upcoming client sessions
  • Manage and organize appointments
  • Calculate availability based on existing reservations

Notes

  • Returns an empty array if the professional has no reservations
  • All reservations for the professional are returned regardless of status
  • Useful for building professional dashboards and schedules
  • To get reservations for a specific user, use Get By User

Build docs developers (and LLMs) love