---
title: "Run a Task"
method: POST
path: "/v2/tasks/{taskId}/run"
tags: ["Tasks"]
---

# Run a Task

`POST /v2/tasks/{taskId}/run`

Triggers execution of a task by ID using the V2 tasks API.

## Path parameters

- `taskId` string, required

## Request body

- RunTaskRequest
  - `input_params` object, required — Key-value pairs of input parameters for the task
  - `identity_id` string — Optional identity ID to use for the task
  - `session_id` string — Optional session ID to run the task in
  - `cleanup_sessions` boolean — Whether to clean up sessions after execution (default: true)

## Response `200`

Task run started successfully

- TaskRunStatusResponse
  - `run_id` string, required — The ID of the task run
  - `status` 'queued' | 'running' | 'success' | 'failure' | 'timeout' | 'cancelled', required — Current task run status
  - `result` object — Task output when available
  - `error` string — Error message when the run fails
  - `session_id` string — Session ID used for this task run

## Other responses

- `404` — Task not found
- `500` — Failed to run task

## Changes

- **2026-04-23** `5d2f7ab256a4` — 1 info
  - the `cleanup_sessions` request property default value `true` was added
- **2026-03-20** `c1198ecebd31` — 2 info
  - api tag `Tasks` added
  - api tag `Tasks V2` removed
- **2026-02-25** `ae25b3e0f20d` — 1 info
  - endpoint added
- **2026-02-18** `4d2d945e5967` — 1 breaking
  - api path removed without deprecation
- **2026-02-18** `cdc369172404` — 1 info
  - endpoint added

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