Tasks API
Create Turnstile tasks, read their results, and follow them live.
Every operation of the API reference is generated from the contract the API serves, version 0.1.0. Replace YOUR_API_KEY in the samples with your key; each response shows an example in the contract's shape.
List tasks
/v1/tasksAuthentication. Your API key, as a bearer token: Authorization: Bearer YOUR_API_KEY.
Newest first, with cursor pagination.
Parameters
| Field | What it is |
|---|---|
status | Only tasks with this status. |
limit | Tasks per page, 1 to 100; 50 by default. |
cursor |
|
idempotencyKey | Only the task created with this Idempotency-Key, to recover a reply that was lost. |
Responses
| Status | What it means |
|---|---|
| 200 OK | A page of tasks. TaskPage (application/json) |
| 429 Too Many Requests | Over a budget for reading ( Problem (application/problem+json) |
| Any other status | An error, as RFC 9457 problem details. Problem (application/problem+json) |
Error codes
The errors reference says what each means, whether a retry helps and what it costs.
Request
curl https://api.zerocaptcha.io/v1/tasks \ -H "Authorization: Bearer YOUR_API_KEY"const response = await fetch("https://api.zerocaptcha.io/v1/tasks", { headers: { Authorization: "Bearer YOUR_API_KEY", },});console.log(response.status, await response.text());import requests
response = requests.get( "https://api.zerocaptcha.io/v1/tasks", headers={"Authorization": "Bearer YOUR_API_KEY"}, timeout=30,)print(response.status_code, response.text)Response
{
"data": [
{
"action": null,
"attempts": 1,
"callback": null,
"cdata": null,
"cost": "0.000000",
"createdAt": "2026-10-01T00:00:00Z",
"deadline": "2026-10-01T00:00:00Z",
"errorCode": null,
"errorDescription": null,
"finishedAt": null,
"held": "0.000400",
"id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b",
"idempotencyKey": null,
"kind": "turnstile",
"maxAttempts": 1,
"price": "0.000400",
"solution": null,
"startedAt": null,
"status": "queued",
"tokenExpiresAt": null,
"tokenIssuedAt": null,
"tokenState": "pending",
"type": "TurnstileTaskProxyless",
"updatedAt": "2026-10-01T00:00:00Z",
"usesProxy": false,
"version": 1,
"websiteKey": "0x4AAAAAAAB1cD2eF3gH4iJ5",
"websiteURL": "https://example.com/login"
}
],
"liveCursor": "48213",
"nextCursor": null
}rate_limited
{
"type": "https://zerocaptcha.io/docs/reference/errors/#rate_limited",
"title": "Too many requests",
"status": 429,
"instance": "/v1/tasks",
"code": "rate_limited",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}unauthorized
{
"type": "https://zerocaptcha.io/docs/reference/errors/#unauthorized",
"title": "Authentication required",
"status": 401,
"instance": "/v1/tasks",
"code": "unauthorized",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}Example values in the contract's shape, version 0.1.0.
Create a task
/v1/tasksAuthentication. Your API key, as a bearer token: Authorization: Bearer YOUR_API_KEY.
Queues a task and holds its price on your balance; the price is charged only if the task succeeds. Send an Idempotency-Key to retry safely: for 24 hours, the same key and request return the first reply instead of a second task, and the same key with a different request is refused. Creations are bounded by your balance and your account's share of the queue, and by no rate budget unless the service sets one.
Parameters
| Field | What it is |
|---|---|
Idempotency-Key | Your ID for this task, 1 to 255 visible ASCII characters. |
Request body JSON · CreateTask
A new task: a Turnstile widget's, or a Cloudflare challenge page's, told apart by type. Surrounding whitespace is trimmed from every field, and an empty optional field counts as absent.
CreateTurnstileTask
A new Turnstile task. Surrounding whitespace is trimmed from every field, and an empty optional field counts as absent.
| Field | What it is |
|---|---|
type |
One of |
websiteKey | The widget's site key: 1 to 100 ASCII letters, digits, |
websiteURL | The page the widget is on, or behind the challenge: an http or https URL of at most 2048 characters, without credentials, on its scheme's default port. The server also checks that it names a public domain, not an IP address, a name of one label or one kept for local use such as |
action | The widget's action, if it sets one: up to 32 ASCII letters, digits, |
callbackUrl | Where to POST the result once the task ends, signed with your callback secret ( |
cdata | The widget's cData, if it sets one: up to 255 ASCII letters, digits, |
proxy | Your proxy as a URL with its port, such as |
CreateChallengeTask
A new Cloudflare challenge page's task, through your proxy: a challenge page has no widget, so no websiteKey, action or cdata. Surrounding whitespace is trimmed from every field, and an empty optional field counts as absent.
| Field | What it is |
|---|---|
proxy | Your proxy as a URL with its port, such as |
type |
One of |
websiteURL | The page the widget is on, or behind the challenge: an http or https URL of at most 2048 characters, without credentials, on its scheme's default port. The server also checks that it names a public domain, not an IP address, a name of one label or one kept for local use such as |
callbackUrl | Where to POST the result once the task ends, signed with your callback secret ( |
Responses
| Status | What it means |
|---|---|
| 201 Created | The task, queued; or, for a retry with the same TaskView (application/json) |
| 409 Conflict | A request with this Problem (application/problem+json) |
| 429 Too Many Requests | The queue share is full ( Problem (application/problem+json) |
| Any other status | An error, as RFC 9457 problem details. Problem (application/problem+json) |
Error codes
The errors reference says what each means, whether a retry helps and what it costs.
Request
curl -X POST https://api.zerocaptcha.io/v1/tasks \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Idempotency-Key: order-4521-attempt-1" \ -H "Content-Type: application/json" \ -d '{ "type": "TurnstileTaskProxyless", "websiteKey": "0x4AAAAAAAB1cD2eF3gH4iJ5", "websiteURL": "https://example.com/login"}'const response = await fetch("https://api.zerocaptcha.io/v1/tasks", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Idempotency-Key": "order-4521-attempt-1", "Content-Type": "application/json", }, body: JSON.stringify({ "type": "TurnstileTaskProxyless", "websiteKey": "0x4AAAAAAAB1cD2eF3gH4iJ5", "websiteURL": "https://example.com/login" }),});console.log(response.status, await response.text());import requests
response = requests.post( "https://api.zerocaptcha.io/v1/tasks", headers={"Authorization": "Bearer YOUR_API_KEY", "Idempotency-Key": "order-4521-attempt-1"}, json={ "type": "TurnstileTaskProxyless", "websiteKey": "0x4AAAAAAAB1cD2eF3gH4iJ5", "websiteURL": "https://example.com/login", }, timeout=30,)print(response.status_code, response.text)Response
{
"action": null,
"attempts": 1,
"callback": null,
"cdata": null,
"cost": "0.000000",
"createdAt": "2026-10-01T00:00:00Z",
"deadline": "2026-10-01T00:00:00Z",
"errorCode": null,
"errorDescription": null,
"finishedAt": null,
"held": "0.000400",
"id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b",
"idempotencyKey": null,
"kind": "turnstile",
"maxAttempts": 1,
"price": "0.000400",
"solution": null,
"startedAt": null,
"status": "queued",
"tokenExpiresAt": null,
"tokenIssuedAt": null,
"tokenState": "pending",
"type": "TurnstileTaskProxyless",
"updatedAt": "2026-10-01T00:00:00Z",
"usesProxy": false,
"version": 1,
"websiteKey": "0x4AAAAAAAB1cD2eF3gH4iJ5",
"websiteURL": "https://example.com/login"
}idempotency_key_in_use
{
"type": "https://zerocaptcha.io/docs/reference/errors/#idempotency_key_in_use",
"title": "Idempotency key in use",
"status": 409,
"instance": "/v1/tasks",
"code": "idempotency_key_in_use",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}queue_full
{
"type": "https://zerocaptcha.io/docs/reference/errors/#queue_full",
"title": "Queue full",
"status": 429,
"instance": "/v1/tasks",
"code": "queue_full",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}rate_limited
{
"type": "https://zerocaptcha.io/docs/reference/errors/#rate_limited",
"title": "Too many requests",
"status": 429,
"instance": "/v1/tasks",
"code": "rate_limited",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}unauthorized
{
"type": "https://zerocaptcha.io/docs/reference/errors/#unauthorized",
"title": "Authentication required",
"status": 401,
"instance": "/v1/tasks",
"code": "unauthorized",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}Example values in the contract's shape, version 0.1.0.
Live task updates
/v1/tasks/eventsAuthentication. Your API key, as a bearer token: Authorization: Bearer YOUR_API_KEY.
Server-sent events for the caller's tasks: task carries a task (without its token) each time it changes, reset asks the client to refetch its list because updates were missed. Start from a list's liveCursor. Opening a stream draws on the caller's budget for reads, as a list read does; keeping it open costs nothing more. The stream ends when its key or session no longer allows it, or when its client stops taking events; an account may hold only a few streams open at once.
Parameters
| Field | What it is |
|---|---|
since | Where to start: |
Last-Event-ID | The last event's ID, sent by a reconnecting browser. |
Responses
| Status | What it means |
|---|---|
| 200 OK | An event stream. text/event-stream |
| 429 Too Many Requests | Over a budget for reading, or as many streams open as the account, or this server, may hold ( Problem (application/problem+json) |
| Any other status | An error, as RFC 9457 problem details. Problem (application/problem+json) |
Error codes
The errors reference says what each means, whether a retry helps and what it costs.
Request
curl -N https://api.zerocaptcha.io/v1/tasks/events \ -H "Authorization: Bearer YOUR_API_KEY"const response = await fetch("https://api.zerocaptcha.io/v1/tasks/events", { headers: { Authorization: "Bearer YOUR_API_KEY", },});// Events arrive as they happen; stop with Ctrl+C.const decoder = new TextDecoder();for await (const chunk of response.body) { process.stdout.write(decoder.decode(chunk, { stream: true }));}import requests
# Events arrive as they happen; stop with Ctrl+C.with requests.get( "https://api.zerocaptcha.io/v1/tasks/events", headers={"Authorization": "Bearer YOUR_API_KEY"}, stream=True, timeout=(10, None),) as response: for line in response.iter_lines(decode_unicode=True): print(line)Response
Server-sent events, as the description says: no single body to show.
rate_limited
{
"type": "https://zerocaptcha.io/docs/reference/errors/#rate_limited",
"title": "Too many requests",
"status": 429,
"instance": "/v1/tasks/events",
"code": "rate_limited",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}unauthorized
{
"type": "https://zerocaptcha.io/docs/reference/errors/#unauthorized",
"title": "Authentication required",
"status": 401,
"instance": "/v1/tasks/events",
"code": "unauthorized",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}Example values in the contract's shape, version 0.1.0.
Get a task
/v1/tasks/{id}Authentication. Your API key, as a bearer token: Authorization: Bearer YOUR_API_KEY.
The task's status, cost and, while it is valid, its token: for a challenge page, its clearance cookie and the user agent it is bound to. A task that named a callback URL shows it with where its delivery stands and each attempt: when, the HTTP status, and when the next is due.
Read with an API key, a task still queued or running is answered as soon as it ends, or after a few seconds as it is then: a client that polls gets its result the moment it is in, not at its next poll. A read with a session is answered at once.
Parameters
| Field | What it is |
|---|---|
id | The task's ID. |
Responses
| Status | What it means |
|---|---|
| 200 OK | The task. TaskView (application/json) |
| 429 Too Many Requests | Over a budget for reading ( Problem (application/problem+json) |
| Any other status | An error, as RFC 9457 problem details. Problem (application/problem+json) |
Error codes
The errors reference says what each means, whether a retry helps and what it costs.
Request
curl https://api.zerocaptcha.io/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b \ -H "Authorization: Bearer YOUR_API_KEY"const response = await fetch("https://api.zerocaptcha.io/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b", { headers: { Authorization: "Bearer YOUR_API_KEY", },});console.log(response.status, await response.text());import requests
response = requests.get( "https://api.zerocaptcha.io/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b", headers={"Authorization": "Bearer YOUR_API_KEY"}, timeout=30,)print(response.status_code, response.text)Response
{
"action": null,
"attempts": 1,
"callback": null,
"cdata": null,
"cost": "0.000000",
"createdAt": "2026-10-01T00:00:00Z",
"deadline": "2026-10-01T00:00:00Z",
"errorCode": null,
"errorDescription": null,
"finishedAt": null,
"held": "0.000400",
"id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b",
"idempotencyKey": null,
"kind": "turnstile",
"maxAttempts": 1,
"price": "0.000400",
"solution": null,
"startedAt": null,
"status": "queued",
"tokenExpiresAt": null,
"tokenIssuedAt": null,
"tokenState": "pending",
"type": "TurnstileTaskProxyless",
"updatedAt": "2026-10-01T00:00:00Z",
"usesProxy": false,
"version": 1,
"websiteKey": "0x4AAAAAAAB1cD2eF3gH4iJ5",
"websiteURL": "https://example.com/login"
}rate_limited
{
"type": "https://zerocaptcha.io/docs/reference/errors/#rate_limited",
"title": "Too many requests",
"status": 429,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b",
"code": "rate_limited",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}unauthorized
{
"type": "https://zerocaptcha.io/docs/reference/errors/#unauthorized",
"title": "Authentication required",
"status": 401,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b",
"code": "unauthorized",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}Example values in the contract's shape, version 0.1.0.
Send a task's callback again
/v1/tasks/{id}/callback/resendAuthentication. Your API key, as a bearer token: Authorization: Bearer YOUR_API_KEY.
Calls the task's callback URL again, as soon as the worker gets to it, with eight more attempts if it fails: once the callback was delivered or given up, or after its record was deleted. It is signed and shaped as the first call was, and carries the same ZeroCaptcha-Delivery ID while its record lasts. A key needs the tasks:write scope; a session must be an owner's (role_required), with the CSRF token. A suspended account sends none (account_suspended).
Parameters
| Field | What it is |
|---|---|
id | The task's ID. |
Responses
| Status | What it means |
|---|---|
| 202 Accepted | Queued: the callback as it stands now. TaskCallback (application/json) |
| 403 Forbidden | A member's session, not an owner's ( Problem (application/problem+json) |
| 404 Not Found | No task of this account has this ID, or the task names no callback URL ( Problem (application/problem+json) |
| 409 Conflict | The task has not ended yet, or its callback is still being delivered ( Problem (application/problem+json) |
| Any other status | An error, as RFC 9457 problem details. Problem (application/problem+json) |
Error codes
The errors reference says what each means, whether a retry helps and what it costs.
Request
curl -X POST https://api.zerocaptcha.io/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/callback/resend \ -H "Authorization: Bearer YOUR_API_KEY"const response = await fetch("https://api.zerocaptcha.io/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/callback/resend", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", },});console.log(response.status, await response.text());import requests
response = requests.post( "https://api.zerocaptcha.io/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/callback/resend", headers={"Authorization": "Bearer YOUR_API_KEY"}, timeout=30,)print(response.status_code, response.text)Response
{
"attempts": [
{
"attempt": 1,
"error": null,
"finishedAt": "2026-10-01T00:00:00Z",
"nextAttemptAt": null,
"outcome": "delivered",
"startedAt": "2026-10-01T00:00:00Z",
"statusCode": null
}
],
"maxAttempts": 1,
"nextAttemptAt": null,
"resentAt": null,
"status": "waiting",
"url": "https://example.com/callback"
}role_required
{
"type": "https://zerocaptcha.io/docs/reference/errors/#role_required",
"title": "Role required",
"status": 403,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/callback/resend",
"code": "role_required",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}insufficient_scope
{
"type": "https://zerocaptcha.io/docs/reference/errors/#insufficient_scope",
"title": "API key lacks the scope",
"status": 403,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/callback/resend",
"code": "insufficient_scope",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}account_suspended
{
"type": "https://zerocaptcha.io/docs/reference/errors/#account_suspended",
"title": "Account suspended",
"status": 403,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/callback/resend",
"code": "account_suspended",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}not_found
{
"type": "https://zerocaptcha.io/docs/reference/errors/#not_found",
"title": "Not found",
"status": 404,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/callback/resend",
"code": "not_found",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}state_conflict
{
"type": "https://zerocaptcha.io/docs/reference/errors/#state_conflict",
"title": "Not possible now",
"status": 409,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/callback/resend",
"code": "state_conflict",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}unauthorized
{
"type": "https://zerocaptcha.io/docs/reference/errors/#unauthorized",
"title": "Authentication required",
"status": 401,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/callback/resend",
"code": "unauthorized",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}Example values in the contract's shape, version 0.1.0.
Report a task's token
/v1/tasks/{id}/reportAuthentication. Your API key, as a bearer token: Authorization: Bearer YOUR_API_KEY.
Says whether the site accepted a solved task's token: bad when it refused it, good when it worked. The report is recorded for our staff, who watch the solvers' quality with it; tasks are final, so it refunds nothing. One report per task, and only on a task that succeeded. Needs the tasks:write scope; with a session, the CSRF token.
Parameters
| Field | What it is |
|---|---|
id | The task's ID. |
Request body JSON · NewTaskReport
| Field | What it is |
|---|---|
verdict |
One of |
Responses
| Status | What it means |
|---|---|
| 201 Created | Recorded. TaskReport (application/json) |
| 404 Not Found | No task of this account has this ID ( Problem (application/problem+json) |
| 409 Conflict | The task did not succeed, so there is no token to report on, or it has a report already ( Problem (application/problem+json) |
| Any other status | An error, as RFC 9457 problem details. Problem (application/problem+json) |
Error codes
The errors reference says what each means, whether a retry helps and what it costs.
Request
curl -X POST https://api.zerocaptcha.io/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/report \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "verdict": "bad"}'const response = await fetch("https://api.zerocaptcha.io/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/report", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ "verdict": "bad" }),});console.log(response.status, await response.text());import requests
response = requests.post( "https://api.zerocaptcha.io/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/report", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "verdict": "bad", }, timeout=30,)print(response.status_code, response.text)Response
{
"reportedAt": "2026-10-01T00:00:00Z",
"taskId": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b",
"verdict": "bad"
}not_found
{
"type": "https://zerocaptcha.io/docs/reference/errors/#not_found",
"title": "Not found",
"status": 404,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/report",
"code": "not_found",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}state_conflict
{
"type": "https://zerocaptcha.io/docs/reference/errors/#state_conflict",
"title": "Not possible now",
"status": 409,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/report",
"code": "state_conflict",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}unauthorized
{
"type": "https://zerocaptcha.io/docs/reference/errors/#unauthorized",
"title": "Authentication required",
"status": 401,
"instance": "/v1/tasks/0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b/report",
"code": "unauthorized",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}Example values in the contract's shape, version 0.1.0.