---
title: "Add Rules To The Pronunciation Dictionary"
method: POST
path: "/v1/pronunciation-dictionaries/{pronunciation_dictionary_id}/add-rules"
tags: ["Pronunciation Dictionary"]
---

# Add Rules To The Pronunciation Dictionary

`POST /v1/pronunciation-dictionaries/{pronunciation_dictionary_id}/add-rules`

## Request

- Base URL: `https://api.elevenlabs.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.elevenlabs.io/v1/pronunciation-dictionaries/{pronunciation_dictionary_id}/add-rules`
- Auth: none declared

Add rules to the pronunciation dictionary. If a rule with the same string_to_replace already exists, it will be replaced.

## Path parameters

- `pronunciation_dictionary_id` string, required: The id of the pronunciation dictionary

## Headers

- `xi-api-key` string, nullable: Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

## Request body

- BodyAddRulesToThePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdAddRulesPost
  - `rules` union[], required: List of pronunciation rules. Rule can be either: an alias rule: {'string_to_replace': 'a', 'type': 'alias', 'alias': 'b', } or a phoneme rule: {'string_to_replace': 'a', 'type': 'phoneme', 'phoneme': 'b', 'alphabet': 'ipa' }
    - union
      - PronunciationDictionaryAliasRuleRequestModel
        - `string_to_replace` string, required: The string to replace. Must be a non-empty string.
        - `case_sensitive` boolean: Whether the rule should match case-sensitively.
        - `word_boundaries` boolean: Whether the rule should only match at word boundaries.
        - `type` 'alias', required: The type of the rule.
        - `alias` string, required: The alias for the string to be replaced.
      - PronunciationDictionaryPhonemeRuleRequestModel
        - `string_to_replace` string, required: The string to replace. Must be a non-empty string.
        - `case_sensitive` boolean: Whether the rule should match case-sensitively.
        - `word_boundaries` boolean: Whether the rule should only match at word boundaries.
        - `type` 'phoneme', required: The type of the rule.
        - `phoneme` string, required: The phoneme rule.
        - `alphabet` string, required: The alphabet to use with the phoneme rule.

## Response `200`

Successful Response

- PronunciationDictionaryRulesResponseModel
  - `id` string, required: The ID of the pronunciation dictionary.
  - `version_id` string, required: The version ID of the pronunciation dictionary.
  - `version_rules_num` integer, required: The number of rules in the version of the pronunciation dictionary.

## Other responses

- `422`: Validation Error

## Changes

- **2026-04-03** `deb5e58ddddf`: 4 info
  - added the new optional request property `rules/items/anyOf[subschema #1: PronunciationDictionaryAliasRuleRequestModel]/case_sensitive`
  - added the new optional request property `rules/items/anyOf[subschema #1: PronunciationDictionaryAliasRuleRequestModel]/word_boundaries`
  - added the new optional request property `rules/items/anyOf[subschema #2: PronunciationDictionaryPhonemeRuleRequestModel]/case_sensitive`
  - added the new optional request property `rules/items/anyOf[subschema #2: PronunciationDictionaryPhonemeRuleRequestModel]/word_boundaries`
- **2026-02-08** `5b595807512c`: 1 info
  - api operation id `Add_rules_to_the_pronunciation_dictionary_v1_pronunciation_dictionaries__pronunciation_dictionary_id__add_rules_post` removed and replaced with `add_rules`
- **2025-05-16** `503db4198a44`: 4 breaking, 3 info
  - the `type` request property const value `alias` was added
  - the `type` request property const value `phoneme` was added
  - removed the enum value `alias` of the request property `rules/items/anyOf[subschema #1: PronunciationDictionaryAliasRuleRequestModel]/type`
  - removed the enum value `phoneme` of the request property `rules/items/anyOf[subschema #2: PronunciationDictionaryPhonemeRuleRequestModel]/type`
  - …3 more
- **2024-05-07** `c1dd2ce19be9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/elevenlabs/apis/elevenlabs-api-documentation/changes/v1/pronunciation-dictionaries/:pronunciation_dictionary_id/add-rules/post.md)

---

[API](https://skmtc.dev/elevenlabs/apis/elevenlabs-api-documentation.md) - [All operations](https://skmtc.dev/elevenlabs/apis/elevenlabs-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/elevenlabs/apis/elevenlabs-api-documentation/revisions/d04f5e77c40a?raw)
