---
title: "Set Rules On The Pronunciation Dictionary"
method: POST
path: "/v1/pronunciation-dictionaries/{pronunciation_dictionary_id}/set-rules"
tags: ["Pronunciation Dictionary"]
---

# Set Rules On The Pronunciation Dictionary

`POST /v1/pronunciation-dictionaries/{pronunciation_dictionary_id}/set-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}/set-rules`
- Auth: none declared

Replaces all existing rules on the pronunciation dictionary with the provided ones.

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

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

Successfully set rules on the pronunciation dictionary

- 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`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/elevenlabs/apis/elevenlabs-api-documentation/changes/v1/pronunciation-dictionaries/:pronunciation_dictionary_id/set-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/45ddbf3e70c5?raw)
