Skip to main content
PATCH
/
tasks
/
{task_id}
Update Task
const options = {
  method: 'PATCH',
  headers: {'X-Browser-Use-API-Key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({action: 'stop'})
};

fetch('https://api.browser-use.com/api/v2/tasks/{task_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "llm": "<string>",
  "task": "<string>",
  "status": "created",
  "createdAt": "2023-11-07T05:31:56Z",
  "steps": [
    {
      "number": 123,
      "memory": "<string>",
      "evaluationPreviousGoal": "<string>",
      "nextGoal": "<string>",
      "url": "<string>",
      "actions": [
        "<string>"
      ],
      "screenshotUrl": "<string>"
    }
  ],
  "outputFiles": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "fileName": "<string>"
    }
  ],
  "startedAt": "2023-11-07T05:31:56Z",
  "finishedAt": "2023-11-07T05:31:56Z",
  "metadata": {},
  "output": "<string>",
  "browserUseVersion": "<string>",
  "isSuccess": true,
  "judgement": "<string>",
  "judgeVerdict": true,
  "cost": "<string>",
  "suggestions": [
    {}
  ]
}

Authorizations

X-Browser-Use-API-Key
string
header
required

Path Parameters

task_id
string<uuid>
required

Body

application/json

Request model for updating task state

action
enum<string>
required

The action to perform on the task

Available options:
stop,
stop_task_and_session

Response

Successful Response

View model for representing a task with its execution details

id
string<uuid>
required

Unique identifier for the task

sessionId
string<uuid>
required
llm
string
required

The LLM model used for this task represented as a string

task
string
required

The task prompt/instruction given to the agent

status
enum<string>
required

Current status of the task execution

Available options:
created,
started,
finished,
stopped
createdAt
string<date-time>
required

Naive UTC timestamp when the task was created

steps
TaskStepView · object[]
required
outputFiles
FileView · object[]
required
startedAt
string<date-time> | null

Naive UTC timestamp when the task was started (None if task has not started yet)

finishedAt
string<date-time> | null

Naive UTC timestamp when the task completed (None if still running)

metadata
Metadata · object

Optional additional metadata associated with the task set by the user

output
string | null

Final output/result of the task

browserUseVersion
string | null

Version of browser-use used for this task (older tasks may not have this set)

isSuccess
boolean | null

Whether the task was successful based on the agent's self-reported output (less reliable than the judge)

judgement
string | null

Stringified JSON object containing the full report from the judge

judgeVerdict
boolean | null

Judge verdict - True if the judge found the task to be successful, False otherwise (None if judge is not enabled)

cost
string | null

Total cost of the task in USD. This is the sum of all step costs incurred during task execution.

suggestions
Suggestions · object[] | null

List of actionable suggestions for improving task configuration based on detected issues during execution.