# Errors reference

Errors use the standard HTTP API error format.

See [HTTP API Overview](/api-reference/overview.md#errors) and [HTTP response status codes](/api-reference/http-response-status-codes.md).

### Error response

Example:

```json
{
  "error": true,
  "is_critical": 0,
  "message": "Failed to add word. Word already exists.",
  "command": "user_dictionary"
}
```

### Error messages

Most failures follow the same structure:

* An **action-level prefix** (what the API tried to do).
* A **detail message** (why it failed).

Example message: "Failed to add word. Word already exists."

### Detail message reference (User Dictionary)

| What happened                                                               | Message                                                                                         | HTTP code |
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | --------- |
| Unknown action for this command                                             | Action not found.                                                                               | 404       |
| Dictionary name is missing                                                  | User dictionary name is empty.                                                                  | 400       |
| Dictionary name is too long                                                 | User dictionary name length exceeded. Up to 50 characters allowed.                              | 400       |
| Dictionary name contains forbidden characters                               | Invalid dictionary name. Use Latin letters and digits. No special characters or spaces allowed. | 400       |
| You tried to rename to the same name                                        | The new dictionary name should be different from the existing one.                              | 400       |
| Dictionary already exists                                                   | Dictionary already exists.                                                                      | 400       |
| Word already exists in the dictionary                                       | Word already exists.                                                                            | 400       |
| Word was not found in the dictionary                                        | Word doesn't exist.                                                                             | 404       |
| A required parameter is empty (for example, `word`, `wordlist`, `new_word`) | The '{param}' parameter is empty.                                                               | 400       |
| A word is too long                                                          | Word length exceeded. Up to 63 symbols allowed.                                                 | 400       |
| A word contains forbidden symbols                                           | Invalid word/wordlist. Punctuation, special characters or spaces aren't allowed.                | 400       |
| Dictionary reached maximum size                                             | Dictionary size (50 KB) exceeded. Consider using company-wide dictionary instead.               | 400       |

### Action-level failure prefixes

| Action          | Prefix                             |
| --------------- | ---------------------------------- |
| `create`        | Failed to create dictionary.       |
| `delete`        | Failed to delete dictionary.       |
| `rename`        | Failed to rename dictionary.       |
| `check`         | Failed to check dictionary status. |
| `addword(s)`    | Failed to add word.                |
| `deleteword(s)` | Failed to delete word.             |
| `editword`      | Failed to edit word.               |
| `getdict`       | Failed to get dictionary content.  |
| `setdict`       | Failed to set dictionary.          |

### Notes

#### Validation happens early

The API validates dictionary names and words during request parsing.

It rejects invalid input before running the action.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wproofreader.com/api-reference/user-custom-dictionary-api/errors-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
