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

# Criar uma conta de médico

> Copie para o Cursor/Claude/Copilot para gerar uma integração POST /v1/institutional/accounts.

Cole este prompt no seu assistente de programação com IA. Ele já inclui o contrato, a autenticação e o envelope de erros, para que o código gerado corresponda à API de produção.

<CodeGroup>
  ```text Prompt theme={null}
  Você está integrando a API pública da Telepatia Synapse.

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

  Requisição:
  - email [body]: string (obrigatório, maxLength=254)
  - doctorSpecialties [body]: array<MedicalSpecialty> (obrigatório, 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.

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

  Erros (envelope: { 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

  Gere código na linguagem do arquivo atual que:
  1. Leia SYNAPSE_API_KEY do ambiente (não fixe o valor no código).
  2. Chame o endpoint com requisição e resposta tipadas.
  3. Mapeie o envelope de erros para exceções tipadas por código de status.
  4. Adicione um teste de caminho feliz usando o token Bearer.
  ```

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