> ## 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.

# Get browser session

> Returns the current status of a browser session.



## OpenAPI

````yaml /openapi/source/external/agent-browser/agent-browser.json get /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}:
    get:
      tags:
        - Browser Sessions
      summary: Get browser session
      description: Returns the current status of a browser session.
      operationId: GetBrowserSession
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Session details
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Session'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.browserSessions.retrieve('id');

            console.log(response.data);
        - lang: Python
          source: |
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.browser_sessions.retrieve(
                "id",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tbrowserSession, err := client.BrowserSessions.Get(\n\t\tcontext.TODO(),\n\t\t\"id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", browserSession.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    var response = client.browserSessions().retrieve("id");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.browser_sessions.retrieve("id")

            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->browserSessions->retrieve(
                'id',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx browser-sessions retrieve \
              --api-key 'My API Key' \
              --id id
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
          additionalProperties: true
        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
    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
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
          required:
            - code
            - message
            - retryable
      required:
        - error
  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

````