> ## Documentation Index
> Fetch the complete documentation index at: https://cloudsneak.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /cloudflare: solve Turnstile or extract IUAM clearance

> Solve Cloudflare Turnstile tokens or extract cf_clearance cookies via the Cloudsneak REST API, with mode, domain, siteKey, proxy, and TTL options.

The `POST /cloudflare` endpoint solves a Cloudflare challenge in one of two modes: `turnstile` returns a Turnstile response token, and `iuam` returns a `cf_clearance` cookie with its matching `User-Agent`.

## Request body

**mode** `string` *required*

The resolution mode: `"turnstile"` or `"iuam"`.

**domain** `string` *required*

The target domain URL, for example `https://example.com`.

**siteKey** `string`

Required when `mode` is `"turnstile"`. The Cloudflare Turnstile site key.

**authToken** `string`

Optional authorization token. Required when the server was started with an `authToken` environment variable.

**proxy** `object`

Optional proxy configuration.

**properties**

**host** `string`

Proxy host.

**port** `number`

Proxy port.

**username** `string`

Proxy username.

**password** `string`

Proxy password.

**ttl** `number`

Optional custom cache TTL in milliseconds for the IUAM clearance response.

## Examples

> [tab] Turnstile
>
> ```json theme={null}
> {
>   "mode": "turnstile",
>   "domain": "https://example.com",
>   "siteKey": "0x4AAAAAAACk534..."
> }
> ```

> [tab] IUAM
>
> ```json theme={null}
> {
>   "mode": "iuam",
>   "domain": "https://example.com"
> }
> ```

## Responses

### Turnstile mode

**token** `string`

The solved Turnstile response token.

**elapsed** `string`

Time taken to solve the challenge, for example `"2.45s"`.

```json theme={null}
{
  "token": "0.X.XXXXXXXXXXXXXXXXXXXX...",
  "elapsed": "2.45s"
}
```

### IUAM mode

**cf\_clearance** `string`

The extracted `cf_clearance` cookie value.

**user\_agent** `string`

The `User-Agent` string used when the cookie was issued. You must reuse this exact `User-Agent` on subsequent requests.

**elapsed** `string`

Time taken to extract the cookie.

**cached** `boolean`

Whether the response was served from the in-memory TTL cache.

```json theme={null}
{
  "cf_clearance": "abc123xyz...",
  "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)...",
  "elapsed": "3.12s",
  "cached": false
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.