---
title: "Delete Session"
method: DELETE
path: "/sessions/{session_id}"
tags: ["Sessions"]
---

# Delete Session

`DELETE /sessions/{session_id}`

## Request

- Base URL: `https://api.browser-use.com/api/v4`
- URL: `https://api.browser-use.com/api/v4/sessions/{session_id}`
- Auth: API key in header `X-Browser-Use-API-Key`

Delete a session: it disappears from the session lists and can no longer
be opened or continued.

Soft delete (mirrors V2's `is_archived`): the runs, events and usage records
stay in place so billing and analytics keep reconciling, and ZDR purge is the
only thing that ever destroys V4 content. Idempotent — deleting twice is a
no-op 204.

An in-flight run is cancelled first, and pending queued messages are
cancelled too; otherwise the drain would dispatch a follow-up run whose
`session_archived_at` is NULL and resurrect the session. Cancel is forwarded
to CP before anything is written (and outside the queue lock, per the
enqueue path's ordering), so a CP failure (502) leaves the session visible
rather than hiding a run that is still burning credits.

## Path parameters

- `session_id` string, uuid, required

## Response `204`

Successful Response

## Other responses

- `403`: Zero Data Retention is enabled on the project (V4 unsupported).
- `404`: Run, session, workspace, or profile not found.
- `422`: Validation Error
- `502`: The request could not be forwarded to the control plane.
- `503`: The run is finishing; retry the cancel after Retry-After seconds.

---

[API](https://skmtc.dev/browser-use/apis/browser-use-public-api-v4.md) · [All operations](https://skmtc.dev/browser-use/apis/browser-use-public-api-v4/llms.txt) · [OpenAPI document](https://skmtc.dev/browser-use/apis/browser-use-public-api-v4/revisions/cd7b1eee1102?raw)
