Skip to content
Start here

Rules

List token validation rules
token_validation.rules.list(RuleListParams**kwargs) -> SyncV4PagePaginationArray[TokenValidationRule]
GET/zones/{zone_id}/token_validation/rules
Create a token validation rule
token_validation.rules.create(RuleCreateParams**kwargs) -> TokenValidationRule
POST/zones/{zone_id}/token_validation/rules
Bulk create token validation rules
token_validation.rules.bulk_create(RuleBulkCreateParams**kwargs) -> SyncSinglePage[TokenValidationRule]
POST/zones/{zone_id}/token_validation/rules/bulk
Bulk edit token validation rules
token_validation.rules.bulk_edit(RuleBulkEditParams**kwargs) -> SyncSinglePage[TokenValidationRule]
PATCH/zones/{zone_id}/token_validation/rules/bulk
Get a zone token validation rule
token_validation.rules.get(strrule_id, RuleGetParams**kwargs) -> TokenValidationRule
GET/zones/{zone_id}/token_validation/rules/{rule_id}
Delete a zone token validation rule
token_validation.rules.delete(strrule_id, RuleDeleteParams**kwargs) -> object
DELETE/zones/{zone_id}/token_validation/rules/{rule_id}
Edit a zone token validation rule
token_validation.rules.edit(strrule_id, RuleEditParams**kwargs) -> TokenValidationRule
PATCH/zones/{zone_id}/token_validation/rules/{rule_id}
ModelsExpand Collapse
class TokenValidationRule:

A Token Validation rule that can enforce security policies using JWT Tokens.

action: Literal["log", "block"]

Action to take on requests that match operations included in selector and fail expression.

One of the following:
"log"
"block"
description: str

A human-readable description that gives more details than title.

maxLength500
enabled: bool

Toggle rule on or off.

expression: str

Rule expression. Requests that fail to match this expression will be subject to action.

For details on expressions, see the Cloudflare Docs.

selector: Selector

Select operations covered by this rule.

For details on selectors, see the Cloudflare Docs.

exclude: Optional[List[SelectorExclude]]

Ignore operations that were otherwise included by include.

operation_ids: Optional[List[str]]

Excluded operation IDs.

include: Optional[List[SelectorInclude]]

Select all matching operations.

host: Optional[List[str]]

Included hostnames.

title: str

A human-readable name for the rule.

maxLength50
id: Optional[str]

UUID.

maxLength36
minLength36
created_at: Optional[datetime]
formatdate-time
last_updated: Optional[datetime]
formatdate-time