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

# Update a doctor account

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

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

Endpoint: PATCH /v1/institutional/accounts/{account_id}
Base URL: https://scribe-api.telepatia.ai
Auth: Authorization: Bearer ${SYNAPSE_API_KEY}
Key: institutional API key only. A doctor API key gets 403 permission_denied.

Request:
- account_id [path]: string (required)
- nameFull [body]: string (optional, minLength=1, maxLength=500)
- doctorSpecialties [body]: array<MedicalSpecialty> (optional, minItems=1) — Replaces the account's specialties. Accepts either the specialty key ('CARDIOLOGY') or value ('cardiology'); always persisted as the value.
- internalCode [body]: string (optional, minLength=1, maxLength=128) — Your institution's code for this account. It can be set only on an account that has no internalCode, for example an account created through an invitation. Sending the stored value again changes nothing. A different value returns 409: contact Telepatia support to change a stored code. Each internalCode identifies one account of your institution.

Success 200:
- id: string
- email: string
- nameFull?: string
- doctorSpecialties: array<MedicalSpecialty>
- enabled: boolean
- internalCode?: string
- roles?: array<string>
- createdAt: string

Errors (envelope: { error: { type, code, message, param? } }):
- 400: parameter_missing, parameter_invalid, account_invalid
- 401: authentication_required
- 403: permission_denied, permission_denied_role
- 404: resource_not_found
- 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 PATCH https://scribe-api.telepatia.ai/v1/institutional/accounts/{account_id} \
  -H "Authorization: Bearer $SYNAPSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "doctorSpecialties": [
    "cardiology"
  ],
  "internalCode": "DOC-001",
  "nameFull": "Dr. Juan P\u00e9rez"
}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.