---
title: Turnstile
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/typescript)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Turnstile

#### TurnstileWidgets

##### [List Turnstile Widgets](https://developers.cloudflare.com/api/typescript/resources/turnstile/subresources/widgets/methods/list)

client.turnstile.widgets.list(WidgetListParams { account\_id, direction, filter, 3 more } params, RequestOptionsoptions?): V4PagePaginationArray<[WidgetListResponse](https://developers.cloudflare.com/api/typescript/resources/turnstile#%28resource%29%20turnstile.widgets%20%3E%20%28model%29%20widget%5Flist%5Fresponse%20%3E%20%28schema%29) { bot\_fight\_mode, clearance\_level, created\_on, 8 more } \>

GET/accounts/{account\_id}/challenges/widgets

##### [Turnstile Widget Details](https://developers.cloudflare.com/api/typescript/resources/turnstile/subresources/widgets/methods/get)

client.turnstile.widgets.get(stringsitekey, WidgetGetParams { account\_id } params, RequestOptionsoptions?): [Widget](https://developers.cloudflare.com/api/typescript/resources/turnstile#%28resource%29%20turnstile.widgets%20%3E%20%28model%29%20widget%20%3E%20%28schema%29) { bot\_fight\_mode, clearance\_level, created\_on, 9 more } 

GET/accounts/{account\_id}/challenges/widgets/{sitekey}

##### [Create a Turnstile Widget](https://developers.cloudflare.com/api/typescript/resources/turnstile/subresources/widgets/methods/create)

client.turnstile.widgets.create(WidgetCreateParams { account\_id, domains, mode, 11 more } params, RequestOptionsoptions?): [Widget](https://developers.cloudflare.com/api/typescript/resources/turnstile#%28resource%29%20turnstile.widgets%20%3E%20%28model%29%20widget%20%3E%20%28schema%29) { bot\_fight\_mode, clearance\_level, created\_on, 9 more } 

POST/accounts/{account\_id}/challenges/widgets

##### [Update a Turnstile Widget](https://developers.cloudflare.com/api/typescript/resources/turnstile/subresources/widgets/methods/update)

client.turnstile.widgets.update(stringsitekey, WidgetUpdateParams { account\_id, domains, mode, 6 more } params, RequestOptionsoptions?): [Widget](https://developers.cloudflare.com/api/typescript/resources/turnstile#%28resource%29%20turnstile.widgets%20%3E%20%28model%29%20widget%20%3E%20%28schema%29) { bot\_fight\_mode, clearance\_level, created\_on, 9 more } 

PUT/accounts/{account\_id}/challenges/widgets/{sitekey}

##### [Delete a Turnstile Widget](https://developers.cloudflare.com/api/typescript/resources/turnstile/subresources/widgets/methods/delete)

client.turnstile.widgets.delete(stringsitekey, WidgetDeleteParams { account\_id } params, RequestOptionsoptions?): [Widget](https://developers.cloudflare.com/api/typescript/resources/turnstile#%28resource%29%20turnstile.widgets%20%3E%20%28model%29%20widget%20%3E%20%28schema%29) { bot\_fight\_mode, clearance\_level, created\_on, 9 more } 

DELETE/accounts/{account\_id}/challenges/widgets/{sitekey}

##### [Rotate Secret for a Turnstile Widget](https://developers.cloudflare.com/api/typescript/resources/turnstile/subresources/widgets/methods/rotate%5Fsecret)

client.turnstile.widgets.rotateSecret(stringsitekey, WidgetRotateSecretParams { account\_id, invalidate\_immediately } params, RequestOptionsoptions?): [Widget](https://developers.cloudflare.com/api/typescript/resources/turnstile#%28resource%29%20turnstile.widgets%20%3E%20%28model%29%20widget%20%3E%20%28schema%29) { 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](https://developers.cloudflare.com/api/typescript/resources/turnstile#%28resource%29%20turnstile.widgets%20%3E%20%28model%29%20widget%5Fdomain%20%3E%20%28schema%29)\>

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](https://developers.cloudflare.com/api/typescript/resources/turnstile#%28resource%29%20turnstile.widgets%20%3E%20%28model%29%20widget%5Fdomain%20%3E%20%28schema%29)\>

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