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

# Retrieve a capture session

> <p>Retrieve a capture session by its ID.</p><p>Poll this after requesting completion: the session is a usable recording once <code>state</code> is <code>completed</code>.</p>



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/indices/openapi.documented.yml get /v1beta/capture_sessions/{id}
openapi: 3.1.0
info:
  title: Indices API
  description: 'The Indices REST API. See docs for details: https://docs.indices.io'
  version: 0.0.1
servers:
  - url: https://api.indices.io
security:
  - ApiKeyAuth: []
tags:
  - name: Capture Sessions
    description: >-
      Record a browser session; a completed capture is a reusable input for
      building connectors.
  - name: Connectors
    description: Manage connectors.
  - name: Runs
    description: Execute a connector.
  - name: Secrets
    description: Manage secrets like login credentials and API keys.
paths:
  /v1beta/capture_sessions/{id}:
    get:
      tags:
        - Capture Sessions
      summary: Retrieve a capture session
      description: >-
        <p>Retrieve a capture session by its ID.</p><p>Poll this after
        requesting completion: the session is a usable recording once
        <code>state</code> is <code>completed</code>.</p>
      operationId: retrieveCaptureSession
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The ID of the capture session to retrieve.
            title: Id
          description: The ID of the capture session to retrieve.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaptureSession'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Indices from 'indicesio';


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


            const captureSession = await
            client.beta.captureSessions.retrieve('id');


            console.log(captureSession.id);
        - lang: Python
          source: |-
            import os
            from indices import Indices

            client = Indices(
                api_key=os.environ.get("INDICES_API_KEY"),  # This is the default and can be omitted
            )
            capture_session = client.beta.capture_sessions.retrieve(
                "id",
            )
            print(capture_session.id)
components:
  schemas:
    CaptureSession:
      properties:
        id:
          type: string
          description: Unique identifier for the capture session.
          examples:
            - cap_0R3kPq8mWxYz1aBcDeFgHi
          example: cap_0R3kPq8mWxYz1aBcDeFgHi
        state:
          $ref: '#/components/schemas/CaptureSessionState'
          description: >-
            Current state of the capture session. A session records while
            active, is completing once completion is requested, and becomes a
            reusable recording once completed.
          examples:
            - active
          example: active
        browser_session_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Opaque identifier for the spawned browser session. Null once the
            browser is gone.
        iframe_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            URL to embed in an iframe to control the browser. Only usable while
            the session is active.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the object was created.
          examples:
            - '2026-01-01T12:00:00Z'
          example: '2026-01-01T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the object was last updated.
          examples:
            - '2026-01-06T12:05:00Z'
          example: '2026-01-06T12:05:00Z'
      type: object
      required:
        - id
        - state
        - browser_session_id
        - iframe_url
        - created_at
        - updated_at
      title: CaptureSession
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CaptureSessionState:
      type: string
      enum:
        - active
        - completing
        - completed
        - abandoned
        - failed
      title: CaptureSessionState
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Enter your API key as the bearer token. Set header: `Authorization` to
        `Bearer <api_key>`

````