Skip to main content
PATCH
/
sessions
/
{session_id}
Update Session
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/sessions/{session_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "active",
  "startedAt": "2023-11-07T05:31:56Z",
  "tasks": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "llm": "<string>",
      "task": "<string>",
      "status": "created",
      "createdAt": "2023-11-07T05:31:56Z",
      "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": [
        {}
      ]
    }
  ],
  "liveUrl": "<string>",
  "finishedAt": "2023-11-07T05:31:56Z",
  "publicShareUrl": "<string>",
  "persistMemory": true,
  "keepAlive": true,
  "proxyUsedMb": "0",
  "proxyCost": "0"
}

Authorizations

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

Path Parameters

session_id
string<uuid>
required

Body

application/json

Request model for updating session state.

action
enum<string>
required

The action to perform on the session

Available options:
stop

Response

Successful Response

View model for representing a (browser) session with its associated tasks.

id
string<uuid>
required

Unique identifier for the session

status
enum<string>
required

Current status of the session (active/stopped)

Available options:
active,
stopped
startedAt
string<date-time>
required

Timestamp when the session was created and started

tasks
TaskItemView · object[]
required

List of tasks associated with this session

liveUrl
string | null

URL where the browser can be viewed live in real-time

finishedAt
string<date-time> | null

Timestamp when the session was stopped (None if still active)

publicShareUrl
string | null

Optional URL to access the public share of the session

persistMemory
boolean
default:true

Whether tasks in this session share memory and history with each other

keepAlive
boolean
default:true

Whether the browser session stays alive after tasks complete

proxyUsedMb
string
default:0

Amount of proxy data used in MB

proxyCost
string
default:0

Cost of proxy usage in USD