> ## Documentation Index
> Fetch the complete documentation index at: https://docs.telepatia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Listar citas (agenda)

> Copia en Cursor/Claude/Copilot para generar una integración GET /v1/appointments.

Pega este prompt en tu asistente de programación con IA. Ya incluye el contrato, la autenticación y el envoltorio de errores, para que el código generado coincida con la API de producción.

<CodeGroup>
  ```text Prompt theme={null}
  Estás integrando la API pública de Telepatia Synapse.

  Endpoint: GET /v1/appointments
  Base URL: https://scribe-api.telepatia.ai
  Auth: Authorization: Bearer ${SYNAPSE_API_KEY}

  Solicitud:
  - startFrom [query]: string (opcional) — ISO-8601 lower bound on start (inclusive).
  - startTo [query]: string (opcional) — ISO-8601 upper bound on start (inclusive).
  - status [query]: array<AppointmentStatus> (opcional) — Filter by one or more statuses (repeatable).
  - consultationInternalId [query]: string (opcional) — Filter to the booking that carries this consultation id.
  - page [query]: integer (opcional, min=1) — Page number (1-based).
  - limit [query]: integer (opcional, min=1, max=50) — Number of items per page.

  Éxito 200:
  - items: array<AppointmentResponse>
  - total?: integer
  - page: integer
  - limit: integer
  - totalPages?: integer
  - hasMore: boolean

  Errores (envoltorio: { error: { type, code, message, param? } }):
  - 400: parameter_missing, parameter_invalid, account_invalid
  - 401: authentication_required
  - 503: service_unavailable

  Genera código en el lenguaje del archivo actual que:
  1. Lea SYNAPSE_API_KEY desde el entorno (no lo escribas de forma fija).
  2. Llame al endpoint con solicitud y respuesta tipadas.
  3. Asigne el envoltorio de errores a excepciones tipadas por código de estado.
  4. Agregue una prueba de flujo exitoso usando el token Bearer.
  ```

  ```bash curl theme={null}
  curl -X GET https://scribe-api.telepatia.ai/v1/appointments \
    -H "Authorization: Bearer $SYNAPSE_API_KEY"
  ```
</CodeGroup>
