---
title: "Generate Task"
method: POST
path: "/v2/tasks/generate"
tags: ["Tasks"]
---

# Generate Task

`POST /v2/tasks/generate`

Initiates asynchronous task generation. Use the returned task ID to poll for completion, then execute the task.

## Request body

- GenerateTaskRequest — Request body for generating a new task. The task is created asynchronously; use the returned task ID with the generation-status endpoint to poll for completion.
  - `name` string, required — Name of the task
  - `description` string, required — Description of the task
  - `user_task` string, required — Natural language description of what the task should do (used for AI generation)
  - `application_id` string, uuid — Optional application (connection) ID to associate with the task
  - `input_schema` TaskInputAndOutputSchemaParameter[] — Optional list of input parameters for the task. Defaults to empty array.
    - `display_name` string, required — Human-readable name for the parameter
    - `type` 'string' | 'number' | 'boolean' | 'date', required — Data type of the parameter
    - `required` boolean — Whether the parameter is required
    - `description` string — Optional description of the parameter
    - `default_value` string — Optional default value as a string
  - `output_schema` TaskInputAndOutputSchemaParameter[] — Optional list of output parameters for the task. Defaults to empty array.
    - `display_name` string, required — Human-readable name for the parameter
    - `type` 'string' | 'number' | 'boolean' | 'date', required — Data type of the parameter
    - `required` boolean — Whether the parameter is required
    - `description` string — Optional description of the parameter
    - `default_value` string — Optional default value as a string
  - `task_browser_default_configuration` 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 generation started successfully

- GenerateTaskResponse — Response when task generation has been started (generation is asynchronous).
  - `id` string, required — The ID of the created task (use with generation-status and run endpoints)
  - `status` 'generating', required — Whether the task is still generating, ready to run, or failed.

## Other responses

- `400` — Invalid request or validation failed
- `500` — Failed to start task generation

## Changes

- **2026-03-20** `c1198ecebd31` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/anchorbrowser/apis/anchorbrowser-api/changes/v2/tasks/generate/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/d0f5aa64f9f4/schema)
