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

# Create Task (Legacy)

`POST /v1/task`

## Request

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

Creates a new task or updates an existing task with the same name. Tasks are reusable code snippets 
that can be executed in browser sessions. Tasks support versioning with draft and published versions.

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

## Request body

- CreateTaskRequest
  - `name` string, required: Task name (letters, numbers, hyphens, and underscores only)
  - `code` string: Base64 encoded task code (optional)
  - `language` 'typescript', required: Programming language for the task
  - `description` string: Optional description of the task
  - `browserConfiguration` 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.

## Response `200`

Task created or updated successfully

- TaskResponse
  - `data` Task
    - `id` string, uuid, required: Unique identifier for the task
    - `name` string, required: Task name (letters, numbers, hyphens, and underscores only)
    - `teamId` string, uuid, required: Team identifier that owns this task
    - `description` string: Optional description of the task
    - `latestVersion` string, required: Latest version identifier (draft, latest, or version number)
    - `code` string, required: Base64 encoded task code
    - `language` 'typescript', required: Programming language for the task
    - `browserConfiguration` 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.
    - `deleted` boolean, required: Whether the task is soft deleted
    - `createdAt` string, date-time, required: Task creation timestamp
    - `updatedAt` string, date-time, required: Task last update timestamp

## Other responses

- `400`: Invalid request or validation failed
- `409`: Task name already exists
- `500`: Failed to create task

## Changes

- **2026-11-06** `9d755f22df0e`: 2 info
  - added the new optional request property `browserConfiguration/domain_allowlist`
  - added the optional property `data/browserConfiguration/domain_allowlist` to the response with the `200` status
- **2026-10-16** `b3bfdb98c79e`: 1 info
  - endpoint added
- **2026-03-20** `c1198ecebd31`: 1 breaking
  - api path removed without deprecation
- **2026-02-25** `ae25b3e0f20d`: 2 info
  - api tag `Tasks (Legacy)` added
  - api tag `Tasks` removed
- **2026-02-18** `4d2d945e5967`: 2 info
  - api tag `Tasks` added
  - api tag `Tasks (Legacy)` removed

[Operation history](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api/changes/v1/task/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)
