Estás integrando la API pública de Telepatia Synapse.
Endpoint: POST /v1/institutional/accounts
Base URL: https://scribe-api.telepatia.ai
Auth: Authorization: Bearer ${SYNAPSE_API_KEY}
Solicitud:
- email [body]: string (requerido, maxLength=254)
- doctorSpecialties [body]: array<MedicalSpecialty> (requerido, minItems=1) — Accepts either the specialty key ('CARDIOLOGY') or value ('cardiology'); always persisted as the value.
- country [body]: string (opcional) — Country as ISO 3166-1 alpha-2 (e.g. 'CO', 'BR'). Also accepts alpha-3 ('COL') or the English country name ('COLOMBIA'); all are normalized to the alpha-2 code Telepatia stores. Omit to inherit the institution's country.
- language [body]: string (opcional) — Account UI/content language as ISO 639-1 (e.g. 'es', 'pt', 'en'). Omit to inherit the institution's language.
- timeZone [body]: string (opcional) — IANA time zone (e.g. 'America/Bogota', 'America/Sao_Paulo'). Omit to inherit the institution's time zone.
- nameFull [body]: string (opcional, maxLength=500)
- institutionalBranchName [body]: string (opcional, maxLength=255)
- internalCode [body]: string (opcional, maxLength=128) — Idempotency key scoped to the institution. Re-submitting the same value returns 409 if the account already exists. Omit to have the server generate a UUID v7 (no idempotency when generated); the value is returned in the response.
- apiKeyConfig [body]: object (opcional) — Configuration for the API key minted with the new account.
Éxito 201:
- id: string
- email: string
- apiKey: string
- publishableApiKey?: string
- internalCode: string
- expiresAt?: string
- apiKeyExpiresInDays: integer
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.