---
title: "Preview rule audio"
method: POST
path: "/rules/preview"
tags: ["Rules"]
---

# Preview rule audio

`POST /rules/preview`

## Request

- Base URL: `https://api.beyondwords.io/v1`
- URL: `https://api.beyondwords.io/v1/rules/preview`
- Auth: API key in header `X-Api-Key`

Generates preview audio for a pronunciation rule without saving it.

## Request body

- RequestBodyPreviewRule
  - `type` 'substitute' | 'say_as_word' | 'say_as_letter_sequence' | 'ipa_transcription' | 'pinyin_transcription' | 'jyutping_transcription': 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
  - `key` string: The exact text to match in content when previewing this rule
  - `value` string, nullable: Replacement text or phonetic transcription (depending on rule type)
  - `project` object, nullable
    - `id` integer: Project ID for the preview
  - `content` object, nullable
    - `id` string: Content ID for the preview
  - `language` object, nullable
    - `code` string: Language code (ISO 639-1 with optional region, e.g., en_GB)
  - `preview_voice` object, nullable
    - `id` integer: Voice ID to use for preview generation

## Response `200`

successful

## Changes

- **2026-11-03** `994b9853e685`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/beyondwords/apis/beyondwords-rest-api/changes/rules/preview/post.md)

---

[API](https://skmtc.dev/beyondwords/apis/beyondwords-rest-api.md) - [All operations](https://skmtc.dev/beyondwords/apis/beyondwords-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/beyondwords/apis/beyondwords-rest-api/revisions/994b9853e685?raw)
