1. Registry
  2. Packages
  3. Cloudflare Provider
  4. API Docs
  5. getTurnstileWidgets
Viewing docs for Cloudflare v6.20.0
published on Tuesday, Aug 25, 2026 by Pulumi
cloudflare logo cloudflare logo
Viewing docs for Cloudflare v6.20.0
published on Tuesday, Aug 25, 2026 by Pulumi

    Accepted Permissions

    • Account Settings Read
    • Account Settings Write
    • Turnstile Sites Read
    • Turnstile Sites Write

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleTurnstileWidgets = cloudflare.getTurnstileWidgets({
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        direction: "asc",
        filter: "name:my-widget",
        order: "id",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_turnstile_widgets = cloudflare.get_turnstile_widgets(account_id="023e105f4ecef8ad9ca31a8372d0c353",
        direction="asc",
        filter="name:my-widget",
        order="id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.GetTurnstileWidgets(ctx, &cloudflare.LookupTurnstileWidgetsArgs{
    			AccountId: pulumi.StringRef("023e105f4ecef8ad9ca31a8372d0c353"),
    			Direction: pulumi.StringRef("asc"),
    			Filter:    pulumi.StringRef("name:my-widget"),
    			Order:     pulumi.StringRef("id"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleTurnstileWidgets = Cloudflare.GetTurnstileWidgets.Invoke(new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            Direction = "asc",
            Filter = "name:my-widget",
            Order = "id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetTurnstileWidgetsArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var exampleTurnstileWidgets = CloudflareFunctions.getTurnstileWidgets(GetTurnstileWidgetsArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .direction("asc")
                .filter("name:my-widget")
                .order("id")
                .build());
    
        }
    }
    
    variables:
      exampleTurnstileWidgets:
        fn::invoke:
          function: cloudflare:getTurnstileWidgets
          arguments:
            accountId: 023e105f4ecef8ad9ca31a8372d0c353
            direction: asc
            filter: name:my-widget
            order: id
    
    pulumi {
      required_providers {
        cloudflare = {
          source = "pulumi/cloudflare"
        }
      }
    }
    
    data "cloudflare_getturnstilewidgets" "exampleTurnstileWidgets" {
      account_id = "023e105f4ecef8ad9ca31a8372d0c353"
      direction  = "asc"
      filter     = "name:my-widget"
      order      = "id"
    }
    

    Using getTurnstileWidgets

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getTurnstileWidgets(args: GetTurnstileWidgetsArgs, opts?: InvokeOptions): Promise<GetTurnstileWidgetsResult>
    function getTurnstileWidgetsOutput(args: GetTurnstileWidgetsOutputArgs, opts?: InvokeOutputOptions): Output<GetTurnstileWidgetsResult>
    def get_turnstile_widgets(account_id: Optional[str] = None,
                              direction: Optional[str] = None,
                              filter: Optional[str] = None,
                              max_items: Optional[int] = None,
                              order: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetTurnstileWidgetsResult
    def get_turnstile_widgets_output(account_id: pulumi.Input[Optional[str]] = None,
                              direction: pulumi.Input[Optional[str]] = None,
                              filter: pulumi.Input[Optional[str]] = None,
                              max_items: pulumi.Input[Optional[int]] = None,
                              order: pulumi.Input[Optional[str]] = None,
                              opts: Optional[InvokeOutputOptions] = None) -> Output[GetTurnstileWidgetsResult]
    func LookupTurnstileWidgets(ctx *Context, args *LookupTurnstileWidgetsArgs, opts ...InvokeOption) (*LookupTurnstileWidgetsResult, error)
    func LookupTurnstileWidgetsOutput(ctx *Context, args *LookupTurnstileWidgetsOutputArgs, opts ...InvokeOption) LookupTurnstileWidgetsResultOutput

    > Note: This function is named LookupTurnstileWidgets in the Go SDK.

    public static class GetTurnstileWidgets 
    {
        public static Task<GetTurnstileWidgetsResult> InvokeAsync(GetTurnstileWidgetsArgs args, InvokeOptions? opts = null)
        public static Output<GetTurnstileWidgetsResult> Invoke(GetTurnstileWidgetsInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetTurnstileWidgetsResult> Invoke(GetTurnstileWidgetsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetTurnstileWidgetsResult> getTurnstileWidgets(GetTurnstileWidgetsArgs args, InvokeOptions options)
    public static Output<GetTurnstileWidgetsResult> getTurnstileWidgets(GetTurnstileWidgetsArgs args, InvokeOptions options)
    public static Output<GetTurnstileWidgetsResult> getTurnstileWidgets(GetTurnstileWidgetsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: cloudflare:index/getTurnstileWidgets:getTurnstileWidgets
      arguments:
        # arguments dictionary
    data "cloudflare_get_turnstile_widgets" "name" {
        # arguments
    }

    The following arguments are supported:

    AccountId string
    Identifier
    Direction string
    Direction to order widgets. Available values: "asc", "desc".
    Filter string
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    MaxItems int
    Order string
    AccountId string
    Identifier
    Direction string
    Direction to order widgets. Available values: "asc", "desc".
    Filter string
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    MaxItems int
    Order string
    account_id string
    Identifier
    direction string
    Direction to order widgets. Available values: "asc", "desc".
    filter string
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    max_items number
    order string
    accountId String
    Identifier
    direction String
    Direction to order widgets. Available values: "asc", "desc".
    filter String
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    maxItems Integer
    order String
    accountId string
    Identifier
    direction string
    Direction to order widgets. Available values: "asc", "desc".
    filter string
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    maxItems number
    order string
    account_id str
    Identifier
    direction str
    Direction to order widgets. Available values: "asc", "desc".
    filter str
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    max_items int
    order str
    accountId String
    Identifier
    direction String
    Direction to order widgets. Available values: "asc", "desc".
    filter String
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    maxItems Number
    order String

    getTurnstileWidgets Result

    The following output properties are available:

    Results List<GetTurnstileWidgetsResult>
    AccountId string
    Identifier
    Direction string
    Direction to order widgets. Available values: "asc", "desc".
    Filter string
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    MaxItems int
    Order string
    Results []GetTurnstileWidgetsResult
    AccountId string
    Identifier
    Direction string
    Direction to order widgets. Available values: "asc", "desc".
    Filter string
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    MaxItems int
    Order string
    results list(object)
    account_id string
    Identifier
    direction string
    Direction to order widgets. Available values: "asc", "desc".
    filter string
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    max_items number
    order string
    results List<GetTurnstileWidgetsResult>
    accountId String
    Identifier
    direction String
    Direction to order widgets. Available values: "asc", "desc".
    filter String
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    maxItems Integer
    order String
    results GetTurnstileWidgetsResult[]
    accountId string
    Identifier
    direction string
    Direction to order widgets. Available values: "asc", "desc".
    filter string
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    maxItems number
    order string
    results Sequence[GetTurnstileWidgetsResult]
    account_id str
    Identifier
    direction str
    Direction to order widgets. Available values: "asc", "desc".
    filter str
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    max_items int
    order str
    results List<Property Map>
    accountId String
    Identifier
    direction String
    Direction to order widgets. Available values: "asc", "desc".
    filter String
    Filter widgets by field using case-insensitive substring matching. Format: field:value
    maxItems Number
    order String

    Supporting Types

    GetTurnstileWidgetsResult

    BotFightMode bool
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
    ClearanceLevel 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 Available values: "noClearance", "jschallenge", "managed", "interactive".
    CreatedOn string
    When the widget was created.
    DeployedVia 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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    Domains List<string>
    EphemeralId bool
    Return the Ephemeral ID in /siteverify (ENT only).
    Id string
    Widget item identifier tag.
    LastModifiedVia 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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    Mode string
    Widget Mode Available values: "non-interactive", "invisible", "managed".
    ModifiedOn string
    When the widget was modified.
    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.
    Offlabel bool
    Do not show any Cloudflare branding on the widget (ENT only).
    Region string
    Region where this widget can be used. This cannot be changed after creation. Available values: "world", "china".
    Sitekey string
    Widget item identifier tag.
    BotFightMode bool
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
    ClearanceLevel 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 Available values: "noClearance", "jschallenge", "managed", "interactive".
    CreatedOn string
    When the widget was created.
    DeployedVia 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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    Domains []string
    EphemeralId bool
    Return the Ephemeral ID in /siteverify (ENT only).
    Id string
    Widget item identifier tag.
    LastModifiedVia 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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    Mode string
    Widget Mode Available values: "non-interactive", "invisible", "managed".
    ModifiedOn string
    When the widget was modified.
    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.
    Offlabel bool
    Do not show any Cloudflare branding on the widget (ENT only).
    Region string
    Region where this widget can be used. This cannot be changed after creation. Available values: "world", "china".
    Sitekey string
    Widget item identifier tag.
    bot_fight_mode bool
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
    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 Available values: "noClearance", "jschallenge", "managed", "interactive".
    created_on string
    When the widget was created.
    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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    domains list(string)
    ephemeral_id bool
    Return the Ephemeral ID in /siteverify (ENT only).
    id string
    Widget item identifier tag.
    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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    mode string
    Widget Mode Available values: "non-interactive", "invisible", "managed".
    modified_on string
    When the widget was modified.
    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.
    offlabel bool
    Do not show any Cloudflare branding on the widget (ENT only).
    region string
    Region where this widget can be used. This cannot be changed after creation. Available values: "world", "china".
    sitekey string
    Widget item identifier tag.
    botFightMode Boolean
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
    clearanceLevel 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 Available values: "noClearance", "jschallenge", "managed", "interactive".
    createdOn String
    When the widget was created.
    deployedVia 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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    domains List<String>
    ephemeralId Boolean
    Return the Ephemeral ID in /siteverify (ENT only).
    id String
    Widget item identifier tag.
    lastModifiedVia 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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    mode String
    Widget Mode Available values: "non-interactive", "invisible", "managed".
    modifiedOn String
    When the widget was modified.
    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.
    offlabel Boolean
    Do not show any Cloudflare branding on the widget (ENT only).
    region String
    Region where this widget can be used. This cannot be changed after creation. Available values: "world", "china".
    sitekey String
    Widget item identifier tag.
    botFightMode boolean
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
    clearanceLevel 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 Available values: "noClearance", "jschallenge", "managed", "interactive".
    createdOn string
    When the widget was created.
    deployedVia 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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    domains string[]
    ephemeralId boolean
    Return the Ephemeral ID in /siteverify (ENT only).
    id string
    Widget item identifier tag.
    lastModifiedVia 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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    mode string
    Widget Mode Available values: "non-interactive", "invisible", "managed".
    modifiedOn string
    When the widget was modified.
    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.
    offlabel boolean
    Do not show any Cloudflare branding on the widget (ENT only).
    region string
    Region where this widget can be used. This cannot be changed after creation. Available values: "world", "china".
    sitekey string
    Widget item identifier tag.
    bot_fight_mode bool
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
    clearance_level str
    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 Available values: "noClearance", "jschallenge", "managed", "interactive".
    created_on str
    When the widget was created.
    deployed_via str
    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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    domains Sequence[str]
    ephemeral_id bool
    Return the Ephemeral ID in /siteverify (ENT only).
    id str
    Widget item identifier tag.
    last_modified_via str
    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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    mode str
    Widget Mode Available values: "non-interactive", "invisible", "managed".
    modified_on str
    When the widget was modified.
    name str
    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.
    offlabel bool
    Do not show any Cloudflare branding on the widget (ENT only).
    region str
    Region where this widget can be used. This cannot be changed after creation. Available values: "world", "china".
    sitekey str
    Widget item identifier tag.
    botFightMode Boolean
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
    clearanceLevel 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 Available values: "noClearance", "jschallenge", "managed", "interactive".
    createdOn String
    When the widget was created.
    deployedVia 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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    domains List<String>
    ephemeralId Boolean
    Return the Ephemeral ID in /siteverify (ENT only).
    id String
    Widget item identifier tag.
    lastModifiedVia 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. Available values: "wrangler", "dashboard", "spin", "api", "unknown".
    mode String
    Widget Mode Available values: "non-interactive", "invisible", "managed".
    modifiedOn String
    When the widget was modified.
    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.
    offlabel Boolean
    Do not show any Cloudflare branding on the widget (ENT only).
    region String
    Region where this widget can be used. This cannot be changed after creation. Available values: "world", "china".
    sitekey String
    Widget item identifier tag.

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo cloudflare logo
    Viewing docs for Cloudflare v6.20.0
    published on Tuesday, Aug 25, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial