# Rename dictionary (rename)

Rename a dictionary.

### 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](/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      | `rename`          | Action name.             |
| `name`     | string | Yes      |                   | Current dictionary name. |
| `new_name` | string | Yes      |                   | New dictionary name.     |

### Behavior

* Renames the dictionary.

### Response

* `name` in the response is the **new** name.
* `wordlist` is empty.

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

### Errors

Common errors:

* Dictionary name is missing, invalid, or longer than 50 characters.
  * This applies to both `name` and `new_name`.
* New name is the same as the current name.
* Target dictionary name already exists.

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

### Examples

<details>

<summary>Rename a dictionary</summary>

**Request body (JSON):**

```json
{
  "cmd": "user_dictionary",
  "action": "rename",
  "name": "my_dict",
  "new_name": "my_dict_v2"
}
```

**Response (JSON):**

```json
{
  "name": "my_dict_v2",
  "action": "rename",
  "wordlist": [],
  "modificationTime": 1772124069
}
```

</details>


---

# 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/actions/rename-dictionary-rename.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.
