> ## Documentation Index
> Fetch the complete documentation index at: https://docs.browser-use.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Purge Session

> Immediately purge all data for a V4 session (ZDR projects only).

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 and with no grace period. 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.



## OpenAPI

````yaml /cloud/openapi/v4.json post /sessions/{session_id}/purge
openapi: 3.1.0
info:
  title: Browser Use Public API v4
  summary: Browser Use agent runs API (v4)
  version: 4.0.0
servers:
  - url: https://api.browser-use.com/api/v4
    description: Production server
security: []
paths:
  /sessions/{session_id}/purge:
    post:
      tags:
        - Sessions
      summary: Purge Session
      description: >-
        Immediately purge all data for a V4 session (ZDR projects only).


        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 and with no grace period.
        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.
      operationId: purge_session_sessions__session_id__purge_post
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Session Id
      responses:
        '204':
          description: Successful Response
        '403':
          description: Project is not ZDR-enabled.
        '404':
          description: Session not found.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-Browser-Use-API-Key

````