Skip to main content
GET
/
appointments
/
:id
Get Appointment by ID
curl --request GET \
  --url https://api.example.com/appointments/:id
{
  "appointment": {
    "id": 123,
    "patientID": 123,
    "professionalID": 123,
    "date": "<string>",
    "time": "<string>",
    "description": "<string>",
    "state": "<string>",
    "createdAt": "<string>",
    "updatedAt": "<string>"
  }
}

Overview

This endpoint retrieves a single appointment by its unique ID. Returns the complete appointment record including all fields.

Authentication

Requires a valid JWT token in the request headers.
Authorization: Bearer <jwt_token>

Path Parameters

id
number
required
The unique identifier of the appointment to retrieve.Example: 123

Response

Returns a single appointment object:
appointment
object

Examples

Get Appointment by ID

curl -X GET "https://api.clinicavitalis.com/appointments/123" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Response Example

{
  "appointment": {
    "id": 123,
    "patientID": 45,
    "professionalID": 12,
    "date": "2026-03-15",
    "time": "10:30:00",
    "description": "Control mensual de diabetes",
    "state": "Pendiente",
    "createdAt": "2026-03-10T14:23:45.000Z",
    "updatedAt": "2026-03-10T14:23:45.000Z"
  }
}

Error Responses

404 Not Found

Returned when the appointment with the specified ID does not exist:
{
  "msg": "El turno no está cargado en el sistema"
}

401 Unauthorized

Returned when the JWT token is missing or invalid:
{
  "msg": "Token inválido o no proporcionado"
}

500 Server Error

Returned when a server error occurs:
{
  "msg": "Error del servidor"
}

Use Cases

  • Appointment Details View: Display full information about a specific appointment
  • Update Preparation: Fetch current appointment data before allowing modifications
  • Verification: Confirm appointment details before performing operations
  • History Review: View past appointment information for patient records

Build docs developers (and LLMs) love