> 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/api-reference/user-custom-dictionary-api/actions/create-dictionary-create.md).

# Create dictionary (create)

Create a new 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      | `create`          | Action name.                            |
| `name`     | string | Yes      |                   | Dictionary name to create.              |
| `wordlist` | string | No       |                   | Optional comma-separated initial words. |

### Behavior

* Creates a new dictionary.
* Adds `wordlist` words if provided.

{% hint style="warning" %}
`create` fails if the dictionary already exists.

Use [addword(s)](/api-reference/user-custom-dictionary-api/actions/add-word-s-addword-addwords.md) if you want auto-create behavior.
{% endhint %}

### Response

Returns the created dictionary state.

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

### Errors

Common errors:

* Dictionary already exists.
* Dictionary name is missing, invalid, or longer than 50 characters.
* If `wordlist` is present:
  * a word is empty
  * a word contains forbidden symbols
  * a word is longer than 63 characters

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

### Examples

<details>

<summary>Create an empty dictionary</summary>

**Request body (JSON):**

```json
{
  "cmd": "user_dictionary",
  "action": "create",
  "name": "my_dict"
}
```

**Response (JSON):**

```json
{
  "name": "my_dict",
  "action": "create",
  "wordlist": [],
  "modificationTime": 1772124021
}
```

</details>

<details>

<summary>Create a dictionary with initial words</summary>

**Request body (JSON):**

```json
{
  "cmd": "user_dictionary",
  "action": "create",
  "name": "my_dict",
  "wordlist": "API,SDK"
}
```

**Response (JSON):**

```json
{
  "name": "my_dict",
  "action": "create",
  "wordlist": ["API", "SDK"],
  "modificationTime": 1772124021
}
```

</details>
