Browserbase Sessions API

The Sessions API from Browserbase — 6 operation(s) for sessions.

Documentation

Specifications

SDKs

Schemas & Data

Other Resources

OpenAPI Specification

browserbase-sessions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Browserbase Contexts Sessions API
  description: Browserbase exposes managed headless Chromium browser sessions, contexts, projects, recordings, logs, and downloads for AI agents and web automation. Requests authenticate via the X-BB-API-Key header.
  version: v1
  contact:
    name: Browserbase
    url: https://docs.browserbase.com
servers:
- url: https://api.browserbase.com/v1
  description: Production
security:
- ApiKeyAuth: []
tags:
- name: Sessions
paths:
  /sessions:
    post:
      summary: Create a session
      operationId: createSession
      tags:
      - Sessions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionCreate'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
    get:
      summary: List sessions
      operationId: listSessions
      tags:
      - Sessions
      parameters:
      - name: status
        in: query
        schema:
          type: string
          enum:
          - RUNNING
          - ERROR
          - TIMED_OUT
          - COMPLETED
      responses:
        '200':
          description: List of sessions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Session'
  /sessions/{id}:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get a session
      operationId: getSession
      tags:
      - Sessions
      responses:
        '200':
          description: Session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
    post:
      summary: Update a session
      operationId: updateSession
      tags:
      - Sessions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                  - REQUEST_RELEASE
      responses:
        '200':
          description: Session updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
  /sessions/{id}/logs:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get session logs
      operationId: getSessionLogs
      tags:
      - Sessions
      responses:
        '200':
          description: Logs
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /sessions/{id}/recording:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get session recording
      operationId: getSessionRecording
      tags:
      - Sessions
      responses:
        '200':
          description: Recording events
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /sessions/{id}/downloads:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get session downloads
      operationId: getSessionDownloads
      tags:
      - Sessions
      responses:
        '200':
          description: Downloads zipped
          content:
            application/zip:
              schema:
                type: string
                format: binary
  /sessions/{id}/debug:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get session debug URLs
      operationId: getSessionDebug
      tags:
      - Sessions
      responses:
        '200':
          description: Debug URLs
          content:
            application/json:
              schema:
                type: object
                properties:
                  debuggerUrl:
                    type: string
                    format: uri
                  debuggerFullscreenUrl:
                    type: string
                    format: uri
                  wsUrl:
                    type: string
components:
  schemas:
    SessionCreate:
      type: object
      required:
      - projectId
      properties:
        projectId:
          type: string
        extensionId:
          type: string
        browserSettings:
          type: object
          properties:
            context:
              type: object
              properties:
                id:
                  type: string
                persist:
                  type: boolean
            viewport:
              type: object
              properties:
                width:
                  type: integer
                height:
                  type: integer
            blockAds:
              type: boolean
            solveCaptchas:
              type: boolean
            recordSession:
              type: boolean
            logSession:
              type: boolean
            advancedStealth:
              type: boolean
            os:
              type: string
              enum:
              - windows
              - mac
              - linux
              - mobile
              - tablet
            ignoreCertificateErrors:
              type: boolean
        timeout:
          type: integer
          minimum: 60
          maximum: 21600
        keepAlive:
          type: boolean
        proxies:
          oneOf:
          - type: boolean
          - type: array
            items:
              type: object
        region:
          type: string
          enum:
          - us-west-2
          - us-east-1
          - eu-central-1
          - ap-southeast-1
        userMetadata:
          type: object
          additionalProperties: true
    Session:
      type: object
      properties:
        id:
          type: string
        connectUrl:
          type: string
        seleniumRemoteUrl:
          type: string
        signingKey:
          type: string
        status:
          type: string
          enum:
          - PENDING
          - RUNNING
          - ERROR
          - TIMED_OUT
          - COMPLETED
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        startedAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
        projectId:
          type: string
        region:
          type: string
        keepAlive:
          type: boolean
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-BB-API-Key