Skip to content
Start here

Rules Lists

Rules ListsLists

Get lists
rules.lists.list(ListListParams**kwargs) -> SyncSinglePage[ListsList]
GET/accounts/{account_id}/rules/lists
Get a list
rules.lists.get(strlist_id, ListGetParams**kwargs) -> ListGetResponse
GET/accounts/{account_id}/rules/lists/{list_id}
Create a list
rules.lists.create(ListCreateParams**kwargs) -> ListCreateResponse
POST/accounts/{account_id}/rules/lists
Update a list
rules.lists.update(strlist_id, ListUpdateParams**kwargs) -> ListUpdateResponse
PUT/accounts/{account_id}/rules/lists/{list_id}
Delete a list
rules.lists.delete(strlist_id, ListDeleteParams**kwargs) -> ListDeleteResponse
DELETE/accounts/{account_id}/rules/lists/{list_id}
ModelsExpand Collapse
class Hostname:

Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).

url_hostname: str
exclude_exact_hostname: Optional[bool]

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

class ListsList:
id: str

The unique ID of the list.

maxLength32
minLength32
created_on: str

The RFC 3339 timestamp of when the list was created.

kind: Literal["ip", "redirect", "hostname", "asn"]

The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).

One of the following:
"ip"
"redirect"
"hostname"
"asn"
modified_on: str

The RFC 3339 timestamp of when the list was last modified.

name: str

An informative name for the list. Use this name in filter and rule expressions.

maxLength50
num_items: float

The number of items in the list.

num_referencing_filters: float

The number of filters referencing the list.

description: Optional[str]

An informative summary of the list.

maxLength500
class Redirect:

The definition of the redirect.

source_url: str
target_url: str
include_subdomains: Optional[bool]
preserve_path_suffix: Optional[bool]
preserve_query_string: Optional[bool]
status_code: Optional[Literal[301, 302, 307, 308]]
One of the following:
301
302
307
308
subpath_matching: Optional[bool]
class ListGetResponse:
id: str

The unique ID of the list.

maxLength32
minLength32
created_on: str

The RFC 3339 timestamp of when the list was created.

kind: Literal["ip", "redirect", "hostname", "asn"]

The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).

One of the following:
"ip"
"redirect"
"hostname"
"asn"
modified_on: str

The RFC 3339 timestamp of when the list was last modified.

name: str

An informative name for the list. Use this name in filter and rule expressions.

maxLength50
num_items: float

The number of items in the list.

num_referencing_filters: float

The number of filters referencing the list.

description: Optional[str]

An informative summary of the list.

maxLength500
class ListCreateResponse:
id: str

The unique ID of the list.

maxLength32
minLength32
created_on: str

The RFC 3339 timestamp of when the list was created.

kind: Literal["ip", "redirect", "hostname", "asn"]

The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).

One of the following:
"ip"
"redirect"
"hostname"
"asn"
modified_on: str

The RFC 3339 timestamp of when the list was last modified.

name: str

An informative name for the list. Use this name in filter and rule expressions.

maxLength50
num_items: float

The number of items in the list.

num_referencing_filters: float

The number of filters referencing the list.

description: Optional[str]

An informative summary of the list.

maxLength500
class ListUpdateResponse:
id: str

The unique ID of the list.

maxLength32
minLength32
created_on: str

The RFC 3339 timestamp of when the list was created.

kind: Literal["ip", "redirect", "hostname", "asn"]

The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).

One of the following:
"ip"
"redirect"
"hostname"
"asn"
modified_on: str

The RFC 3339 timestamp of when the list was last modified.

name: str

An informative name for the list. Use this name in filter and rule expressions.

maxLength50
num_items: float

The number of items in the list.

num_referencing_filters: float

The number of filters referencing the list.

description: Optional[str]

An informative summary of the list.

maxLength500
class ListDeleteResponse:
id: str

The unique ID of the list.

maxLength32
minLength32

Rules ListsListsBulk Operations

Get bulk operation status
rules.lists.bulk_operations.get(stroperation_id, BulkOperationGetParams**kwargs) -> BulkOperationGetResponse
GET/accounts/{account_id}/rules/lists/bulk_operations/{operation_id}
ModelsExpand Collapse
One of the following:
class ListsBulkOperationPendingOrRunning:
id: str

The unique operation ID of the asynchronous action.

status: Literal["pending", "running"]

The current status of the asynchronous operation.

One of the following:
"pending"
"running"
class ListsBulkOperationCompleted:
id: str

The unique operation ID of the asynchronous action.

completed: str

The RFC 3339 timestamp of when the operation was completed.

status: Literal["completed"]

