Skip to main content
Save pronunciation rules once and reuse them by pronunciation_dictionary_id on any batch request or realtime reply.
A PronunciationDictionary object holds pronunciation rules for words such as brand names and acronyms. Pass its pronunciation_dictionary_id when you use batch or open a realtime reply. See Custom pronunciation for how rules work.
Lexicons are now pronunciation dictionaries: use pronunciation_dictionary_id in place of lexicon_id, and the /TTS/PronunciationDictionaries/ routes in place of the /TTS/Lexicons/ routes. A lexicon you created keeps its ID. The inline pronunciations field is no longer accepted: write a phoneme span in the text, or save the rules in a pronunciation dictionary.

The Pronunciation Dictionary Object

Attributes

string
Unique identifier for the dictionary. A new dictionary’s ID starts with pd_.
string
Your name for the dictionary. 1 to 100 characters. Two dictionaries can have the same name.
string
Your description. Up to 1,000 characters. Empty when you gave none.
array
Up to 100 rules.
integer
1 when the dictionary is created, and one more at each update. A request takes the latest version.
string
When the dictionary was created, in UTC.

Example Pronunciation Dictionary Object

A create, an update and a delete each answer after at least 2 seconds. Requests you send after the answer use the change.

Create a Pronunciation Dictionary

Create a dictionary. An organization can have up to 100: one more returns 400 invalid_request. A create with a name you already use makes another dictionary.

Arguments

string
required
Your name for the dictionary. 1 to 100 characters.
string
Your description. Up to 1,000 characters. Empty when left out.
array
required
Up to 100 rules. A rule outside its form returns 400 invalid_request with param naming it, for example rules.0.

Response

Returns the Pronunciation Dictionary object, with the request’s api_id and "message": "created".

Retrieve a Pronunciation Dictionary

Get one dictionary by its ID.

Arguments

No arguments required.

Response

Returns the Pronunciation Dictionary object, with the request’s api_id. Returns 404 not_found if the dictionary doesn’t exist in your organization.

List All Pronunciation Dictionaries

List every dictionary in your organization, ordered by name.

Arguments

No arguments. Query parameters aren’t accepted: one returns 400 invalid_request naming it.

Response

string
Unique identifier for the request.
object
limit, offset, total_count, next and previous. All dictionaries come back in one page.

Update a Pronunciation Dictionary

Change a dictionary’s name, description or rules. Its version goes up by one.

Arguments

Send only the fields to change. Each field you send replaces the stored one.
string
A new name. 1 to 100 characters.
string
A new description. Up to 1,000 characters.
array
A new list of up to 100 rules. It replaces the whole stored list.

Response

Returns the updated Pronunciation Dictionary object, with the request’s api_id. Returns 404 not_found if the dictionary doesn’t exist in your organization.

Delete a Pronunciation Dictionary

Permanently delete a dictionary.

Arguments

No arguments required.

Response

Returns 200 on success. Returns 404 not_found if the dictionary doesn’t exist in your organization.
Generating speech with a deleted or unknown pronunciation_dictionary_id returns 404 not_found with param: pronunciation_dictionary_id.