> ## 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 agendamentos (agenda)

> Copie para o Cursor/Claude/Copilot para gerar uma integração GET /v1/appointments.

Cole este prompt no seu assistente de programação com IA. Ele já inclui o contrato, a autenticação e o envelope de erros, para que o código gerado corresponda à API de produção.

<CodeGroup>
  ```text Prompt theme={null}
  Você está integrando a API pública da Telepatia Synapse.

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

  Requisição:
  - 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.

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

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

  Gere código na linguagem do arquivo atual que:
  1. Leia SYNAPSE_API_KEY do ambiente (não fixe o valor no código).
  2. Chame o endpoint com requisição e resposta tipadas.
  3. Mapeie o envelope de erros para exceções tipadas por código de status.
  4. Adicione um teste de caminho feliz usando o token Bearer.
  ```

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