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

# Start a manual session

> <p>Spawn a browser session for manual task completion. If a session already exists, it will be closed and replaced.</p>



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/indices/openapi.documented.yml post /v1beta/tasks/{id}/start-manual-session
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: Tasks
    description: Create a task to repeatedly perform an action on an external website.
  - name: Runs
    description: Execute a task.
  - name: Secrets
    description: Manage secrets like login credentials and API keys.
paths:
  /v1beta/tasks/{id}/start-manual-session:
    post:
      tags:
        - Tasks
      summary: Start a manual session
      description: >-
        <p>Spawn a browser session for manual task completion. If a session
        already exists, it will be closed and replaced.</p>
      operationId: task_startManualSession
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The ID of the task to perform manually.
            title: Id
          description: The ID of the task to perform manually.
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/StartManualSessionRequest'
                - type: 'null'
              title: Body
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpawnBrowserResponse'
        '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 response = await client.tasks.startManualSession('id');

            console.log(response.session_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
            )
            response = client.tasks.start_manual_session(
                id="id",
            )
            print(response.session_id)
components:
  schemas:
    StartManualSessionRequest:
      properties:
        use_proxy:
          type: boolean
          description: If true, spawn the browser session using a proxy.
          default: false
        cookies:
          items:
            $ref: '#/components/schemas/SessionCookie'
          type: array
          description: Initial cookies to set in the browser session.
      type: object
      title: StartManualSessionRequest
    SpawnBrowserResponse:
      properties:
        session_id:
          type: string
          description: Opaque identifier for the spawned browser session.
        iframe_url:
          type: string
          description: URL to embed in an iframe to control the browser.
      type: object
      required:
        - session_id
        - iframe_url
      title: SpawnBrowserResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SessionCookie:
      properties:
        name:
          type: string
          description: The name of the cookie.
        value:
          type: string
          description: The value of the cookie.
        domain:
          anyOf:
            - type: string
            - type: 'null'
          description: The domain of the cookie.
        path:
          anyOf:
            - type: string
            - type: 'null'
          description: The path of the cookie.
        secure:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Whether the cookie is secure.
        http_only:
          anyOf:
            - type: boolean
            - type: 'null'
          description: Whether the cookie is HTTP only.
      type: object
      required:
        - name
        - value
      title: SessionCookie
      description: A cookie to set in the browser session.
    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>`

````