Skip to main content

Overview

Call POST /v2/tasks/{taskId}/run with input_params matching the task’s input schema. The response includes run_id and status. By default runs are async — poll for the result, or set sync: true to block until completion.

Basic usage

Request parameters

input_params keys must match names from the task’s input schema. Pass cleanup_sessions: false with session_id to keep the session open for follow-up work.

Task config vs session config

Browser settings — proxy, viewport, profile, timeouts, CAPTCHA solver — live in a session config: a session block and a browser block, same schema as starting a browser session. A task stores its own copy of that schema as task_default_browser_configuration. This is not sent on each run request. It tells Anchor how to configure the browser when it creates a session for you. Set task defaults once with PATCH /v1/tools/{toolId} (or task_browser_default_configuration on POST /v2/tasks/generate):
Set task_default_browser_configuration to null to clear it. Per-run, the only session-related fields on /run are session_id (use an existing session) and identity_id (authenticate that session). Everything else comes from the task default or the session you created. See Proxy, Session timeout, and CAPTCHA solving for common session and browser options.

Get results

Sync — add "sync": true to the run request. The response includes result on success or error on failure. Async (default) — poll GET /v2/tasks/runs/{runId}/status until status is success, failure, timeout, or cancelled.
node.js
python
Use sync for short tasks and scripts. Poll for long-running production runs.
Tasks with output file only may return the file in the HTTP body when sync: true instead of JSON.

Next steps