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

# Send Support / Control Command

> The operator control rail for a session. Send a plain `message` (delivered to the customer while a human has taken over), a control `command`, or both.

Recognized commands:
- `takeover` — a human operator takes over the session; the agent stops auto-replying and `mode` becomes `support`.
- `tell` — inject operator guidance **and** fire an agent turn; the agent's `reply` is returned. Provide the text in `message`.
- `whisper` — append private operator guidance for the next agent turn; the customer never sees it.
- `end` — hand the session back to the agent (`mode` returns to `ai`).
- `close` — close the session permanently.

A request with only `message` and no `command` is a plain operator message, valid while the session is in `support` mode (after `takeover`).



## OpenAPI

````yaml POST /v1/chat/session/{id}/support
openapi: 3.1.0
info:
  title: OSVI AI API
  description: REST API for the OSVI AI voice and chat platform
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.osvi.ai
security:
  - ApiToken: []
paths:
  /v1/chat/session/{id}/support:
    post:
      summary: Send support / control command
      description: >-
        The operator control rail for a session. Send a plain `message`
        (delivered to the customer while a human has taken over), a control
        `command`, or both.


        Recognized commands:

        - `takeover` — a human operator takes over the session; the agent stops
        auto-replying and `mode` becomes `support`.

        - `tell` — inject operator guidance **and** fire an agent turn; the
        agent's `reply` is returned. Provide the text in `message`.

        - `whisper` — append private operator guidance for the next agent turn;
        the customer never sees it.

        - `end` — hand the session back to the agent (`mode` returns to `ai`).

        - `close` — close the session permanently.


        A request with only `message` and no `command` is a plain operator
        message, valid while the session is in `support` mode (after
        `takeover`).
      parameters:
        - name: id
          in: path
          required: true
          description: The session UUID (from Create Session or Get Active Session).
          schema:
            type: string
            example: 4718a326-417b-4dda-90d0-21fd65a11cb8
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                command:
                  type: string
                  enum:
                    - takeover
                    - tell
                    - whisper
                    - end
                    - close
                  description: >-
                    Control command to apply. Omit to send a plain operator
                    message (requires the session to be in `support` mode).
                  example: close
                message:
                  type: string
                  description: >-
                    Message text. Required for a plain operator message and for
                    the `tell` command; optional context for `takeover`.
                  example: A human agent is joining the conversation.
            examples:
              plain_message:
                summary: Plain operator message
                value:
                  message: A human agent is joining the conversation.
              close:
                summary: Close the session
                value:
                  command: close
              takeover:
                summary: Human takeover
                value:
                  command: takeover
              tell:
                summary: Tell (guide the agent and reply)
                value:
                  command: tell
                  message: Thanks, I can help with that.
      responses:
        '200':
          description: >-
            Command accepted. The response `data` always includes `state`,
            `session_id`, and `command`; additional fields depend on the command
            (e.g. `reply` for `tell`, `active_human` for `takeover`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      state:
                        type: string
                        description: >-
                          Outcome of the command — `ok` on success, or a status
                          such as `no_change`, `busy`, `dormant`, `rejected`,
                          `disabled`, `invalid`, or `timeout`.
                        example: ok
                      session_id:
                        type: string
                        example: 4718a326-417b-4dda-90d0-21fd65a11cb8
                      command:
                        type: string
                        nullable: true
                        description: >-
                          Echo of the command issued. `null` for a plain
                          operator message.
                        example: close
                      reply:
                        type: string
                        nullable: true
                        description: Agent reply — present for the `tell` command.
                        example: Of course, let me pull that up for you.
                      active_human:
                        type: string
                        nullable: true
                        description: >-
                          Email of the operator now holding the session —
                          present for `takeover`.
                        example: agent@yourco.com
        '401':
          description: Invalid or missing API token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatV1Error'
        '403':
          description: >-
            The requested command is disabled for this agent
            (`command_disabled`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatV1Error'
        '404':
          description: No session matches the given `id` (`session_not_found`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatV1Error'
        '422':
          description: >-
            The chat engine rejected the command (e.g. wrong mode for a plain
            message, or empty `tell` text).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatV1EngineError'
        '502':
          description: The chat engine could not be reached or returned an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatV1EngineError'
components:
  schemas:
    ChatV1Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: Machine-readable error code or message.
          example: agent_not_found
    ChatV1EngineError:
      type: object
      description: >-
        Returned when the upstream chat engine rejects or fails a proxied
        request.
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Python engine returned 422 for POST /v1/chat/session/{id}/support
        upstream_body:
          type: object
          nullable: true
          description: Parsed error body returned by the chat engine, when available.
          example:
            state: rejected
            reason: tell_not_allowed_during_takeover
  securitySchemes:
    ApiToken:
      type: apiKey
      in: header
      name: API-Token
      description: >-
        16-character API token associated with your OSVI account. Find it in
        your dashboard under Settings → API.

````