---
title: Turnstile
---

[Skip to content](#_top)

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

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/go/resources/turnstile/subresources/widgets/methods/list)

client.Turnstile.Widgets.List(ctx, params) (\*V4PagePaginationArray\[[WidgetListResponse](<https://developers.cloudflare.com/api/go/resources/turnstile#(resource)%20turnstile.widgets%20%3E%20(model)%20WidgetListResponse%20%3E%20(schema)>)], error)

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

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

client.Turnstile.Widgets.Get(ctx, sitekey, query) (\*[Widget](<https://developers.cloudflare.com/api/go/resources/turnstile#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)>), error)

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

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

client.Turnstile.Widgets.New(ctx, params) (\*[Widget](<https://developers.cloudflare.com/api/go/resources/turnstile#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)>), error)

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

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

client.Turnstile.Widgets.Update(ctx, sitekey, params) (\*[Widget](<https://developers.cloudflare.com/api/go/resources/turnstile#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)>), error)

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

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

client.Turnstile.Widgets.Delete(ctx, sitekey, body) (\*[Widget](<https://developers.cloudflare.com/api/go/resources/turnstile#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)>), error)

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

##### [Rotate Secret for a Turnstile Widget](https://developers.cloudflare.com/api/go/resources/turnstile/subresources/widgets/methods/rotate_secret)

client.Turnstile.Widgets.RotateSecret(ctx, sitekey, params) (\*[Widget](<https://developers.cloudflare.com/api/go/resources/turnstile#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/challenges/widgets/{sitekey}/rotate\_secret

##### ModelsExpand Collapse

<details>

<summary>

type Widget struct{…}

A Turnstile widget’s detailed configuration

</summary>

BotFightMode bool

If bot\_fight\_mode is set to <code>true</code>, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20bot_fight_mode">Link to this property</a>

<details>

<summary>

ClearanceLevel WidgetClearanceLevel

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

</summary>

One of the following:

const WidgetClearanceLevelNoClearance WidgetClearanceLevel = "no\_clearance"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20clearance_level%20%3E%20(member)%200">Link to this property</a>

const WidgetClearanceLevelJschallenge WidgetClearanceLevel = "jschallenge"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20clearance_level%20%3E%20(member)%201">Link to this property</a>

const WidgetClearanceLevelManaged WidgetClearanceLevel = "managed"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20clearance_level%20%3E%20(member)%202">Link to this property</a>

const WidgetClearanceLevelInteractive WidgetClearanceLevel = "interactive"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20clearance_level%20%3E%20(member)%203">Link to this property</a>

</details>

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20clearance_level">Link to this property</a>

CreatedOn Time

When the widget was created.

formatdate-time

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20created_on">Link to this property</a>

Domains \[]<a href="https://developers.cloudflare.com/api/go/resources/turnstile#(resource)%20turnstile.widgets%20%3E%20(model)%20widget_domain%20%3E%20(schema)">WidgetDomain</a>

maxLength10

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20domains">Link to this property</a>

EphemeralID bool

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

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20ephemeral_id">Link to this property</a>

<details>

<summary>

Mode WidgetMode

Widget Mode

</summary>

One of the following:

const WidgetModeNonInteractive WidgetMode = "non-interactive"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%200">Link to this property</a>

const WidgetModeInvisible WidgetMode = "invisible"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%201">Link to this property</a>

const WidgetModeManaged WidgetMode = "managed"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20mode%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20mode">Link to this property</a>

ModifiedOn Time

When the widget was modified.

formatdate-time

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20modified_on">Link to this property</a>

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

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

Offlabel bool

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

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20offlabel">Link to this property</a>

<details>

<summary>

Region WidgetRegion

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

</summary>

One of the following:

const WidgetRegionWorld WidgetRegion = "world"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20region%20%3E%20(member)%200">Link to this property</a>

const WidgetRegionChina WidgetRegion = "china"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20region%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20region">Link to this property</a>

Secret string

Secret key for this widget.

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20secret">Link to this property</a>

Sitekey string

Unique identifier for a Turnstile widget.

maxLength32

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20sitekey">Link to this property</a>

<details>

<summary>

DeployedVia WidgetDeployedViaOptional

Origin that created this widget, recorded at creation time and immutable afterward. Server-derived from the create request; not client-settable. Omitted from the response for widgets created before this field existed.

</summary>

One of the following:

const WidgetDeployedViaWrangler WidgetDeployedVia = "wrangler"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20deployed_via%20%3E%20(member)%200">Link to this property</a>

const WidgetDeployedViaDashboard WidgetDeployedVia = "dashboard"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20deployed_via%20%3E%20(member)%201">Link to this property</a>

const WidgetDeployedViaSpin WidgetDeployedVia = "spin"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20deployed_via%20%3E%20(member)%202">Link to this property</a>

const WidgetDeployedViaAPI WidgetDeployedVia = "api"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20deployed_via%20%3E%20(member)%203">Link to this property</a>

const WidgetDeployedViaUnknown WidgetDeployedVia = "unknown"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20deployed_via%20%3E%20(member)%204">Link to this property</a>

</details>

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20deployed_via">Link to this property</a>

<details>

<summary>

LastModifiedVia WidgetLastModifiedViaOptional

Origin of the most recent mutation (create, update, delete, or secret rotation). Server-derived; not client-settable. Omitted for widgets last mutated before this field existed.

</summary>

One of the following:

const WidgetLastModifiedViaWrangler WidgetLastModifiedVia = "wrangler"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20last_modified_via%20%3E%20(member)%200">Link to this property</a>

const WidgetLastModifiedViaDashboard WidgetLastModifiedVia = "dashboard"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20last_modified_via%20%3E%20(member)%201">Link to this property</a>

const WidgetLastModifiedViaSpin WidgetLastModifiedVia = "spin"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20last_modified_via%20%3E%20(member)%202">Link to this property</a>

const WidgetLastModifiedViaAPI WidgetLastModifiedVia = "api"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20last_modified_via%20%3E%20(member)%203">Link to this property</a>

const WidgetLastModifiedViaUnknown WidgetLastModifiedVia = "unknown"

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20last_modified_via%20%3E%20(member)%204">Link to this property</a>

</details>

<a href="#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)%20%3E%20(property)%20last_modified_via">Link to this property</a>

</details>

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(model)%20widget%20%3E%20(schema)>)

type WidgetDomain string

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(model)%20widget_domain%20%3E%20(schema)>)