Skip to main content
PUT
/
consultas
/
{consulta_id}
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"
}

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

consulta_id
integer
required
The unique identifier of the appointment to updateExample: 1

Request Body

data
date
required
The date of the appointmentExample: 2025-04-28
hora
time
required
The time of the appointmentExample: 14:00
paciente_id
integer
required
The ID of the patient for this appointmentExample: 1
profissional_id
integer
required
The ID of the healthcare professional for this appointmentExample: 2
prontuario_id
integer
The ID of the medical record (prontuário) associated with this appointmentExample: 1
status
string
required
The status of the appointmentAllowed values:
  • Agendada (Scheduled)
  • Realizada (Completed)
  • Cancelada (Cancelled)
  • Não Compareceu (No-show)
  • Reagendada (Rescheduled)
  • Pendente (Pending)
Example: Realizada
tipoConsulta
string
required
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
observacao
string
Additional notes or observations about the appointmentExample: Paciente chegou atrasado

Response

id
integer
The unique identifier for the appointment
data
date
The date of the appointment
hora
time
The time of the appointment
paciente_id
integer
The ID of the patient
profissional_id
integer
The ID of the healthcare professional
status
string
The status of the appointment
tipoConsulta
string
The type of appointment
observacao
string
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 CodeDescription
200Appointment updated successfully
400Invalid request body
401Unauthorized - invalid or missing token
403Forbidden - user lacks permission to update this appointment
404Appointment, 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

Build docs developers (and LLMs) love