Skip to main content
POST
/
api
/
v1
/
pronunciation-dictionaries
/
{providerId}
/
add-rules
Add pronunciation rules
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({rules: [{text: '<string>', alias: '<string>'}]})
};

fetch('https://blackbox.dasha.ai/api/v1/pronunciation-dictionaries/{providerId}/add-rules', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "providerId": "<string>",
  "provider": "<string>",
  "orgId": "<string>",
  "contentHash": "<string>",
  "content": [
    {
      "type": "alias",
      "text": "<string>",
      "alias": "<string>"
    }
  ],
  "name": "<string>",
  "createdTime": "2023-11-07T05:31:56Z",
  "lastUpdatedTime": "2023-11-07T05:31:56Z"
}

Provider Restrictions

Some providers have restrictions on rule types:
  • Certain providers may only support alias rules
  • Phoneme rules may require specific phonetic alphabet formats
If you attempt to add an unsupported rule type, you will receive a 400 Bad Request error.

Path Parameters

providerId
string
required

Dictionary identifier

Body

Rules to add

Request to add new pronunciation rules to an existing pronunciation dictionary. If a rule with the same text already exists in the dictionary, it will be replaced with the new rule. The dictionary's content hash and last updated timestamp will be updated after the operation.

rules
object[]
required

Pronunciation rules to add to the dictionary. Each rule specifies a word or phrase to match and how it should be pronounced using either alias (text replacement) or phonetic representation. If a rule with the same text already exists, the existing rule will be replaced with the new one.

Minimum array length: 1

Base class for pronunciation rules that control how specific text is spoken during TTS synthesis. Rules use polymorphic serialization with a type discriminator to support different pronunciation methods (alias or phonetic).

Response

Pronunciation rules added successfully

Pronunciation dictionary information including rules, metadata, and provider details. Contains all data needed to use the dictionary with TTS voices and track changes over time.

providerId
string
required

Unique identifier assigned by the TTS provider. Used to reference this dictionary when configuring voices or making API calls to the provider.

Minimum string length: 1
provider
string
required

TTS provider that hosts this pronunciation dictionary. Supported providers: ElevenLabs, Cartesia. The dictionary can only be used with voices from the same provider.

Minimum string length: 1
orgId
string
required

Organization that owns this pronunciation dictionary. Used for access control and resource management.

Minimum string length: 1
contentHash
string
required

Content hash for tracking dictionary changes. This hash changes whenever rules are added, removed, or modified, allowing you to detect updates without comparing full rule lists.

Minimum string length: 1
content
object[]
required

Pronunciation rules defining how specific words and phrases should be spoken. Each rule specifies text to match and its pronunciation using either alias (alternative text) or phonetic representation.

Base class for pronunciation rules that control how specific text is spoken during TTS synthesis. Rules use polymorphic serialization with a type discriminator to support different pronunciation methods (alias or phonetic).

name
string
required

Display name for the pronunciation dictionary. Used to identify and organize dictionaries in your account.

Minimum string length: 1
createdTime
string<date-time>
required

Timestamp when the pronunciation dictionary was originally created.

lastUpdatedTime
string<date-time>
required

Timestamp when the pronunciation dictionary was last modified. Updates when rules are added, removed, or the name is changed.