---
title: "Run Task (Legacy)"
method: POST
path: "/v1/task/run"
tags: ["Tasks (Legacy)"]
---

# Run Task (Legacy)

`POST /v1/task/run`

## Request

- Base URL: `https://api.anchorbrowser.io`
- URL: `https://api.anchorbrowser.io/v1/task/run`
- Auth: API key in header `anchor-api-key`

Executes a task in a browser session. The task can be run with a specific version or the latest version.
Optionally, you can provide an existing session ID or let the system create a new one.

If you are using the new Task Builder, see the non-deprecated Tasks endpoints in this API reference.

## Request body

- RunTaskRequest
  - `taskId` string, uuid, required: Task identifier
  - `version` string: Version to run (draft, latest, or version number)
  - `sessionId` string, uuid: Optional existing browser session ID to use for task execution
  - `async` boolean: Whether to run the task asynchronously.
  - `overrideBrowserConfiguration` SessionConfig: Session-related configurations.
    - `initial_url` string, uri: The URL to navigate to when the browser session starts. If not provided, the browser will load an empty page.
    - `tags` string[]: Custom labels to categorize and identify browser sessions. Useful for filtering, organizing, and tracking sessions across your workflows.
    - `recording` object: Configuration for session recording.
      - `active` boolean: Enable or disable video recording of the browser session. Defaults to `true`.
    - `proxy` union: Proxy Documentation available at [Proxy Documentation](/advanced/proxy)
      - object
        - `active` boolean, required
        - `type` 'anchor_proxy': Create a session with a proxy to access websites as if you're browsing from a computer in that country.
        - `country_code` 'af' | 'al' | 'dz' | 'ad' | 'ao' | 'as' | 'ag' | 'ar' | 'am' | 'aw' | 'au' | 'at' | 'az' | 'bs' | 'bh' | 'bb' | 'by' | 'be' | 'bz' | 'bj' | 'bm' | 'bo' | 'ba' | 'br' | 'bg' | 'bf' | 'cm' | 'ca' | 'cv' | 'td' | 'cl' | 'co' | 'cg' | 'cr' | 'ci' | 'hr' | 'cu' | 'cy' | 'cz' | 'dk' | 'dm' | 'do' | 'ec' | 'eg' | 'sv' | 'ee' | 'et' | 'fo' | 'fi' | 'fr' | 'gf' | 'pf' | 'ga' | 'gm' | 'ge' | 'de' | 'gh' | 'gi' | 'gr' | 'gd' | 'gp' | 'gt' | 'gg' | 'gn' | 'gw' | 'gy' | 'ht' | 'hn' | 'hu' | 'is' | 'in' | 'ir' | 'iq' | 'ie' | 'il' | 'it' | 'jm' | 'jp' | 'jo' | 'kz' | 'kw' | 'kg' | 'lv' | 'lb' | 'ly' | 'li' | 'lt' | 'lu' | 'mk' | 'ml' | 'mt' | 'mq' | 'mr' | 'mx' | 'md' | 'mc' | 'me' | 'ma' | 'nl' | 'nz' | 'ni' | 'ng' | 'no' | 'pk' | 'pa' | 'py' | 'pe' | 'ph' | 'pl' | 'pt' | 'pr' | 'qa' | 'ro' | 'lc' | 'sm' | 'sa' | 'sn' | 'rs' | 'sc' | 'sl' | 'sk' | 'si' | 'so' | 'za' | 'kr' | 'es' | 'sr' | 'se' | 'ch' | 'sy' | 'st' | 'tw' | 'tj' | 'tg' | 'tt' | 'tn' | 'tr' | 'tc' | 'ua' | 'ae' | 'us' | 'uy' | 'uz' | 've' | 'ye'
        - `region` string: Region code for more specific geographic targeting. The city parameter can only be used when region is also provided.
        - `city` string: City name for precise geographic targeting. Supported for anchor_proxy only. Can only be used when region is also provided.
      - object
        - `type` 'custom', required
        - `server` string, required: Proxy address in **PROTOCOL://HOST:PORT** format (e.g., https://proxy.example.com:443). See [Bring Your Own Proxy](/advanced/bring-your-own-proxy).
        - `username` string, required: Proxy username
        - `password` string, required: Proxy password
        - `active` boolean, required
    - `timeout` object: Timeout configurations for the browser session.
      - `max_duration` integer: Maximum time (in minutes) the session can run before automatically terminating. Defaults to `20`. Set to `-1` to disable this limit.
      - `idle_timeout` integer: Time (in minutes) the session waits for new connections after all others are closed before stopping. Defaults to `5`. Set to `-1` to disable this limit.
    - `live_view` object: Configuration for live viewing the browser session.
      - `read_only` boolean: Enable or disable read-only mode for live viewing. Defaults to `false`.
      - `one_time_url` boolean: Generate a single-use live view URL. After the first viewer connects, the link becomes invalid. Requires a headful browser. Defaults to `false`.
    - `x402` boolean: Allow this browser session to automatically pay x402-protected resources using Amazon Bedrock AgentCore Payments.
    - `domain_allowlist` string[]: Domains this session may navigate to. `example.com` allows that domain and its subdomains. Document navigations to every other http or https site, including redirects, are blocked. Omit the field to allow the public web. The same field may be set on an API key, application, or task default, or in the project's enforced session configuration. Not available when session.hardware is mac.
  - `inputs` object: Environment variables for task execution (keys must start with ANCHOR_)
  - `cleanupSessions` boolean: Whether to cleanup browser sessions after task execution. Defaults to true.

