You are integrating Telepatia Synapse Public API.
Endpoint: POST /v1/medical-record-configurations
Base URL: https://scribe-api.telepatia.ai
Auth: Authorization: Bearer ${SYNAPSE_API_KEY}
Request:
- name [body]: string (optional, maxLength=200) — Human-readable display name. Defaults to the public id when omitted.
- description [body]: string (optional, maxLength=500) — Optional human-readable description of the template.
- specialty [body]: string (optional, enum: 219 values) — Medical specialty this template targets, given as the enum key (such as `GENERAL_MEDICINE`) or its camelCase value (such as `generalMedicine`). When set by an institutional API key, the template is distributed as a child copy to every enabled account in the institution that already carries this specialty. Accounts without this specialty are not targets, and a doctor API key never distributes. Distribution does not happen when the institution has template copies disabled. Optional; omitting it skips distribution.
- workflow [body]: string (optional, enum: defaultOutpatient, inpatient, emergencyRoom, reportDictation, historySummary) — Product discriminator for a template. Absent means an ordinary Scribe template.
`defaultOutpatient`, `inpatient`, and `emergencyRoom` also denote a Scribe
template; each names the clinical care setting the template is written for.
`reportDictation` and `historySummary` denote a non-Scribe product.
- configuration [body]: object (required) — Section map keyed by node key (schema + optional prompt strategy). A key is a stable identifier that matches `^[A-Za-z0-9_]+$` (ASCII letters, digits, underscore). Put display text in the section `schema.label`. An object schema gives `properties` as a map keyed by property key, or as the `[{key, schema}]` list that a GET returns; a key that repeats in the list gets 400. The order of the map or the list is the order of the properties.
Success 200:
- id: string
- name: string
- hash: string
- createdAt: string
- created: boolean
- example?: object
Errors (envelope: { error: { type, code, message, param? } }):
- 400: parameter_missing, parameter_invalid, account_invalid
- 401: authentication_required
- 409: resource_conflict
- 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.