API referenceTask typesCloudflare Turnstile

Cloudflare Turnstile

The Cloudflare captcha widget, in all three of its modes. You do not have to say which mode the page is using; we read it off the widget.

Task types

Type stringProxyUse it for
AntiTurnstileTaskProxyLessNoneEvery Turnstile widget: managed, non interactive and invisible.

There is one type on purpose. Turnstile tokens are not bound to the address that minted them, so a proxy buys nothing and the mode is detectable from the widget itself.

Task object

FieldTypeRequiredWhat it is
typeStringYesAntiTurnstileTaskProxyLess.
websiteURLStringYesThe page carrying the widget.
websiteKeyStringYesThe sitekey on the widget element. It starts 0x.
metadata.actionStringNoThe data-action attribute, if the widget carries one.
metadata.cdataStringNoThe data-cdata attribute, if the widget carries one.

Both metadata fields are optional and both are checked when the site sets them. Copy them across if the widget has them; leave metadata out entirely if it does not.

Example

POST/createTask

{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "AntiTurnstileTaskProxyLess",
    "websiteURL": "https://example.com/signup",
    "websiteKey": "0x4AAAAAAA...",
    "metadata": {
      "action": "signup",
      "cdata": "0000-1111-2222-3333"
    }
  }
}

JSON

{
  "errorId": 0,
  "taskId": "c2f6b8e1-3a4d-4f5b-8c2e-0242ac110006",
  "status": "ready",
  "solution": {
    "token": "0.Ky_0bJ...",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ..."
  }
}
Solution fieldWhat to do with it
tokenPut it in the cf-turnstile-response field and submit.
userAgentSend the form with this user agent. Turnstile checks it.

Finding the site key

  1. Search the page source for cf-turnstile.
  2. The key is the data-sitekey attribute on that element.
  3. If the widget is rendered by script, look for turnstile.render and read the sitekey option.

Live examples of each mode, with the request beside them, are on the Turnstile page.

Last updated 21 September 2026