> ## Documentation Index
> Fetch the complete documentation index at: https://browseruse-0aece648-cursor-proxy-indicator-and-text-6cda.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Purge Session

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

Redacts PII from database records and deletes all S3 objects (screenshots,
output files, uploaded files, logs, history, downloads, agent state) for the
given session. This is the same cleanup the ZDR cron performs, but on-demand
and scoped to a single session with no grace period.



## OpenAPI

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


        Redacts PII from database records and deletes all S3 objects
        (screenshots,

        output files, uploaded files, logs, history, downloads, agent state) for
        the

        given session. This is the same cleanup the ZDR cron performs, but
        on-demand

        and scoped to a single session with no grace period.
      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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionNotFoundError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    SessionNotFoundError:
      properties:
        detail:
          type: string
          title: Detail
          default: Session not found
      type: object
      title: SessionNotFoundError
      description: Error response when a session is not found
    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

````