curl --request PUT \
--url https://api.example.com/api/users/{userId}/reservations/{reservationId} \
--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>"
}Update an existing appointment reservation
curl --request PUT \
--url https://api.example.com/api/users/{userId}/reservations/{reservationId} \
--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: Optional, must be a positive integer if providedpatientId: Optional, must be a positive integer if providedtimeBlockId: Optional, must be a positive integer if providedreason: Optional, maximum 255 charactersnotes: Optional, maximum 1000 characterspatientId is provided, verifies it corresponds to an existing userdoctorId is provided, verifies it corresponds to an existing usertimeBlockId is provided, verifies it corresponds to an existing time blocktimeBlockId is provided, ensures the time block is not already reserved by a different appointmentPENDING, CONFIRMED, CANCELLED, or 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 PUT https://api.example.com/api/users/42/reservations/89 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-d '{
"timeBlockId": 45,
"reason": "Consulta de seguimiento"
}'
curl -X PUT https://api.example.com/api/users/42/reservations/89 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-d '{
"notes": "Paciente reporta mejoría en los síntomas"
}'
curl -X PUT https://api.example.com/api/users/42/reservations/89 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-d '{
"doctorId": 7,
"patientId": 12,
"timeBlockId": 50,
"reason": "Consulta especializada",
"notes": "Transferido a especialista"
}'
{
"id": 89,
"date": "2026-03-16T14:30:00.000Z",
"timeBlockId": 45,
"patientId": 12,
"doctorId": 5,
"status": "PENDING",
"reason": "Consulta de seguimiento",
"notes": "Paciente presenta síntomas de gripe",
"createdAt": "2026-03-03T14:30:00.000Z",
"updatedAt": "2026-03-03T16:45:00.000Z"
}