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

# Close browser session

> Closes a ready session and releases its resources. An already closed, failed, or expired session is returned unchanged; a provisioning session returns 409 session_not_ready.



## OpenAPI

````yaml /openapi/source/external/agent-browser/agent-browser.json delete /browser_sessions/{id}
openapi: 3.1.0
info:
  version: 1.0.0
  title: Telnyx API
  x-latency-category: interactive
  x-endpoint-cost: light
  description: >-
    Isolated, short-lived browser sessions for AI agents — navigate, observe,
    click, fill, and screenshot through one API.


    ## Authentication


    All endpoints require a Telnyx API key sent as a Bearer token in the
    `Authorization` header.


    ## Session Quota


    Creating a session is subject to a concurrent-session quota per
    organization. When capacity is exhausted, create returns `429
    quota_exceeded` with `retryable: true`. Close unneeded active sessions or
    wait for capacity before retrying.


    ## Error Responses


    Request errors use `{ "error": { "code": string, "message": string,
    "retryable": boolean } }`. Execution failures are reported on action
    resources with HTTP 200 and `data.status` set to `failed` or `unknown`. A
    request can also return HTTP 503 `execution_lost`; inspect action and
    session state before retrying because the action may already have taken
    effect.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Telnyx API v2
security:
  - bearerAuth: []
tags:
  - name: Browser Sessions
    description: Create, list, get, and close browser sessions.
  - name: Actions
    description: >-
      Execute browser actions: navigate, observe, click, fill, select, press,
      scroll, wait_for, screenshot, batch.
  - name: Artifacts
    description: Download screenshots and other artifacts.
paths:
  /browser_sessions/{id}:
    delete:
      tags:
        - Browser Sessions
      summary: Close browser session
      description: >-
        Closes a ready session and releases its resources. An already closed,
        failed, or expired session is returned unchanged; a provisioning session
        returns 409 session_not_ready.
      operationId: CloseBrowserSession
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Session after close, or its unchanged terminal state.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Session'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            Session is still provisioning. Poll its state before retrying the
            close.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: session_not_ready
                  message: session is still provisioning
                  retryable: true
        '503':
          description: >-
            The request could not be completed reliably. Retrieve action and
            session state before retrying; a mutation may already have taken
            effect. Do not blindly repeat it with a new idempotency key or
            session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: execution_lost
                  message: Request could not be completed reliably
                  retryable: true
components:
  schemas:
    Session:
      type: object
      properties:
        id:
          type: string
          example: bsess_3b108e10-906a-486e-9132-196726ba7979
        status:
          type: string
          enum:
            - provisioning
            - ready
            - closing
            - closed
            - failed
            - expired
        failure_reason:
          type:
            - string
            - 'null'
        policy:
          type: object
          properties:
            allowed_domains:
              type: array
              items:
                type: string
          required:
            - allowed_domains
        limits:
          type: object
          properties:
            lifetime_s:
              type: integer
            idle_timeout_s:
              type: integer
          required:
            - lifetime_s
            - idle_timeout_s
        metadata:
          type: object
        created_at:
          type: string
          format: date-time
        ready_at:
          type:
            - string
            - 'null'
          format: date-time
        last_activity_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        closed_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - status
        - failure_reason
        - policy
        - limits
        - metadata
        - created_at
        - ready_at
        - last_activity_at
        - expires_at
        - closed_at
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
          required:
            - code
            - message
            - retryable
      required:
        - error
    GatewayError:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - code
              - title
            properties:
              code:
                type: string
              title:
                type: string
              detail:
                type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
              meta:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
  responses:
    Unauthorized:
      description: Unauthorized — missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GatewayError'
          example:
            errors:
              - code: '10009'
                title: Authentication failed
                detail: Could not find any usable credentials in the request.
                source:
                  pointer: /
                meta:
                  url: https://developers.telnyx.com/docs/overview/errors/10009
    NotFound:
      description: Session or artifact not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: not_found
              message: session not found
              retryable: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````