---
title: "Create or Update Task Draft"
method: POST
path: "/v1/task/{taskId}/draft"
tags: ["Tasks"]
---

# Create or Update Task Draft

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

Creates or updates the draft version of a task. Draft versions are used for development
and testing before publishing.

## Path parameters

- `taskId` string, uuid, required

## Request body

- DraftTaskRequest
  - `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.
    - `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 [proxy page](/advanced/proxy#custom-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 amount of time (in minutes) for the browser to run before terminating. Defaults to `20`.
      - `idle_timeout` integer — The amount of time (in minutes) the browser session waits for new connections after all others are closed before stopping. Defaults to `5`.
    - `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`.

## Response `200`

Task draft created or updated 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.
      - `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 [proxy page](/advanced/proxy#custom-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 amount of time (in minutes) for the browser to run before terminating. Defaults to `20`.
        - `idle_timeout` integer — The amount of time (in minutes) the browser session waits for new connections after all others are closed before stopping. Defaults to `5`.
      - `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`.
    - `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

- `404` — Task not found
- `500` — Failed to create or update task draft

## Changes

- **2026-02-10** `00b41ac4ada2` — 6 breaking, 146 warning, 150 info
  - request property `browserConfiguration/proxy/oneOf[subschema #1: Anchor Proxy]/country_code` was restricted to a list of enum values
  - request property `browserConfiguration/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 `browserConfiguration/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 `browserConfiguration/proxy/oneOf[subschema #1: Anchor Proxy]/type` request property `oneOf` list
  - …298 more
- **2025-10-20** `918bcdcb6208` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api/changes/v1/task/:taskId/draft/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-service-production.skmtc.workers.dev/v1/apis/anchorbrowser/anchorbrowser-api/revisions/7ca761db9371/schema)
