> ## 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 Chat Message

> **Legacy — will be deprecated soon. Use the [Chat v1](/api-reference/endpoint/chat/send_message) endpoint (`POST /v1/chat/inbound`) for new integrations.**

Sends a user message to an active chat session and returns the agent's response synchronously.



## OpenAPI

````yaml POST /chat_messages/send_message
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:
  /chat_messages/send_message:
    post:
      summary: Send a chat message
      description: >-
        **Legacy — will be deprecated soon. Use the [Chat
        v1](/api-reference/endpoint/chat/send_message) endpoint (`POST
        /v1/chat/inbound`) for new integrations.**


        Sends a user message to an active chat session and returns the agent's
        response synchronously.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agent_uuid
                - chat_session_id
                - message
              properties:
                agent_uuid:
                  type: string
                  description: Unique identifier of the agent handling the session.
                  example: agent_IsZ3Q6Sf_60Eh26XQMGbz-R_og
                chat_session_id:
                  type: string
                  description: Session ID returned by the Start Chat Session endpoint.
                  example: 4718a326-417b-4dda-90d0-21fd65a11cb8
                message:
                  type: string
                  description: The user's message.
                  example: What are your business hours?
      responses:
        '200':
          description: Message sent and agent response returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      session_id:
                        type: string
                        example: 4718a326-417b-4dda-90d0-21fd65a11cb8
                      response:
                        type: string
                        description: The agent's reply.
                        example: We're open Monday to Friday, 9 AM to 6 PM IST.
                      tool_calls:
                        type: array
                        description: Any tool calls made by the agent during this turn.
                        items: {}
                      tool_results:
                        type: array
                        description: Results from tool calls, if any.
                        items: {}
                      current_state:
                        type: string
                        nullable: true
                        description: >-
                          Current state name for multi-prompt agents. `null` for
                          single-prompt agents.
                        example: null
        '401':
          description: Invalid or missing API token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatErrorUnauthorized'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorUnprocessable'
      deprecated: true
components:
  schemas:
    ChatErrorUnauthorized:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Invalid API token
    ErrorUnprocessable:
      type: object
      properties:
        success:
          type: boolean
          example: false
        errors:
          type: array
          items:
            type: string
          example:
            - agent_uuid is required
            - phone_number is invalid
  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.

````