Estás integrando la API pública de Telepatia Synapse.
Endpoint: POST /v1/institutional/branches
Base URL: https://scribe-api.telepatia.ai
Auth: Authorization: Bearer ${SYNAPSE_API_KEY}
Solicitud:
- name [body]: string (requerido, maxLength=255)
- type [body]: string (opcional, enum: single, multi) — Branch type — single site or multi-site.
- visible [body]: boolean (opcional)
- main [body]: boolean (opcional)
- order [body]: integer (opcional, min=0.0)
- description [body]: string (opcional, maxLength=1000)
- address [body]: string (opcional, maxLength=500)
- IPS [body]: array<string> (opcional)
- coordinates [body]: object (opcional) — Geographic coordinates of a branch.
- expectedConsultations [body]: integer (opcional, min=0.0)
- branchManagerAccountIds [body]: array<string> (opcional)
- cdssConfigurationId [body]: string (opcional)
- auditConfigurationId [body]: string (opcional)
- sessionStartLabel [body]: string (opcional, enum: consultation, reading) — Wording the scribe clients use on the start-session button.
Éxito 201:
- id: string
- name: string
- type?: string
- visible?: boolean
- main?: boolean
- order?: integer
- description?: string
- address?: string
- IPS?: array<string>
- coordinates?: object
- expectedConsultations?: integer
- branchManagerAccountIds?: array<string>
- cdssConfigurationId?: string
- auditConfigurationId?: string
- sessionStartLabel?: string
Errores (envoltorio: { error: { type, code, message, param? } }):
- 400: parameter_missing, parameter_invalid, account_invalid
- 401: authentication_required
- 403: permission_denied, permission_denied_role
- 409: resource_conflict
- 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.