You are integrating Telepatia Synapse Public API.
Endpoint: GET /v1/scribe-sessions/{id}/medical-record-documents
Base URL: https://synapse.telepatia.ai
Auth: Authorization: Bearer ${SYNAPSE_API_KEY}
Request:
- id [path]: string (required, pattern=^[a-zA-Z0-9_-]+$, minLength=1, maxLength=128) — The consultation internal ID to look up
- purpose [query]: string (optional, minLength=1, maxLength=255) — Optional filter — return only documents with this purpose.
Success 200:
- items: array<MedicalRecordDocumentItem>
- total: integer
Errors (envelope: { error: { type, code, message, param? } }):
- 400: parameter_missing, parameter_invalid, account_invalid
- 401: authentication_required
- 403: permission_denied
- 404: resource_not_found
- 503: service_unavailable
Generate code in the language of the current file that:
1. Reads SYNAPSE_API_KEY from env (do not hardcode it).
2. Calls the endpoint with typed request and response.
3. Maps the error envelope to typed exceptions per status code.
4. Adds one happy-path test using the Bearer token.
Doctor
Api.Medical Record Documents Listed
Copy into Cursor/Claude/Copilot to scaffold a GET /v1/scribe-sessions//medical-record-documents integration.
Drop this prompt into your AI coding assistant. It already includes the contract, auth, and error envelope so the generated code matches the production API.