Skip to content
Visit Firewall on GitHub
Set theme to dark (⇧+D)


To invoke a Cloudflare Rules Lists API operation, append the endpoint to the Cloudflare API base URL:

For authentication instructions, see Getting Started: Requests in the Cloudflare API documentation.

For help with endpoints and pagination, see Getting Started: Endpoints.

The Cloudflare Rules Lists API supports the operations outlined below. Visit the associated links for examples.

Manage lists

OperationMethod & EndpointNotes
Create ListPOST accounts/{account_id}/rules/listsCreates an empty list.
List ListsGET accounts/{account_id}/rules/listsFetch all lists for the account. (This request does not fetch the items in the lists.)
Get ListGET accounts/{account_id}/rules/lists/{list_id}Fetches a list by its id. (This request does not display the items in the list.)
Update ListPUT accounts/{account_id}/rules/lists/{list_id}

Updates the description of a list. You cannot edit the name or kind, and you cannot update items in a list.

To update an item in a list, use the Replace List Items operation.

Delete ListDELETE accounts/{account_id}/rules/lists/{list_id}Deletes the list, but only when no filters reference it.

Manage items in a list

Nearly all the operations for managing items in a Rules List are asynchronous. When you add or delete a large amount of items to or from a list, there may be a delay before the bulk operation is complete.

Asynchronous Rules Lists operations return an operation_id, which you can use to monitor the status of an API operation. To monitor the status of an asynchronous operation, use the Get Bulk Operation endpoint and specify the ID of the operation you want to monitor.

When you make requests to a list while a bulk operation on that list is in progress, the requests are queued and processed in sequence (first in, first out). Requests for successful asynchronous operations return an HTTP 201 status code.

OperationMethod & EndpointNotes
List ItemsGET accounts/{account_id}/rules/lists/{list_id}/items

Fetches all items in a list.

Items are sorted in ascending order by IP address.

CIDRs are sorted by IP address, then by the subnet mask.

Get List ItemGET accounts/{account_id}/rules/lists/{list_id}/items/{item_id}

Fetches an item from a list by ID.

Create List ItemsPOST accounts/{account_id}/rules/lists/{list_id}/items

Appends a new item or items to a list.

Replaces entries that already exist in the list, does not delete any items.

Overwrites the comment of the original item.

The response includes an operation_id.

Replace List ItemsPUT accounts/{account_id}/rules/lists/{list_id}/items

Deletes all current items in the list and replaces them with items.

When items is empty, deletes all items in the list.

The response includes an operation_id.

Delete List ItemsDELETE accounts/{account_id}/rules/lists/{list_id}/items

Deletes specified list items.

The response includes an operation_id.