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

# Update a pronunciation dictionary

> Partial update. Any field you send replaces the stored value; sending `entries` replaces the whole list, and `description: ""` clears the note. Scope `pronunciation_dictionary:write` (admins only).



## OpenAPI

````yaml /api-reference/openapi.json patch /pronunciation-dictionaries/{dictionary_id}
openapi: 3.1.0
info:
  title: Lehar API
  version: v0
  description: >-
    Customer-facing REST API for the Lehar voice-AI platform. Platform-admin
    endpoints are intentionally excluded from this reference. Regenerate with
    `npm run sync:openapi`.
servers:
  - url: https://api.lehar.ai/ca/api/v0
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /pronunciation-dictionaries/{dictionary_id}:
    patch:
      tags:
        - Pronunciation Dictionaries
      summary: Update a pronunciation dictionary
      description: >-
        Partial update. Any field you send replaces the stored value; sending
        `entries` replaces the whole list, and `description: ""` clears the
        note. Scope `pronunciation_dictionary:write` (admins only).
      operationId: >-
        update_pronunciation_dictionary_ca_api_v0_pronunciation_dictionaries__dictionary_id__patch
      parameters:
        - name: dictionary_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                entries:
                  type: array
                  description: >-
                    Replacement rules, applied top to bottom. At most 500
                    entries; two entries may not share the same grapheme +
                    language.
                  items:
                    type: object
                    required:
                      - grapheme
                      - replacement
                    properties:
                      grapheme:
                        type: string
                        description: The written form to match (max 200 chars).
                      replacement:
                        type: string
                        description: What the agent should say instead (max 500 chars).
                      kind:
                        type: string
                        enum:
                          - substitution
                          - ipa
                        default: substitution
                        description: >-
                          `substitution` rewrites the text before speech and
                          works with every voice provider. `ipa` is reserved for
                          a future provider-native path — stored but not yet
                          applied.
                      language:
                        type: string
                        description: >-
                          Optional BCP-47 language tag (max 32 chars) that
                          scopes the rule to one language.
            example:
              entries:
                - grapheme: Lehar
                  replacement: luh-HAR
                  language: en
      responses:
        '200':
          description: Updated dictionary
          content:
            application/json:
              example:
                id: pd_01EXAMPLE
                name: Brand names
                description: How the agent should pronounce product and place names
                entries:
                  - grapheme: Lehar
                    replacement: luh-har
                    kind: substitution
                    language: en
                  - grapheme: Bengaluru
                    replacement: beng-uh-loo-roo
                    kind: substitution
                entry_count: 2
                created_by_user_id: user_01EXAMPLE
                created_at: '2026-08-24T10:00:00Z'
                updated_at: '2026-08-24T10:00:00Z'
        '404':
          description: Not found
        '409':
          description: A dictionary with this name already exists
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    BearerAuth:
      type: http
      scheme: bearer

````