Create a Turnstile Widget

Lists challenge widgets.

/accounts/{account_identifier}/challenges/widgets

post

Turnstile

accounts-turnstile-widget-create

Debug "planAvailability"

null

Debug "tokenPermissions"

null

Debug "parameters"

[]

Debug "requestBody"

{
  "content": {
    "application/json": {
      "schema": {
        "properties": {
          "bot_fight_mode": {
            "description": "If bot_fight_mode is set to `true`, Cloudflare issues computationally\nexpensive challenges in response to malicious bots (ENT only).\n",
            "example": true,
            "type": "boolean"
          },
          "clearance_level": {
            "description": "If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance,\nthis setting can determine the clearance level to be set\n",
            "enum": [
              "no_clearance",
              "jschallenge",
              "managed",
              "interactive"
            ],
            "example": "interactive",
            "type": "string"
          },
          "domains": {
            "example": [
              "203.0.113.1",
              "cloudflare.com",
              "blog.example.com"
            ],
            "items": {
              "description": "Hosts as a hostname or IPv4/IPv6 address represented by strings. The\nwidget will only work on these domains, and their subdomains.\n",
              "example": "203.0.113.1",
              "type": "string"
            },
            "maxLength": 10,
            "type": "array"
          },
          "mode": {
            "description": "Widget Mode",
            "enum": [
              "non-interactive",
              "invisible",
              "managed"
            ],
            "example": "invisible",
            "type": "string"
          },
          "name": {
            "description": "Human readable widget name. Not unique. Cloudflare suggests that you\nset this to a meaningful string to make it easier to identify your\nwidget, and where it is used.\n",
            "example": "blog.cloudflare.com login form",
            "maxLength": 254,
            "minLength": 1,
            "type": "string"
          },
          "offlabel": {
            "description": "Do not show any Cloudflare branding on the widget (ENT only).\n",
            "example": true,
            "type": "boolean"
          },
          "region": {
            "default": "world",
            "description": "Region where this widget can be used.",
            "enum": [
              "world"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "mode",
          "domains"
        ]
      }
    }
  },
  "required": true
}

Debug "responses"

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "properties": {
                "errors": {
                  "example": [],
                  "items": {
                    "properties": {
                      "code": {
                        "minimum": 1000,
                        "type": "integer"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "uniqueItems": true
                  },
                  "type": "array"
                },
                "messages": {
                  "example": [],
                  "items": {
                    "properties": {
                      "code": {
                        "minimum": 1000,
                        "type": "integer"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "uniqueItems": true
                  },
                  "type": "array"
                },
                "success": {
                  "description": "Whether the API call was successful",
                  "example": true,
                  "type": "boolean"
                }
              },
              "required": [
                "success",
                "errors",
                "messages"
              ],
              "type": "object"
            },
            {
              "properties": {
                "result_info": {
                  "properties": {
                    "count": {
                      "description": "Total number of results for the requested service",
                      "example": 1,
                      "type": "number"
                    },
                    "page": {
                      "description": "Current page within paginated list of results",
                      "example": 1,
                      "type": "number"
                    },
                    "per_page": {
                      "description": "Number of results per page of results",
                      "example": 20,
                      "type": "number"
                    },
                    "total_count": {
                      "description": "Total results available without any search parameters",
                      "example": 2000,
                      "type": "number"
                    }
                  },
                  "required": [
                    "page",
                    "per_page",
                    "count",
                    "total_count"
                  ],
                  "type": "object"
                }
              }
            },
            {
              "properties": {
                "result": {
                  "description": "A Turnstile widget's detailed configuration",
                  "properties": {
                    "bot_fight_mode": {
                      "description": "If bot_fight_mode is set to `true`, Cloudflare issues computationally\nexpensive challenges in response to malicious bots (ENT only).\n",
                      "example": true,
                      "type": "boolean"
                    },
                    "clearance_level": {
                      "description": "If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance,\nthis setting can determine the clearance level to be set\n",
                      "enum": [
                        "no_clearance",
                        "jschallenge",
                        "managed",
                        "interactive"
                      ],
                      "example": "interactive",
                      "type": "string"
                    },
                    "created_on": {
                      "description": "When the widget was created.",
                      "example": "2014-01-01T05:20:00.123123Z",
                      "format": "date-time",
                      "readOnly": true,
                      "type": "string"
                    },
                    "domains": {
                      "example": [
                        "203.0.113.1",
                        "cloudflare.com",
                        "blog.example.com"
                      ],
                      "items": {
                        "description": "Hosts as a hostname or IPv4/IPv6 address represented by strings. The\nwidget will only work on these domains, and their subdomains.\n",
                        "example": "203.0.113.1",
                        "type": "string"
                      },
                      "maxLength": 10,
                      "type": "array"
                    },
                    "mode": {
                      "description": "Widget Mode",
                      "enum": [
                        "non-interactive",
                        "invisible",
                        "managed"
                      ],
                      "example": "invisible",
                      "type": "string"
                    },
                    "modified_on": {
                      "description": "When the widget was modified.",
                      "example": "2014-01-01T05:20:00.123123Z",
                      "format": "date-time",
                      "readOnly": true,
                      "type": "string"
                    },
                    "name": {
                      "description": "Human readable widget name. Not unique. Cloudflare suggests that you\nset this to a meaningful string to make it easier to identify your\nwidget, and where it is used.\n",
                      "example": "blog.cloudflare.com login form",
                      "maxLength": 254,
                      "minLength": 1,
                      "type": "string"
                    },
                    "offlabel": {
                      "description": "Do not show any Cloudflare branding on the widget (ENT only).\n",
                      "example": true,
                      "type": "boolean"
                    },
                    "region": {
                      "default": "world",
                      "description": "Region where this widget can be used.",
                      "enum": [
                        "world"
                      ],
                      "type": "string"
                    },
                    "secret": {
                      "description": "Secret key for this widget.",
                      "example": "0x4AAF00AAAABn0R22HWm098HVBjhdsYUc",
                      "type": "string"
                    },
                    "sitekey": {
                      "description": "Widget item identifier tag.",
                      "example": "0x4AAF00AAAABn0R22HWm-YUc",
                      "maxLength": 32,
                      "type": "string"
                    }
                  },
                  "required": [
                    "sitekey",
                    "secret",
                    "created_on",
                    "modified_on",
                    "name",
                    "domains",
                    "mode",
                    "region",
                    "bot_fight_mode",
                    "offlabel",
                    "clearance_level"
                  ],
                  "type": "object"
                }
              }
            }
          ]
        }
      }
    },
    "description": "Create Turnstile Widget Response"
  },
  "4XX": {
    "content": {
      "application/json": {
        "schema": {
          "properties": {
            "errors": {
              "allOf": [
                {
                  "example": [],
                  "items": {
                    "properties": {
                      "code": {
                        "minimum": 1000,
                        "type": "integer"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "uniqueItems": true
                  },
                  "type": "array"
                }
              ],
              "example": [
                {
                  "code": 7003,
                  "message": "No route for the URI"
                }
              ],
              "minLength": 1
            },
            "messages": {
              "allOf": [
                {
                  "example": [],
                  "items": {
                    "properties": {
                      "code": {
                        "minimum": 1000,
                        "type": "integer"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "uniqueItems": true
                  },
                  "type": "array"
                }
              ],
              "example": []
            },
            "result": {
              "nullable": true,
              "type": "object"
            },
            "success": {
              "description": "Whether the API call was successful",
              "example": false,
              "type": "boolean"
            }
          },
          "required": [
            "success",
            "errors",
            "messages",
            "result"
          ],
          "type": "object"
        }
      }
    },
    "description": "Create Turnstile Widget Response Error"
  }
}

Debug "security"

[
  {
    "api_token": []
  },
  {
    "api_email": [],
    "api_key": []
  }
]