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.

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.

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

Parameters
account_id: string

Identifier

list_id: string

The unique ID of the list.

cursor: string
Optional

The pagination cursor. An opaque string token indicating the position from which to continue when requesting the next/previous set of records. Cursor values are provided under result_info.cursors in the response. You should make no assumptions about a cursor's content or length.

per_page: number
Optional

Amount of results to include in each paginated response. A non-negative 32 bit integer.

search: string
Optional

A search query to filter returned items. Its meaning depends on the list type: IP addresses must start with the provided string, hostnames and bulk redirects must contain the string, and ASNs must match the string exactly.

Response fields
errors: Array<>
messages: Array<>
result: Array<string | | | 1 more...>
success: true

Whether the API call was successful

result_info: { cursors }
Optional
Request example
200Example
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 }