Skip to content
Start here

Rules

List token validation rules
GET/zones/{zone_id}/token_validation/rules
Create a token validation rule
POST/zones/{zone_id}/token_validation/rules
Bulk create token validation rules
POST/zones/{zone_id}/token_validation/rules/bulk
Bulk edit token validation rules
PATCH/zones/{zone_id}/token_validation/rules/bulk
Get a zone token validation rule
GET/zones/{zone_id}/token_validation/rules/{rule_id}
Delete a zone token validation rule
DELETE/zones/{zone_id}/token_validation/rules/{rule_id}
Edit a zone token validation rule
PATCH/zones/{zone_id}/token_validation/rules/{rule_id}
ModelsExpand Collapse
TokenValidationRule = object { action, description, enabled, 6 more }

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

action: "log" or "block"

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

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

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

maxLength500
enabled: boolean

Toggle rule on or off.

expression: string

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

For details on expressions, see the Cloudflare Docs.

selector: object { exclude, include }

Select operations covered by this rule.

For details on selectors, see the Cloudflare Docs.

exclude: optional array of object { operation_ids }

Ignore operations that were otherwise included by include.

operation_ids: optional array of string

Excluded operation IDs.

include: optional array of object { host }

Select all matching operations.

host: optional array of string

Included hostnames.

title: string

A human-readable name for the rule.

maxLength50
id: optional string

UUID.

maxLength36
minLength36
created_at: optional string
formatdate-time
last_updated: optional string
formatdate-time
RuleDeleteResponse = unknown