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

# Take over a browser session

> A person takes the page: `control` becomes `person`. The agent's step in flight is let finish (briefly) and its run is then suspended at its next browser step — while a person is in control the agent neither acts on the page nor reads anything from it. Hand it back with `POST /v1/browser-sessions/{id}/hand-back`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/browser-sessions/{id}/take-over
openapi: 3.1.0
info:
  title: Sidenet API
  version: 1.0.0
  description: >-
    Sidenet HTTP endpoints exposed by the Sidenet Studio. All routes require an
    api key that can be generated through the studio in studio.sidenet.ai.
servers:
  - url: https://api.sidenet.ai
security:
  - bearerAuth: []
paths:
  /v1/browser-sessions/{id}/take-over:
    post:
      tags:
        - Browser
      summary: Take over a browser session
      description: >-
        A person takes the page: `control` becomes `person`. The agent's step in
        flight is let finish (briefly) and its run is then suspended at its next
        browser step — while a person is in control the agent neither acts on
        the page nor reads anything from it. Hand it back with `POST
        /v1/browser-sessions/{id}/hand-back`.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            example: bs_3f9a1c0e5b7d2a4c6e8f0b1d
          description: The browser session id.
      responses:
        '200':
          description: 'The session, with `control: "person"`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: >-
                      The session id. Sidenet's own: it is what every route here
                      takes.
                  status:
                    type: string
                    enum:
                      - live
                      - waiting_person
                      - waiting_approval
                      - done
                      - stopped
                      - failed
                    description: >-
                      `waiting_person`: the agent waits for a person (a
                      take-over, a pause, a code or a sign-in it asked for).
                      `waiting_approval`: something it wants to send waits for a
                      yes. The last three are ended sessions.
                  control:
                    type: string
                    enum:
                      - person
                      - agent
                    description: Who may act on the page now.
                  drivers:
                    type: array
                    items:
                      type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - person
                            - agent
                        user_id:
                          type: string
                        agent_id:
                          type: string
                        name:
                          type: string
                    description: Who works in the session.
                  thread_id:
                    type: string
                    nullable: true
                    description: >-
                      The conversation the session works for; null for a session
                      a person opened with no agent.
                  run_id:
                    type: string
                    nullable: true
                    description: >-
                      The request of the agent turn using it (its id in the
                      requests list).
                  host:
                    type: string
                    nullable: true
                    description: The website of the active tab.
                  saved_login:
                    type: object
                    nullable: true
                    properties:
                      ref:
                        type: string
                      host:
                        type: string
                    description: The saved login the session is signed in with, if any.
                  tabs:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                        url:
                          type: string
                        title:
                          type: string
                        active:
                          type: boolean
                        agent:
                          type: boolean
                          description: The tab the agent works in.
                  steps:
                    type: array
                    items:
                      type: object
                      properties:
                        'n':
                          type: integer
                        of:
                          type: integer
                          nullable: true
                        sentence:
                          type: string
                          description: What the agent did, in plain words.
                        tab:
                          type: integer
                        at:
                          type: string
                          format: date-time
                    description: The agent's steps, oldest first (the last 200).
                  needs_person:
                    type: string
                    nullable: true
                    enum:
                      - code
                      - captcha
                      - sign_in
                      - null
                    description: What the agent asked a person for.
                  pending_submit:
                    type: object
                    nullable: true
                    properties:
                      description:
                        type: string
                      host:
                        type: string
                      asked_at:
                        type: string
                        format: date-time
                      decision_ref:
                        type: string
                        nullable: true
                    description: What waits for a yes before it is sent.
                  end:
                    type: object
                    nullable: true
                    properties:
                      outcome:
                        type: string
                        enum:
                          - done
                          - stopped
                          - failed
                      sentence:
                        type: string
                  metadata:
                    type: object
                    description: Kept and returned as given at creation.
                  started_at:
                    type: string
                    format: date-time
                  ended_at:
                    type: string
                    format: date-time
                    nullable: true
                  updated_at:
                    type: string
                    format: date-time
        '404':
          description: >-
            No browser session with that id (or it is not one this caller may
            see)
        '410':
          description: The session has ended
      security:
        - bearerAuth: []
        - sessionToken: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key, generated in studio.sidenet.ai. Backend only —
        never in a browser.
    sessionToken:
      type: http
      scheme: bearer
      description: >-
        Session token (`snat_…`) minted by POST /v1/token. Carries the
        organization and the end user; safe in a browser.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.