Authentication
This endpoint requires authentication. Include a valid JWT token in the Authorization header.
Authorization: Bearer <token>
Authorization
Only the professional associated with the appointment can create it. Superusers can create appointments for any professional.
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: Agendada
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: Observação da consulta
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 POST https://api.vidaplus.com/consultas/ \
-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": "Agendada",
"tipoConsulta": "Teleconsulta",
"link": "https://example.com/consulta",
"observacao": "Consulta de rotina"
}'
{
"id": 1,
"data": "2025-04-28",
"hora": "14:00:00",
"paciente_id": 1,
"profissional_id": 2,
"status": "Agendada",
"tipoConsulta": "Teleconsulta",
"observacao": "Consulta de rotina"
}
Error Codes
| Status Code | Description |
|---|
| 201 | Appointment created successfully |
| 400 | Invalid request body |
| 401 | Unauthorized - invalid or missing token |
| 403 | Forbidden - user lacks permission to create this appointment |
| 404 | Professional, patient, or medical record not found |
| 409 | Conflict - appointment already exists for this time slot |
Business Rules
- The patient, professional, and medical record must exist in the system
- Cannot create duplicate appointments (same patient, professional, date, and time)
- Only the assigned professional or a superuser can create the appointment
- Non-superusers can only create appointments for themselves as the professional