---
title: Turnstile
---

[Skip to content](#_top)

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

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Turnstile

#### TurnstileWidgets

#### resource cloudflare\_turnstile\_widget

##### required Expand Collapse

account\_id: String

Identifier

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20account_id>)

mode: String

Widget Mode

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20mode>)

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.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20name>)

domains: List\[String]

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20domains>)

##### optional Expand Collapse

bot\_fight\_mode?: Bool

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20bot_fight_mode>)

clearance\_level?: String

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20clearance_level>)

ephemeral\_id?: Bool

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20ephemeral_id>)

offlabel?: Bool

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20offlabel>)

region?: String

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20region>)

##### computed Expand Collapse

id: String

Unique identifier for a Turnstile widget.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

sitekey: String

Unique identifier for a Turnstile widget.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20sitekey>)

created\_on: Time

When the widget was created.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20created_on>)

deployed\_via: String

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.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20deployed_via>)

last\_modified\_via: String

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.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20last_modified_via>)

modified\_on: Time

When the widget was modified.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20modified_on>)

secret: String

Secret key for this widget.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20secret>)

### cloudflare\_turnstile\_widget

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_turnstile_widget" "example_turnstile_widget" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  domains = ["203.0.113.1", "cloudflare.com", "blog.example.com"]
  mode = "invisible"
  name = "blog.cloudflare.com login form"
  bot_fight_mode = false
  clearance_level = "interactive"
  ephemeral_id = false
  offlabel = false
  region = "world"
}
```

#### data cloudflare\_turnstile\_widget

##### required Expand Collapse

account\_id: String

Identifier

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20account_id>)

##### optional Expand Collapse

sitekey?: String

Unique identifier for a Turnstile widget.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20sitekey>)

<details>

<summary>

filter?: Attributes

</summary>

direction?: String

Direction to order widgets.

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter%20%3E%20(attribute)%20direction">Link to this property</a>

filter?: String

Filter widgets by field. The <code>name</code> field uses case-insensitive substring matching; <code>sitekey</code> uses exact matching. Format: <code>field:value</code>

Supported fields:

- <code>name</code> - Filter by widget name (e.g., <code>filter=name:login-form</code>)
- <code>sitekey</code> - Filter by sitekey (e.g., <code>filter=sitekey:0x4AAA</code>)

Returns 400 Bad Request if the field is unsupported or format is invalid. An empty filter value returns all results.

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter%20%3E%20(attribute)%20filter">Link to this property</a>

order?: String

Field to order widgets by.

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter%20%3E%20(attribute)%20order">Link to this property</a>

</details>

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter>)

##### computed Expand Collapse

id: String

Unique identifier for a Turnstile widget.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

bot\_fight\_mode: Bool

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20bot_fight_mode>)

clearance\_level: String

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20clearance_level>)

created\_on: Time

When the widget was created.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20created_on>)

deployed\_via: String

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.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20deployed_via>)

ephemeral\_id: Bool

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20ephemeral_id>)

last\_modified\_via: String

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.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20last_modified_via>)

mode: String

Widget Mode

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20mode>)

modified\_on: Time

When the widget was modified.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20modified_on>)

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.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20name>)

offlabel: Bool

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20offlabel>)

region: String

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

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20region>)

secret: String

Secret key for this widget.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20secret>)

domains: List\[String]

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20domains>)

### cloudflare\_turnstile\_widget

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_turnstile_widget" "example_turnstile_widget" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  sitekey = "0x4AAF00AAAABn0R22HWm-YUc"
}
```

#### data cloudflare\_turnstile\_widgets

##### required Expand Collapse

account\_id: String

Identifier

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20account_id>)

##### optional Expand Collapse

direction?: String

Direction to order widgets.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20direction>)

filter?: String

Filter widgets by field. The `name` field uses case-insensitive substring matching; `sitekey` uses exact matching. Format: `field:value`

Supported fields:

- `name` - Filter by widget name (e.g., `filter=name:login-form`)
- `sitekey` - Filter by sitekey (e.g., `filter=sitekey:0x4AAA`)

Returns 400 Bad Request if the field is unsupported or format is invalid. An empty filter value returns all results.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20filter>)

order?: String

Field to order widgets by.

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20order>)

max\_items?: Int64

Max items to fetch, default: 1000

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20max_items>)

##### computed Expand Collapse

<details>

<summary>

result: List\[Attributes]

The items returned by the data source

</summary>

id: String

Unique identifier for a Turnstile widget.

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20id">Link to this property</a>

bot\_fight\_mode: 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(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20bot_fight_mode">Link to this property</a>

clearance\_level: String

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

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20clearance_level">Link to this property</a>

created\_on: Time

When the widget was created.

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20created_on">Link to this property</a>

domains: List\[String]

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20domains">Link to this property</a>

ephemeral\_id: Bool

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

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20ephemeral_id">Link to this property</a>

mode: String

Widget Mode

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20mode">Link to this property</a>

modified\_on: Time

When the widget was modified.

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%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.

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%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(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20offlabel">Link to this property</a>

region: String

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

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20region">Link to this property</a>

sitekey: String

Unique identifier for a Turnstile widget.

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20sitekey">Link to this property</a>

deployed\_via: String

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.

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20deployed_via">Link to this property</a>

last\_modified\_via: String

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.

<a href="#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20last_modified_via">Link to this property</a>

</details>

[Link to this property](<#(resource)%20turnstile.widgets%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result>)

### cloudflare\_turnstile\_widgets

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_turnstile_widgets" "example_turnstile_widgets" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  direction = "asc"
  filter = "name:my-widget"
  order = "id"
}
```