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

# Update a Session

> Close a Browserbase session by updating its status to REQUEST_RELEASE, or update other mutable session fields.

## Closing a session

Use this endpoint to close an active Browserbase session before its timeout.

To close the session, send `status: "REQUEST_RELEASE"` in the request body (`projectId` is optional). This tells Browserbase to end the session and helps avoid unnecessary usage charges if your work is already complete.

```json theme={null}
{
  "status": "REQUEST_RELEASE"
}
```


## OpenAPI

````yaml post /v1/sessions/{id}
openapi: 3.0.0
info:
  title: Browserbase API
  description: Browserbase API for 3rd party developers
  version: v1
servers:
  - url: https://api.browserbase.com
    description: Public endpoint
    variables: {}
security:
  - BrowserbaseAuth: []
tags: []
paths:
  /v1/sessions/{id}:
    post:
      summary: Update a Session
      operationId: Sessions_update
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  description: >-
                    The Project ID. Can be found in
                    [Settings](https://www.browserbase.com/settings). Optional -
                    if not provided, the project will be inferred from the API
                    key.
                  type: string
                status:
                  description: >-
                    Set to `REQUEST_RELEASE` to request that the session
                    complete. Use before session's timeout to avoid additional
                    charges.
                  type: string
                  enum:
                    - REQUEST_RELEASE
              required:
                - status
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
components:
  schemas:
    Session:
      type: object
      properties:
        id:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        projectId:
          description: The Project ID linked to the Session.
          type: string
        startedAt:
          type: string
          format: date-time
        endedAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - PENDING
            - RUNNING
            - ERROR
            - TIMED_OUT
            - COMPLETED
        proxyBytes:
          description: >-
            Bytes used via the
            [Proxy](/features/stealth-mode#proxies-and-residential-ips)
          type: integer
        keepAlive:
          description: >-
            Indicates if the Session was created to be kept alive upon
            disconnections
          type: boolean
        contextId:
          description: Optional. The Context linked to the Session.
          type: string
        region:
          description: The region where the Session is running.
          type: string
          enum:
            - us-west-2
            - us-east-1
            - eu-central-1
            - ap-southeast-1
        userMetadata:
          description: >-
            Arbitrary user metadata to attach to the session. To learn more
            about user metadata, see [User
            Metadata](/features/sessions#user-metadata).
          type: object
          additionalProperties: true
          properties: {}
      required:
        - id
        - createdAt
        - updatedAt
        - projectId
        - status
        - proxyBytes
        - keepAlive
        - region
        - startedAt
        - expiresAt
  securitySchemes:
    BrowserbaseAuth:
      type: apiKey
      in: header
      name: X-BB-API-Key
      description: Your [Browserbase API Key](https://www.browserbase.com/settings).

````