---
title: Create list items
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/typescript)

[Rules Lists](https://developers.cloudflare.com/api/typescript/resources/rules)

[Lists](https://developers.cloudflare.com/api/typescript/resources/rules/subresources/lists)

[Items](https://developers.cloudflare.com/api/typescript/resources/rules/subresources/lists/subresources/items)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Create list items

client.rules.lists.items.create(stringlistID, ItemCreateParams {account\_id, body } params, RequestOptionsoptions?): [ItemCreateResponse](<https://developers.cloudflare.com/api/typescript/resources/rules#(resource)%20rules.lists.items%20%3E%20(model)%20item_create_response%20%3E%20(schema)>) {operation\_id }

POST/accounts/{account\_id}/rules/lists/{list\_id}/items

Appends new items to the list.

This operation is asynchronous. To get the current operation status, invoke the `Get bulk operation status` endpoint with the returned `operation_id`.

There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`Account Filter Lists Edit`

##### ParametersExpand Collapse

listID: string

The unique ID of the list.

maxLength32

minLength32

[Link to this property](<#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20list_id%20%3E%20(schema)>)

<details>

<summary>

params: ItemCreateParams {account\_id, body }

</summary>

account\_id: string

Path param: The Account ID for this resource.

maxLength32

minLength32

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

<details>

<summary>

body: Array&lt;ListsListItemIPComment {ip, comment } | ListsListItemRedirectComment {redirect, comment } | ListsListItemHostnameComment {hostname, comment } | ListsListItemASNComment {asn, comment } &gt;

Body param

</summary>

One of the following:

<details>

<summary>

ListsListItemIPComment {ip, comment }

</summary>

ip: string

An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR.

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%200%20%3E%20(property)%20ip">Link to this property</a>

comment?: string

Defines an informative summary of the list item.

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%200%20%3E%20(property)%20comment">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

ListsListItemRedirectComment {redirect, comment }

</summary>

<details>

<summary>

redirect: <a href="https://developers.cloudflare.com/api/typescript/resources/rules#(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)">Redirect</a> {source\_url, target\_url, include\_subdomains, 4 more }

The definition of the redirect.

</summary>

source\_url: string

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20source_url">Link to this property</a>

target\_url: string

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20target_url">Link to this property</a>

include\_subdomains?: boolean

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20include_subdomains">Link to this property</a>

preserve\_path\_suffix?: boolean

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20preserve_path_suffix">Link to this property</a>

preserve\_query\_string?: boolean

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20preserve_query_string">Link to this property</a>

<details>

<summary>

status\_code?: 301| 302| 307| 308

</summary>

One of the following:

301

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20status_code%20%3E%20(member)%200">Link to this property</a>

302

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20status_code%20%3E%20(member)%201">Link to this property</a>

307

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20status_code%20%3E%20(member)%202">Link to this property</a>

308

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20status_code%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20status_code">Link to this property</a>

subpath\_matching?: boolean

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20redirect%20%3E%20(schema)%20%3E%20(property)%20subpath_matching">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20redirect">Link to this property</a>

comment?: string

Defines an informative summary of the list item.

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201%20%3E%20(property)%20comment">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%201">Link to this property</a>

<details>

<summary>

ListsListItemHostnameComment {hostname, comment }

</summary>

<details>

<summary>

hostname: <a href="https://developers.cloudflare.com/api/typescript/resources/rules#(resource)%20rules.lists%20%3E%20(model)%20hostname%20%3E%20(schema)">Hostname</a> {url\_hostname, exclude\_exact\_hostname }

Hostnames support ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (\*), and the hyphen (-).

</summary>

url\_hostname: string

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%202%20%3E%20(property)%20hostname%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20hostname%20%3E%20(schema)%20%3E%20(property)%20url_hostname">Link to this property</a>

exclude\_exact\_hostname?: boolean

Only applies to wildcard hostnames (e.g., \*.example.com). When true (default), the rule blocks only subdomains. When false, the rule blocks both the root domain and subdomains.

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%202%20%3E%20(property)%20hostname%20%2B%20(resource)%20rules.lists%20%3E%20(model)%20hostname%20%3E%20(schema)%20%3E%20(property)%20exclude_exact_hostname">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%202%20%3E%20(property)%20hostname">Link to this property</a>

comment?: string

Defines an informative summary of the list item.

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%202%20%3E%20(property)%20comment">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%202">Link to this property</a>

<details>

<summary>

ListsListItemASNComment {asn, comment }

</summary>

asn: number

Defines a non-negative 32 bit integer.

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%203%20%3E%20(property)%20asn">Link to this property</a>

comment?: string

Defines an informative summary of the list item.

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%203%20%3E%20(property)%20comment">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(items)%20%3E%20(variant)%203">Link to this property</a>

</details>

<a href="#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20body">Link to this property</a>

</details>

[Link to this property](<#(resource)%20rules.lists.items%20%3E%20(method)%20create%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

ItemCreateResponse {operation\_id }

</summary>

operation\_id: string

The unique operation ID of the asynchronous action.

<a href="#(resource)%20rules.lists.items%20%3E%20(model)%20item_create_response%20%3E%20(schema)%20%3E%20(property)%20operation_id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20rules.lists.items%20%3E%20(model)%20item_create_response%20%3E%20(schema)>)

### Create list items

TypeScript

HTTPTypeScriptPythonGoTerraform

```
import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const item = await client.rules.lists.items.create('2c0fc9fa937b11eaa1b71c4d701ab86e', {
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
  body: [{ ip: '10.0.0.1' }],
});

console.log(item.operation_id);
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "operation_id": "4da8780eeb215e6cb7f48dd981c4ea02"
  },
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "operation_id": "4da8780eeb215e6cb7f48dd981c4ea02"
  },
  "success": true
}
```