curl --request POST \
--url https://api.example.com/api/users/{userId}/reservations \
--header 'Content-Type: application/json' \
--data '
{
"doctorId": 123,
"patientId": 123,
"timeBlockId": 123,
"reason": "<string>",
"notes": "<string>"
}
'{
"id": 123,
"date": "<string>",
"timeBlockId": 123,
"patientId": 123,
"doctorId": 123,
"status": "<string>",
"reason": "<string>",
"notes": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}Create a new appointment reservation for a patient with a specific doctor and time block
curl --request POST \
--url https://api.example.com/api/users/{userId}/reservations \
--header 'Content-Type: application/json' \
--data '
{
"doctorId": 123,
"patientId": 123,
"timeBlockId": 123,
"reason": "<string>",
"notes": "<string>"
}
'{
"id": 123,
"date": "<string>",
"timeBlockId": 123,
"patientId": 123,
"doctorId": 123,
"status": "<string>",
"reason": "<string>",
"notes": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}Authorization: Bearer <token>
doctorId: Required, must be a positive integerpatientId: Required, must be a positive integertimeBlockId: Required, must be a positive integerreason: Optional, maximum 255 charactersnotes: Optional, maximum 1000 charactersPENDING by default.
PENDING. Possible values: PENDING, CONFIRMED, CANCELLED, COMPLETED{
"error": "El paciente no existe"
}
{
"error": "El doctor no existe"
}
{
"error": "El bloque de tiempo no existe"
}
{
"error": "Ya existe una reserva para este bloque de tiempo"
}
{
"error": "Unauthorized"
}
curl -X POST https://api.example.com/api/users/42/reservations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-d '{
"doctorId": 5,
"patientId": 12,
"timeBlockId": 42,
"reason": "Consulta general",
"notes": "Paciente presenta síntomas de gripe"
}'
{
"id": 89,
"date": "2026-03-15T10:00:00.000Z",
"timeBlockId": 42,
"patientId": 12,
"doctorId": 5,
"status": "PENDING",
"reason": "Consulta general",
"notes": "Paciente presenta síntomas de gripe",
"createdAt": "2026-03-03T14:30:00.000Z",
"updatedAt": "2026-03-03T14:30:00.000Z"
}