> For the complete documentation index, see [llms.txt](https://docs.wproofreader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wproofreader.com/v6.11.1/api-reference/user-custom-dictionary-api/actions/edit-word-editword.md).

# Edit word (editword)

Replace one existing word with a new value.

### Parameters

These parameters work with any `cmd`.

| Name           | Type    | Required   | Description                                                                                                                                                                        |
| -------------- | ------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `serviceid`    | string  | Cloud only | Cloud API key. Required for Cloud requests. Not used on-premises.                                                                                                                  |
| `format`       | string  | No         | Response format. Values: `json` (default), `xml`.                                                                                                                                  |
| `callback`     | string  | No         | JSONP wrapper function name. Use only with `format=json`.                                                                                                                          |
| `short_answer` | boolean | No         | <p>JSON only. When <code>true</code>, shortens JSON keys to reduce payload size.<br>See <a href="/pages/VXTsQ0sY5BFRLUsqxnbL#boolean-parameter-values">boolean parameters</a>.</p> |

See [Overview](/v6.11.1/api-reference/overview.md#common-parameters) for details.

#### Command specific parameters

| Parameter  | Type   | Required | Default           | Notes                            |
| ---------- | ------ | -------- | ----------------- | -------------------------------- |
| `cmd`      | string | Yes      | `user_dictionary` | Command name.                    |
| `action`   | string | Yes      | `editword`        | Action name.                     |
| `name`     | string | Yes      |                   | Dictionary name.                 |
| `word`     | string | Yes      |                   | Existing word to replace.        |
| `new_word` | string | Yes      |                   | New word value.                  |
| `format`   | string | No       | `json`            | `json` or `xml`.                 |
| `callback` | string | No       |                   | JSONP callback name (JSON only). |

### Behavior

* Replaces `word` with `new_word`.

Notes:

* `word` must exist.
* `new_word` must not already exist.

### Response

Returns the edited words in `wordlist`.

See [Response format](/v6.11.1/api-reference/user-custom-dictionary-api/response-format.md).

### Errors

Common errors:

* Dictionary name is missing, invalid, or longer than 50 characters.
* `word` or `new_word` is empty.
* Original word was not found in the dictionary.
* New word already exists in the dictionary.
* New word contains forbidden symbols.
* New word is longer than 63 characters.

See [Errors reference](/v6.11.1/api-reference/user-custom-dictionary-api/errors-reference.md).

### Examples

<details>

<summary>Edit a word</summary>

**Request body (JSON):**

```json
{
  "cmd": "user_dictionary",
  "action": "editword",
  "name": "my_dict",
  "word": "Webspellchecker",
  "new_word": "WebSpellChecker"
}
```

**Response (JSON):**

```json
{
  "name": "my_dict",
  "action": "editword",
  "wordlist": ["WebSpellChecker"],
  "modificationTime": 1772124069
}
```

</details>
