> ## Documentation Index
> Fetch the complete documentation index at: https://docs.telepatia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a doctor account

> Copy into Cursor/Claude/Copilot to scaffold a POST /v1/institutional/accounts 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.

<CodeGroup>
  ```text Prompt theme={null}
  You are integrating Telepatia Synapse Public API.

  Endpoint: POST /v1/institutional/accounts
  Base URL: https://scribe-api.telepatia.ai
  Auth: Authorization: Bearer ${SYNAPSE_API_KEY}

  Request:
  - email [body]: string (required, maxLength=254)
  - doctorSpecialties [body]: array<MedicalSpecialty> (required, minItems=1) — Accepts either the specialty key ('CARDIOLOGY') or value ('cardiology'); always persisted as the value.
  - country [body]: string (optional) — 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 (optional) — Account UI/content language as ISO 639-1 (e.g. 'es', 'pt', 'en'). Omit to inherit the institution's language.
  - timeZone [body]: string (optional) — IANA time zone (e.g. 'America/Bogota', 'America/Sao_Paulo'). Omit to inherit the institution's time zone.
  - nameFull [body]: string (optional, maxLength=500)
  - institutionalBranchName [body]: string (optional, maxLength=255)
  - internalCode [body]: string (optional, 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 (optional) — Configuration for the API key minted with the new account.

  Success 201:
  - id: string
  - email: string
  - apiKey: string
  - publishableApiKey?: string
  - internalCode: string
  - expiresAt?: string
  - apiKeyExpiresInDays: integer

  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.
  ```

  ```bash curl theme={null}
  curl -X POST https://scribe-api.telepatia.ai/v1/institutional/accounts \
    -H "Authorization: Bearer $SYNAPSE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "apiKeyConfig": {
      "validForDays": 365
    },
    "country": "CO",
    "doctorSpecialties": [
      "cardiology"
    ],
    "email": "dr.juan@clinica.com",
    "institutionalBranchName": "Sede Norte",
    "internalCode": "DOC-001",
    "language": "es",
    "nameFull": "Dr. Juan P\u00e9rez",
    "timeZone": "America/Bogota"
  }'
  ```
</CodeGroup>
