Skip to content

Get the next request

POST
/solves/{id}/next
curl --request POST \
--url https://cf.antibotapi.com/solves/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/next \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "status": 200, "headers": { "content-type": "application/javascript; charset=UTF-8" }, "body": "<base64 of the response body>" }'

Send what came back from the request you were given last, whatever it was. Returns the next request, or done once the solve is finished. For a challenge page with cleared (its cf_clearance cookie is then in your jar), for a widget with its token.

A request you gave up on after its timeout_ms goes back as status 0. A solve not done within a minute is dropped.

id
required
string format: uuid
x-signature
string

Required when request signing is on for your key. See Authentication.

Media typeapplication/json
object
status
required

The response’s status, or 0 for a request you gave up on.

integer
headers
required

The response’s headers, as they came (names in any case; join repeated ones).

object
key
additional properties
string
body
required

The response body as it came, Base64.

string

Example

{
"status": 200,
"headers": {
"content-type": "application/javascript; charset=UTF-8"
},
"body": "<base64 of the response body>"
}

The next request, or the end of the solve.

Media typeapplication/json

Either request, or done with cleared (a challenge page) or token (a widget).

object
request

A request to send exactly as given.

object
method
required
string
Allowed values: GET POST
url
required
string format: uri
headers
required

Every header, as [name, value], in the order to send them. Send them as they stand and add none. Fill the cookie one, left empty, from your cookie jar for the address (leave it out if you have none for it). Your HTTP library may set content-length itself; it is given so you can keep its place.

Array<Array<string>>
body

The body to send, for a POST.

string
wait_ms
required

Hold the request this many ms before sending it. Cloudflare refuses an answer that arrives sooner than the work it claims could have taken.

integer
timeout_ms
required

Give up after this many ms (0 for no limit) and hand back status 0.

integer
done
boolean
cleared

Whether the challenge page’s form let you in. When true, cf_clearance is in your cookie jar.

boolean
token

The widget’s token. Post it as the page’s form would.

string

Examples

The next request

{
"request": {
"method": "POST",
"url": "https://www.example.com/cdn-cgi/challenge-platform/h/b/fo/...",
"headers": [
[
"content-length",
"2327"
],
[
"...",
"..."
],
[
"cf-chl",
"g2bs0gK8vVK4W1vYHMqhaVc9BcPIYvmfveFnhsEsvRc-..."
],
[
"cookie",
""
],
[
"priority",
"u=1, i"
]
],
"body": "v_a4e9cb6aae35e6ac=...",
"wait_ms": 128,
"timeout_ms": 5000
}
}

The body is not the JSON this endpoint takes.

Media typeapplication/json
object
error
required
string

Example generated

{
"error": "example"
}

No key, an unknown key, a key out of balance, or a key not on the beta.

Media typeapplication/json
object
success
required
boolean
error
required
object
type
required
string
message
required

What went wrong.

string

Example

{
"success": false
}

No such solve for your key (it ended, expired, or was started by another key).

We could not take the next step: a response that was not what it should be (a 403 where a 200 was due), or a page or script we cannot read. The solve ends; start a new one.

Media typeapplication/json
object
error
required
string

Example

{
"error": "Expected the PageScript request to answer 200, it answered 403"
}