---
title: "Add A Pronunciation Dictionary"
method: POST
path: "/v1/pronunciation-dictionaries/add-from-rules"
tags: ["Pronunciation Dictionary"]
---

# Add A Pronunciation Dictionary

`POST /v1/pronunciation-dictionaries/add-from-rules`

Creates a new pronunciation dictionary from provided rules.

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

- BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromRulesPost
  - `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.
  - `name` string, required — The name of the pronunciation dictionary, used for identification only.
  - `description` string, nullable — A description of the pronunciation dictionary, used for identification only.
  - `workspace_access` 'admin' | 'editor' | 'commenter' | 'viewer', nullable — Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access.

## Response `200`

Successful Response

- AddPronunciationDictionaryResponseModel
  - `id` string, required — The ID of the created pronunciation dictionary.
  - `name` string, required — The name of the created pronunciation dictionary.
  - `created_by` string, required — The user ID of the creator of the pronunciation dictionary.
  - `creation_time_unix` integer, required — The creation time of the pronunciation dictionary in Unix timestamp.
  - `version_id` string, required — The ID of the created pronunciation dictionary version.
  - `version_rules_num` integer, required — The number of rules in the version of the pronunciation dictionary.
  - `description` string, nullable — The description of the pronunciation dictionary.
  - `permission_on_resource` 'admin' | 'editor' | 'commenter' | 'viewer', nullable, required — The permission on the resource 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/f053c821dc18/schema)