The current status of the asynchronous operation.

class ListsBulkOperationFailed:
id: str

The unique operation ID of the asynchronous action.

completed: str

The RFC 3339 timestamp of when the operation was completed.

error: str

A message describing the error when the status is failed.

status: Literal["failed"]

The current status of the asynchronous operation.

Rules ListsListsItems

Get list items
rules.lists.items.list(strlist_id, ItemListParams**kwargs) -> SyncCursorPaginationAfter[ItemListResponse]
GET/accounts/{account_id}/rules/lists/{list_id}/items
Get a list item
rules.lists.items.get(stritem_id, ItemGetParams**kwargs) -> ItemGetResponse
GET/accounts/{account_id}/rules/lists/{list_id}/items/{item_id}
Create list items
rules.lists.items.create(strlist_id, ItemCreateParams**kwargs) -> ItemCreateResponse
POST/accounts/{account_id}/rules/lists/{list_id}/items
Update all list items
rules.lists.items.update(strlist_id, ItemUpdateParams**kwargs) -> ItemUpdateResponse
PUT/accounts/{account_id}/rules/lists/{list_id}/items
Delete list items
rules.lists.items.delete(strlist_id, ItemDeleteParams**kwargs) -> ItemDeleteResponse
DELETE/accounts/{account_id}/rules/lists/{list_id}/items
ModelsExpand Collapse
class ListCursor:
after: Optional[str]
before: Optional[str]
class ListItem:
operation_id: str

The unique operation ID of the asynchronous action.

One of the following:
class ListsListItemIPFull:
id: str

Defines the unique ID of the item in the List.

maxLength32
minLength32
created_on: str

The RFC 3339 timestamp of when the list was created.

ip: str

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

modified_on: str

The RFC 3339 timestamp of when the list was last modified.

comment: Optional[str]

Defines an informative summary of the list item.

class ListsListItemHostnameFull:
id: str

Defines the unique ID of the item in the List.

maxLength32
minLength32
created_on: str

The RFC 3339 timestamp of when the list was created.

hostname: Hostname

Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).

modified_on: str

The RFC 3339 timestamp of when the list was last modified.

comment: Optional[str]

Defines an informative summary of the list item.

class ListsListItemRedirectFull:
id: str

Defines the unique ID of the item in the List.

maxLength32
minLength32
created_on: str

The RFC 3339 timestamp of when the list was created.

modified_on: str

The RFC 3339 timestamp of when the list was last modified.

redirect: Redirect

The definition of the redirect.

comment: Optional[str]

Defines an informative summary of the list item.

class ListsListItemASNFull:
id: str

Defines the unique ID of the item in the List.

maxLength32
minLength32
asn: int

Defines a non-negative 32 bit integer.

created_on: str

The RFC 3339 timestamp of when the list was created.

modified_on: str

The RFC 3339 timestamp of when the list was last modified.

comment: Optional[str]

Defines an informative summary of the list item.

One of the following:
class ListsListItemIPFull:
id: str

Defines the unique ID of the item in the List.

maxLength32
minLength32
created_on: str

The RFC 3339 timestamp of when the list was created.

ip: str

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

modified_on: str

The RFC 3339 timestamp of when the list was last modified.

comment: Optional[str]

Defines an informative summary of the list item.

class ListsListItemHostnameFull:
id: str

Defines the unique ID of the item in the List.

maxLength32
minLength32
created_on: str

The RFC 3339 timestamp of when the list was created.

hostname: Hostname

Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-).

modified_on: str

The RFC 3339 timestamp of when the list was last modified.

comment: Optional[str]

Defines an informative summary of the list item.

class ListsListItemRedirectFull:
id: str

Defines the unique ID of the item in the List.

maxLength32
minLength32
created_on: str

The RFC 3339 timestamp of when the list was created.

modified_on: str

The RFC 3339 timestamp of when the list was last modified.

redirect: Redirect

The definition of the redirect.

comment: Optional[str]

Defines an informative summary of the list item.

class ListsListItemASNFull:
id: str

Defines the unique ID of the item in the List.

maxLength32
minLength32
asn: int

Defines a non-negative 32 bit integer.

created_on: str

The RFC 3339 timestamp of when the list was created.

modified_on: str

The RFC 3339 timestamp of when the list was last modified.

comment: Optional[str]

Defines an informative summary of the list item.

class ItemCreateResponse:
operation_id: str

The unique operation ID of the asynchronous action.

class ItemUpdateResponse:
operation_id: str

The unique operation ID of the asynchronous action.

class ItemDeleteResponse:
operation_id: str

The unique operation ID of the asynchronous action.