## Response `200`

Task executed successfully

- RunTaskResponse
  - `data` object
    - `success` boolean, required: Whether the task executed successfully
    - `async` boolean, required: Whether the task was executed asynchronously
    - `message` string, required: Execution result message
    - `taskId` string, uuid, required: Task identifier
    - `executionTime` number: Execution duration in milliseconds (only present in sync mode)
    - `output` string: Task execution output (only present in sync mode)
    - `error` string: Error message if execution failed (only present in sync mode)
    - `executionResultId` string, uuid: Execution result identifier for tracking and polling (present in async mode)

## Other responses

- `404`: Task or session not found
- `500`: Task execution failed

## Changes

- **2026-11-06** `9d755f22df0e`: 1 info
  - added the new optional request property `overrideBrowserConfiguration/domain_allowlist`
- **2026-10-16** `b3bfdb98c79e`: 1 info
  - endpoint added
- **2026-03-20** `c1198ecebd31`: 1 breaking
  - api path removed without deprecation
- **2026-02-10** `00b41ac4ada2`: 5 breaking, 147 info
  - request property `overrideBrowserConfiguration/proxy/oneOf[subschema #1: Anchor Proxy]/country_code` was restricted to a list of enum values
  - request property `overrideBrowserConfiguration/proxy/oneOf[subschema #1: Anchor Proxy]/type` was restricted to a list of enum values
  - removed `#/components/schemas/AnchorProxyCountryCode, #/components/schemas/ResidentialCountryCode, #/components/schemas/MobileCountryCode, #/components/schemas/GovCountryCode` from the `overrideBrowserConfiguration/proxy/oneOf[subschema #1: Anchor Proxy]/country_code` request property `oneOf` list
  - removed `subschema #1: anchor_residential, subschema #2: anchor_mobile, subschema #3: anchor_gov, subschema #4: anchor_proxy` from the `overrideBrowserConfiguration/proxy/oneOf[subschema #1: Anchor Proxy]/type` request property `oneOf` list
  - …148 more
- **2026-01-11** `8f77fa55fe1f`: 2 info
  - added the new optional request property `cleanupSessions`
  - added the new optional request property `sessionId`

[Operation history](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api/changes/v1/task/run/post.md)

---

[API](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api.md) - [All operations](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api/revisions/9d755f22df0e?raw)
