> For the complete documentation index, see [llms.txt](https://api-docs.speechace.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.speechace.com/api-reference/validate-text.md).

# Validate Text

{% hint style="info" %}
**Run in Postman:** [Validate text](https://docs.speechace.com/#00742f28-ea92-44ba-b174-631c4d854642)
{% endhint %}

The Validate Text API checks that every word in a piece of text is in the Speechace lexicon — a quick way to confirm authored content can be scored accurately before you use it in a scoring activity. Words not found in the lexicon can be reported to <support@speechace.com> for possible inclusion; alternatively, [Score Word](/api-reference/score-word.md) can score out-of-lexicon terms via `arpa_mark`, or you can let the API [automatically handle unknown words](/interpreting-results/automatic-handling-of-unknown-words.md).

### Request Format

The endpoint you use depends on the [region](/getting-started/api-regions-and-endpoints.md) of your subscription. For example, for US West the endpoint is <https://api.speechace.co>.

`POST` [`https://api.speechace.co/api/validating/text/v9/json`](https://api.speechace.co/api/validating/text/v9/json)

All parameters are passed in the query string; this request has no body or audio.

### Query Parameters

<table><thead><tr><th width="124">Parameter</th><th width="97">Type</th><th>Description</th></tr></thead><tbody><tr><td>key</td><td>String</td><td><em>API key issued by Speechace.</em></td></tr><tr><td>dialect</td><td>String</td><td><em>This is the dialect in which the speaker will be assessed. Supported only for en-us and en-gb.</em></td></tr><tr><td>text</td><td>String</td><td><em>A sentence or sequence of words to validate. For example:</em><br><em>- With unknown words:</em> <code>Validate these words existeee.</code><br>- <em>With known words:</em> <code>Validate these words exist.</code></td></tr></tbody></table>

### Request Examples

<table><thead><tr><th width="220">Example</th><th width="320">Query Parameters</th><th>When to use</th></tr></thead><tbody><tr><td>A. Unknown words</td><td><code>text="Validate these words existeee."</code></td><td><em>Detect words the lexicon does not recognise.</em></td></tr><tr><td>B. Known words</td><td><code>text="Validate these words exist."</code></td><td><em>Confirm all words are recognised and scorable.</em></td></tr></tbody></table>

### Response Examples

When an unknown word is found, the API returns the `error_unknown_words` [error](/getting-started/error-handling.md) with the offending word in `detail_message`. When all words are known, it returns `status: success`.

{% tabs %}
{% tab title="A. Unknown words" %}
{% code overflow="wrap" lineNumbers="true" expandable="true" collapsedlinecount="10" %}

```json
{
  "status": "error",
  "short_message": "error_unknown_words",
  "detail_message": "existeee"
}
```

{% endcode %}
{% endtab %}

{% tab title="B. Known words" %}
{% code overflow="wrap" lineNumbers="true" expandable="true" collapsedlinecount="10" %}

```json
{
  "status": "success",
  "quota_remaining": -1
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
