Skip to content
Start here

Turnstile

TurnstileWidgets

List Turnstile Widgets
client.turnstile.widgets.list(WidgetListParams { account_id, direction, filter, 3 more } params, RequestOptionsoptions?): V4PagePaginationArray<WidgetListResponse { bot_fight_mode, clearance_level, created_on, 8 more } >
GET/accounts/{account_id}/challenges/widgets
Turnstile Widget Details
client.turnstile.widgets.get(stringsitekey, WidgetGetParams { account_id } params, RequestOptionsoptions?): Widget { bot_fight_mode, clearance_level, created_on, 9 more }
GET/accounts/{account_id}/challenges/widgets/{sitekey}
Create a Turnstile Widget
client.turnstile.widgets.create(WidgetCreateParams { account_id, domains, mode, 11 more } params, RequestOptionsoptions?): Widget { bot_fight_mode, clearance_level, created_on, 9 more }
POST/accounts/{account_id}/challenges/widgets
Update a Turnstile Widget
client.turnstile.widgets.update(stringsitekey, WidgetUpdateParams { account_id, domains, mode, 6 more } params, RequestOptionsoptions?): Widget { bot_fight_mode, clearance_level, created_on, 9 more }
PUT/accounts/{account_id}/challenges/widgets/{sitekey}
Delete a Turnstile Widget
client.turnstile.widgets.delete(stringsitekey, WidgetDeleteParams { account_id } params, RequestOptionsoptions?): Widget { bot_fight_mode, clearance_level, created_on, 9 more }
DELETE/accounts/{account_id}/challenges/widgets/{sitekey}
Rotate Secret for a Turnstile Widget
client.turnstile.widgets.rotateSecret(stringsitekey, WidgetRotateSecretParams { account_id, invalidate_immediately } params, RequestOptionsoptions?): Widget { bot_fight_mode, clearance_level, created_on, 9 more }
POST/accounts/{account_id}/challenges/widgets/{sitekey}/rotate_secret
ModelsExpand Collapse
Widget { bot_fight_mode, clearance_level, created_on, 9 more }

A Turnstile widget's detailed configuration

bot_fight_mode: boolean

If bot_fight_mode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).

clearance_level: "no_clearance" | "jschallenge" | "managed" | "interactive"

If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance, this setting can determine the clearance level to be set

One of the following:
"no_clearance"
"jschallenge"
"managed"
"interactive"
created_on: string

When the widget was created.

formatdate-time
domains: Array<WidgetDomain>
maxLength10
ephemeral_id: boolean

Return the Ephemeral ID in /siteverify (ENT only).

mode: "non-interactive" | "invisible" | "managed"

Widget Mode

One of the following:
"non-interactive"
"invisible"
"managed"
modified_on: string

When the widget was modified.

formatdate-time
name: string

Human readable widget name. Not unique. Cloudflare suggests that you set this to a meaningful string to make it easier to identify your widget, and where it is used.

maxLength254
minLength1
offlabel: boolean

Do not show any Cloudflare branding on the widget (ENT only).

region: "world" | "china"

Region where this widget can be used. This cannot be changed after creation.

One of the following:
"world"
"china"
secret: string

Secret key for this widget.

sitekey: string

Widget item identifier tag.

maxLength32
WidgetDomain = string

Hosts as a hostname or IPv4/IPv6 address represented by strings. The widget will only work on these domains, and their subdomains.

WidgetListResponse { bot_fight_mode, clearance_level, created_on, 8 more }

A Turnstile Widgets configuration as it appears in listings

bot_fight_mode: boolean

If bot_fight_mode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).

clearance_level: "no_clearance" | "jschallenge" | "managed" | "interactive"

If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance, this setting can determine the clearance level to be set

One of the following:
"no_clearance"
"jschallenge"
"managed"
"interactive"
created_on: string

When the widget was created.

formatdate-time
domains: Array<WidgetDomain>
maxLength10
ephemeral_id: boolean

Return the Ephemeral ID in /siteverify (ENT only).

mode: "non-interactive" | "invisible" | "managed"

Widget Mode

One of the following:
"non-interactive"
"invisible"
"managed"
modified_on: string

When the widget was modified.

formatdate-time
name: string

Human readable widget name. Not unique. Cloudflare suggests that you set this to a meaningful string to make it easier to identify your widget, and where it is used.

maxLength254
minLength1
offlabel: boolean

Do not show any Cloudflare branding on the widget (ENT only).

region: "world" | "china"

Region where this widget can be used. This cannot be changed after creation.

One of the following:
"world"
"china"
sitekey: string

Widget item identifier tag.

maxLength32