---
title: "Publish Task Version (Legacy)"
method: POST
path: "/v1/task/{taskId}/{taskVersion}"
tags: ["Tasks (Legacy)"]
---

# Publish Task Version (Legacy)

`POST /v1/task/{taskId}/{taskVersion}`

## Request

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

Publishes a specific version of a task. This creates a new version if it doesn't exist,
or updates an existing version's metadata.

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

## Path parameters

- `taskId` string, uuid, required
- `taskVersion` string, required

## Request body

- PublishVersionRequest
  - `code` string: Base64 encoded task code (required for new versions)
  - `language` 'typescript': Programming language for the task
  - `description` string: Optional description of the version
  - `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 version published successfully

- TaskVersionResponse
  - `data` TaskVersion
    - `id` string, uuid, required: Unique identifier for the task version
    - `taskId` string, uuid, required: Parent task identifier
    - `version` string, required: Version identifier (draft, latest, or version number)
    - `code` string, required: Base64 encoded task code
    - `language` 'typescript': Programming language for the task
    - `description` string: Optional description of the version
    - `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 version is soft deleted
    - `createdAt` string, date-time, required: Version creation timestamp
    - `updatedAt` string, date-time, required: Version last update timestamp

## Other responses

- `400`: Cannot publish to draft version
- `404`: Task not found
- `500`: Failed to publish task version

## 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/:taskId/:taskVersion/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)
