Update Task
Control task execution with stop, pause, resume, or stop task and session actions.
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({})
};
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));curl --request PATCH \
--url https://api.browser-use.com/api/v2/tasks/{task_id} \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '{}'import requests
url = "https://api.browser-use.com/api/v2/tasks/{task_id}"
payload = {}
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"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>",
"duration": 123
}
],
"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": [
{}
]
}{
"detail": "Task not found"
}{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}Body
application/json
Response
Successful Response
View model for representing a task with its execution details
Was this page helpful?
⌘I
Update Task
const options = {
method: 'PATCH',
headers: {'X-Browser-Use-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
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));curl --request PATCH \
--url https://api.browser-use.com/api/v2/tasks/{task_id} \
--header 'Content-Type: application/json' \
--header 'X-Browser-Use-API-Key: <api-key>' \
--data '{}'import requests
url = "https://api.browser-use.com/api/v2/tasks/{task_id}"
payload = {}
headers = {
"X-Browser-Use-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"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>",
"duration": 123
}
],
"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": [
{}
]
}{
"detail": "Task not found"
}{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}