> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anchorbrowser.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Latest Task Version (Legacy)

> Retrieves the latest version of a task, including the full code content.

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




## OpenAPI

````yaml /openapi.yaml get /v1/task/{taskId}/latest
openapi: 3.1.0
info:
  title: AnchorBrowser API
  version: 1.0.0
  description: APIs to manage all browser-related actions and configuration.
servers:
  - url: https://api.anchorbrowser.io
    description: API server
security: []
paths:
  /v1/task/{taskId}/latest:
    get:
      tags:
        - Tasks (Legacy)
      summary: Get Latest Task Version (Legacy)
      description: >
        Retrieves the latest version of a task, including the full code content.


        If you are using the new Task Builder, see the non-deprecated Tasks
        endpoints in this API reference.
      parameters:
        - name: taskId
          in: path
          required: true
          description: The ID of the task
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Latest task version retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskVersionResponse'
        '404':
          description: Task or version not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Failed to retrieve task version
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key_header: []
components:
  schemas:
    TaskVersionResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/TaskVersion'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
    TaskVersion:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the task version
        taskId:
          type: string
          format: uuid
          description: Parent task identifier
        version:
          type: string
          description: Version identifier (draft, latest, or version number)
        code:
          type: string
          description: Base64 encoded task code
        language:
          type: string
          enum:
            - typescript
          description: Programming language for the task
        description:
          type: string
          maxLength: 1000
          description: Optional description of the version
        browserConfiguration:
          $ref: '#/components/schemas/SessionConfig'
          description: Browser configuration for task execution
        deleted:
          type: boolean
          description: Whether the version is soft deleted
        createdAt:
          type: string
          format: date-time
          description: Version creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Version last update timestamp
      required:
        - id
        - taskId
        - version
        - code
        - deleted
        - createdAt
        - updatedAt
    SessionConfig:
      type: object
      description: Session-related configurations.
      properties:
        initial_url:
          type: string
          format: uri
          description: >-
            The URL to navigate to when the browser session starts. If not
            provided, the browser will load an empty page.
        tags:
          type: array
          items:
            type: string
          description: >-
            Custom labels to categorize and identify browser sessions. Useful
            for filtering, organizing, and tracking sessions across your
            workflows.
          example:
            - production
            - scraping
            - customer-123
        recording:
          type: object
          description: Configuration for session recording.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable video recording of the browser session.
                Defaults to `true`.
        proxy:
          $ref: '#/components/schemas/ProxyConfig'
        timeout:
          type: object
          description: Timeout configurations for the browser session.
          properties:
            max_duration:
              type: integer
              description: >-
                Maximum time (in minutes) the session can run before
                automatically terminating. Defaults to `20`. Set to `-1` to
                disable this limit.
            idle_timeout:
              type: integer
              description: >-
                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:
          type: object
          description: Configuration for live viewing the browser session.
          properties:
            read_only:
              type: boolean
              description: >-
                Enable or disable read-only mode for live viewing. Defaults to
                `false`.
            one_time_url:
              type: boolean
              description: >-
                Generate a single-use live view URL. After the first viewer
                connects, the link becomes invalid. Requires a headful browser.
                Defaults to `false`.
    ProxyConfig:
      description: |
        Proxy Documentation available at [Proxy Documentation](/advanced/proxy)
      type: object
      oneOf:
        - $ref: '#/components/schemas/AnchorProxy'
        - $ref: '#/components/schemas/CustomProxy'
    AnchorProxy:
      title: Anchor Proxy
      type: object
      properties:
        active:
          type: boolean
        type:
          type: string
          enum:
            - anchor_proxy
          description: >-
            Create a session with a proxy to access websites as if you're
            browsing from a computer in that country.
          title: anchor_proxy
        country_code:
          $ref: '#/components/schemas/AnchorProxyCountryCode'
          description: |
            Supported country codes ISO 2 lowercase
        region:
          type: string
          description: |
            Region code for more specific geographic targeting.
            The city parameter can only be used when region is also provided.
        city:
          type: string
          description: >
            City name for precise geographic targeting. Supported for
            anchor_proxy only.

            Can only be used when region is also provided.
      required:
        - active
    CustomProxy:
      title: Custom Proxy
      type: object
      properties:
        type:
          type: string
          enum:
            - custom
        server:
          type: string
          description: >-
            Proxy address in **PROTOCOL://HOST:PORT** format (e.g.,
            https://proxy.example.com:443). See [proxy
            page](/advanced/proxy#custom-proxy).
        username:
          type: string
          description: Proxy username
        password:
          type: string
          description: Proxy password
        active:
          type: boolean
      required:
        - type
        - server
        - username
        - password
        - active
    AnchorProxyCountryCode:
      type: string
      title: anchor_proxy
      enum:
        - 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
      default: us
  securitySchemes:
    api_key_header:
      type: apiKey
      in: header
      name: anchor-api-key
      description: API key passed in the header

````