Rules Lists

rules

rules.lists

Methods

Create A List -> Envelope<>
post/accounts/{account_id}/rules/lists

Creates a new list of the specified type.

Delete A List -> Envelope<{ id }>
delete/accounts/{account_id}/rules/lists/{list_id}

Deletes a specific list and all its items.

Get A List -> Envelope<>
get/accounts/{account_id}/rules/lists/{list_id}

Fetches the details of a list.

Get Lists -> SinglePage<>
get/accounts/{account_id}/rules/lists

Fetches all lists in the account.

Update A List -> Envelope<>
put/accounts/{account_id}/rules/lists/{list_id}

Updates the description of a list.

Security
API Email + API Key

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

Example: X-Auth-Email: user@example.com

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

Example: X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194

Accepted Permissions (at least one required)

Account Rule Lists Write

Parameters
account_id: string

Identifier

list_id: string

The unique ID of the list.

Response fields
errors: Array<>
messages: Array<>
result:
success: true

Whether the API call was successful

Request example
200Example

Domain types

Hostname = { url_hostname }
ListsList = { id, created_on, description, 5 more... }
Redirect = { source_url, target_url, include_subdomains, 4 more... }
Rules ListsLists

Bulk Operations

rules.lists.bulk_operations

Methods

Get Bulk Operation Status -> Envelope<{ id, status, completed, 1 more... }>
get/accounts/{account_identifier}/rules/lists/bulk_operations/{operation_id}

Gets the current status of an asynchronous operation on a list.

The status property can have one of the following values: pending, running, completed, or failed. If the status is failed, the error property will contain a message describing the error.

Domain types

OperationStatus = "pending" | "running" | "completed" | 1 more...

rules.lists.items

Methods

Create List Items -> Envelope<{ operation_id }>
post/accounts/{account_id}/rules/lists/{list_id}/items

Appends new items to the list.

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

Delete List Items -> Envelope<{ operation_id }>
delete/accounts/{account_id}/rules/lists/{list_id}/items

Removes one or more items from a list.

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

Get A List Item -> Envelope<string | | | 1 more...>
get/accounts/{account_identifier}/rules/lists/{list_id}/items/{item_id}

Fetches a list item in the list.

Get List Items -> CursorPagination<string | | | 1 more...>
get/accounts/{account_id}/rules/lists/{list_id}/items

Fetches all the items in the list.

Update All List Items -> Envelope<{ operation_id }>
put/accounts/{account_id}/rules/lists/{list_id}/items

Removes all existing items from the list and adds the provided items to the list.

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

Domain types

ListCursor = { after, before }
ListItem = { operation_id }