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

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

---

[API](https://skmtc.net/elevenlabs/apis/elevenlabs-api-documentation.md) · [All operations](https://skmtc.net/elevenlabs/apis/elevenlabs-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elevenlabs/elevenlabs-api-documentation/revisions/e77a0a530a82/schema)
