---
title: "Purge Session"
method: POST
path: "/sessions/{session_id}/purge"
tags: ["Sessions"]
---

# Purge Session

`POST /sessions/{session_id}/purge`

## Request

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

Purge V4 session data; return 202 while active work or uploads defer deletion.

Redacts DB records and deletes S3 objects (bcode state, workspace files,
recordings, downloads, staging uploads) for every run in the session. Same
cleanup the ZDR cron performs, but on-demand; outstanding upload grants defer physical deletion. V4
analog of the V2 POST /sessions/{id}/purge. Surfaces shared with a still-live
sibling run are deferred by the same guards the cron uses.

## Path parameters

- `session_id` string, uuid, required

## Response `202`

Purge pending active work or outstanding uploads.

## Other responses

- `204`: Successful Response
- `403`: Project is not ZDR-enabled.
- `404`: Session not found.
- `422`: Validation Error

---

[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)
