Skip to main content

Endpoint

GET /api/reservations/:id

Description

Retrieves a specific reservation by its unique identifier. See implementation in server/src/modules/reservations/reservations.controller.ts:145-155.

Authentication

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

Path Parameters

id
string
required
The unique identifier of the reservation to retrieveExample: res789

Response

id
string
Unique identifier for the reservation
client_id
string
ID of the client who made the reservation
professional_id
string
ID of the professional for the reservation
start_time
string
Start time of the reservation in ISO 8601 format
end_time
string
End time of the reservation in ISO 8601 format
status
string
Reservation status: PENDING, CONFIRMED, or CANCELLED
session_modality
string
Type of session: Virtual, Presencial, or empty string
created_at
string
When the reservation was created (ISO 8601 format)

Example Request

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

Example Response

{
  "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"
}

Error Responses

Not Found

If the reservation doesn’t exist:
{
  "statusCode": 404,
  "message": "Reserva no encontrada",
  "error": "Not Found"
}

Unauthorized

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

Use Cases

  • Display reservation details to users
  • Verify reservation information before making changes
  • Show confirmation details after booking
  • Retrieve reservation data for cancellation or modification

Notes

  • Returns a 404 error if the reservation doesn’t exist
  • The response does not include a wrapper object (status, message) like other endpoints
  • Useful for displaying individual reservation details or confirmations

Build docs developers (and LLMs) love