POST
/
rules
Create
curl --request POST \
  --url https://api.beyondwords.io/v1/rules \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '{
  "key": "CO2",
  "value": "carbon dioxide",
  "type": "substitute",
  "project": {
    "id": 1
  },
  "content": {
    "id": "d8414aee-4171-419e-be42-bd57e9e2ccd2"
  }
}'
{
  "id": 1,
  "key": "CO2",
  "value": "Carbon dioxide",
  "type": "substitute",
  "project": {
    "id": 1,
    "name": "Test project"
  },
  "content": {
    "id": "d8414aee-4171-419e-be42-bd57e9e2ccd2",
    "title": "Unveiling the Catastrophic Consequences of Excess Carbon Dioxide Emissions"
  },
  "created": "2023-01-01 00:00:00 UTC",
  "updated": "2023-01-01 00:00:05 UTC"
}

Authorizations

X-Api-Key
string
header
required

Body

application/json
type
enum<string>

The rule type. Possible values are substitute, say_as_word, say_as_letter_sequence, ipa_transcription, pinyin_transcription, jyutping_transcription. Please note that not all voices support all rules

Available options:
substitute,
say_as_word,
say_as_letter_sequence,
ipa_transcription,
pinyin_transcription,
jyutping_transcription
key
string

The exact text to match in content when applying this rule

value
string | null

Replacement text or phonetic transcription (depending on rule type)

magic_ipa_used
boolean

When true, the Magic IPA feature was used to generate the transcription

project
object | null
content
object | null
language
object | null

Response

201 - application/json

successful

id
integer

Unique identifier for the rule

project
object | null
content
object | null
type
enum<string>

The rule type. Possible values are substitute, say_as_word, say_as_letter_sequence, ipa_transcription, pinyin_transcription, jyutping_transcription. Please note that not all voices support all rules

Available options:
substitute,
say_as_word,
say_as_letter_sequence,
ipa_transcription,
pinyin_transcription,
jyutping_transcription
preview_status
enum<string>

Status of preview generation for this rule

Available options:
processing,
processed,
error
language
object | null
preview_voice
object | null
preview_audio
object | null
key
string

The exact text to match in content when applying this rule

value
string | null

Replacement text or phonetic transcription (depending on rule type)

magic_ipa_used
boolean

When true, the Magic IPA feature was used to generate the transcription

created
string

Time at which the object was created (ISO 8601)

updated
string

Time at which the object was updated (ISO 8601)