Você está integrando a API pública da Telepatia Synapse.
Endpoint: GET /v1/scribe-sessions/{id}
Base URL: https://scribe-api.telepatia.ai
Auth: Authorization: Bearer ${SYNAPSE_API_KEY}
Requisição:
- id [path]: string (obrigatório, pattern=^[a-zA-Z0-9_-]+$, minLength=1, maxLength=128) — A sessão a buscar — seu consultationInternalId, ou o id da sessão (ss_...) que a API retorna.
Sucesso 200:
- id: string
- status: string
- createdAt?: string
- completedAt?: string
- patientName?: string
- scribeSessionModality?: string
- consultationInternalId?: string
- specialty?: string
Erros (envelope: { error: { type, code, message, param? } }):
- 400: parameter_invalid, account_invalid
- 401: authentication_required
- 404: resource_not_found
- 428: cdss_review_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.