Skip to main content
GET
/
api
/
citas
List Appointments
curl --request GET \
  --url https://api.example.com/api/citas
{
  "appointments": [
    {
      "id": 123,
      "cliente_id": 123,
      "medico_id": {},
      "fecha_solicitada": "<string>",
      "hora_solicitada": "<string>",
      "fecha_confirmada": {},
      "hora_confirmada": {},
      "sintomas": {},
      "estado": "<string>",
      "created_at": "<string>",
      "cliente": {
        "id": 123,
        "nombres": "<string>",
        "apellidos": {},
        "telefono": "<string>",
        "email": {}
      },
      "medico": {
        "id": 123,
        "persona_id": 123,
        "especialidad_id": 123,
        "persona": {
          "nombres": "<string>",
          "apellidos": "<string>"
        },
        "especialidad": {
          "id": 123,
          "nombre": "<string>"
        }
      }
    }
  ]
}

Authentication

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

Response

Returns an array of appointments ordered by requested date (ascending).
appointments
array
Array of appointment objects
id
number
Appointment ID
cliente_id
number
Public client ID
medico_id
number | null
Assigned doctor ID (null if not confirmed)
fecha_solicitada
string
Requested date (ISO 8601)
hora_solicitada
string
Requested time (ISO 8601)
fecha_confirmada
string | null
Confirmed date (ISO 8601)
hora_confirmada
string | null
Confirmed time (ISO 8601)
sintomas
string | null
Patient symptoms description
estado
string
Appointment status: pendiente, confirmada, atendida, or cancelada
created_at
string
Creation timestamp
cliente
object
Public client information
id
number
Client ID
nombres
string
First name(s)
apellidos
string | null
Last name(s)
telefono
string
Phone number
email
string | null
Email address
medico
object | null
Assigned doctor information (null if not confirmed)
id
number
Doctor ID
persona_id
number
Person ID
especialidad_id
number
Specialty ID
persona
object
Doctor’s personal information
nombres
string
First name(s)
apellidos
string
Last name(s)
especialidad
object
Medical specialty
id
number
Specialty ID
nombre
string
Specialty name

Example Request

curl -X GET https://api.example.com/api/citas \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

[
  {
    "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": "confirmada",
    "created_at": "2026-03-05T10:00:00.000Z",
    "cliente": {
      "id": 5,
      "nombres": "María",
      "apellidos": "González",
      "telefono": "+50312345678",
      "email": "[email protected]"
    },
    "medico": {
      "id": 2,
      "persona_id": 10,
      "especialidad_id": 1,
      "persona": {
        "nombres": "Carlos",
        "apellidos": "Ramírez"
      },
      "especialidad": {
        "id": 1,
        "nombre": "Medicina General"
      }
    }
  },
  {
    "id": 2,
    "cliente_id": 6,
    "medico_id": null,
    "fecha_solicitada": "2026-03-16T00:00:00.000Z",
    "hora_solicitada": "1970-01-01T10:00:00.000Z",
    "fecha_confirmada": null,
    "hora_confirmada": null,
    "sintomas": "Fiebre y tos",
    "estado": "pendiente",
    "created_at": "2026-03-05T11:30:00.000Z",
    "cliente": {
      "id": 6,
      "nombres": "Juan",
      "apellidos": "Pérez",
      "telefono": "+50387654321",
      "email": null
    },
    "medico": null
  }
]

Error Responses

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"
}
500 Internal Server Error
Server error while retrieving appointments
{
  "message": "Error al listar citas"
}

Build docs developers (and LLMs) love