Skip to main content
PUT
/
api
/
citas
/
:id
/
atender
Mark Appointment as Attended
curl --request PUT \
  --url https://api.example.com/api/citas/:id/atender
{
  "message": "<string>",
  "cita": {
    "id": 123,
    "cliente_id": 123,
    "medico_id": 123,
    "fecha_solicitada": "<string>",
    "hora_solicitada": "<string>",
    "fecha_confirmada": "<string>",
    "hora_confirmada": "<string>",
    "sintomas": {},
    "estado": "<string>",
    "created_at": "<string>"
  }
}

Authentication

This endpoint requires authentication and authorization. Required roles: admin or asistente Header:
Authorization: Bearer <token>

Path Parameters

id
number
required
The appointment ID to mark as attended

Response

Returns a success message and the updated appointment object.
message
string
Success message
cita
object
Updated appointment object
id
number
Appointment ID
cliente_id
number
Public client ID
medico_id
number
Assigned doctor ID
fecha_solicitada
string
Requested date (ISO 8601)
hora_solicitada
string
Requested time (ISO 8601)
fecha_confirmada
string
Confirmed date (ISO 8601)
hora_confirmada
string
Confirmed time (ISO 8601)
sintomas
string | null
Patient symptoms description
estado
string
Appointment status - updated to atendida
created_at
string
Creation timestamp

Example Request

curl -X PUT https://api.example.com/api/citas/1/atender \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json"

Example Response

{
  "message": "Cita marcada como atendida",
  "cita": {
    "id": 1,
    "cliente_id": 5,
    "medico_id": 2,
    "fecha_solicitada": "2026-03-15T00:00:00.000Z",
    "hora_solicitada": "1970-01-01T14:30:00.000Z",
    "fecha_confirmada": "2026-03-15T00:00:00.000Z",
    "hora_confirmada": "2026-03-05T18:20:00.000Z",
    "sintomas": "Dolor de cabeza constante",
    "estado": "atendida",
    "created_at": "2026-03-05T10:00:00.000Z"
  }
}

Error Responses

400 Bad Request
Appointment is not in confirmed status
{
  "message": "Solo se pueden atender citas confirmadas"
}
401 Unauthorized
Missing or invalid authentication token
{
  "message": "Token no proporcionado"
}
403 Forbidden
User doesn’t have required role
{
  "message": "Acceso denegado: requiere rol admin o asistente"
}
404 Not Found
Appointment not found
{
  "message": "Cita no encontrada"
}
500 Internal Server Error
Server error while updating appointment
{
  "message": "Error al marcar cita como atendida"
}

Notes

  • This endpoint can only be used on appointments with status confirmada
  • Attempting to mark appointments in other states (pendiente, atendida, cancelada) will result in a 400 error
  • The appointment status is updated to atendida
  • No request body is required for this operation

Build docs developers (and LLMs) love