Authentication
This endpoint requires authentication. Include a valid JWT token in the Authorization header.
Authorization: Bearer <token>
Authorization
- Superusers: Can update any appointment
- Regular users: Can only update appointments where they are either the patient or the professional
Path Parameters
The unique identifier of the appointment to updateExample: 1
Request Body
The date of the appointmentExample: 2025-04-28
The time of the appointmentExample: 14:00
The ID of the patient for this appointmentExample: 1
The ID of the healthcare professional for this appointmentExample: 2
The ID of the medical record (prontuário) associated with this appointmentExample: 1
The status of the appointmentAllowed values:
Agendada (Scheduled)
Realizada (Completed)
Cancelada (Cancelled)
Não Compareceu (No-show)
Reagendada (Rescheduled)
Pendente (Pending)
Example: Realizada
The type of appointmentAllowed values:
Teleconsulta (Telemedicine)
Presencial (In-person)
Example: Teleconsulta
The link for virtual appointments (required for teleconsultas)Example: https://example.com/consulta
Additional notes or observations about the appointmentExample: Paciente chegou atrasado
Response
The unique identifier for the appointment
The date of the appointment
The time of the appointment
The ID of the healthcare professional
The status of the appointment
Additional notes about the appointment
curl -X PUT https://api.vidaplus.com/consultas/1 \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"data": "2025-04-28",
"hora": "14:00",
"paciente_id": 1,
"profissional_id": 2,
"prontuario_id": 1,
"status": "Realizada",
"tipoConsulta": "Teleconsulta",
"link": "https://example.com/consulta",
"observacao": "Paciente chegou atrasado"
}'
{
"id": 1,
"data": "2025-04-28",
"hora": "14:00:00",
"paciente_id": 1,
"profissional_id": 2,
"status": "Realizada",
"tipoConsulta": "Teleconsulta",
"observacao": "Paciente chegou atrasado"
}
Error Codes
| Status Code | Description |
|---|
| 200 | Appointment updated successfully |
| 400 | Invalid request body |
| 401 | Unauthorized - invalid or missing token |
| 403 | Forbidden - user lacks permission to update this appointment |
| 404 | Appointment, professional, patient, or medical record not found |
Business Rules
- The appointment must exist
- The patient, professional, and medical record must exist in the system
- Users can only update appointments where they are involved as either the patient or the professional (unless they are superusers)
- All fields from the original appointment can be modified, including reassigning to different professionals or patients