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

# Send Chat Message

> Send a message to a chatbot agent and receive a response (for chatbot agents only)



## OpenAPI

````yaml POST /agent/chat/{agent_id}
openapi: 3.1.0
info:
  title: Outbox AI API
  description: API for managing AI agents (chatbots and voicebots) on the Outbox platform
  version: 1.0.0
servers:
  - url: https://api.getoutbox.ai
security: []
paths:
  /agent/chat/{agent_id}:
    post:
      summary: Send Chat Message
      description: >-
        Send a message to a chatbot agent and receive a response (for chatbot
        agents only)
      parameters:
        - name: agent_id
          in: path
          description: The ID of the chatbot agent
          required: true
          schema:
            type: string
      requestBody:
        description: Chat message details
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatMessage'
      responses:
        '200':
          description: Message sent successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatResponse'
        '400':
          description: Bad Request - Missing required fields or invalid agent type
        '401':
          description: Unauthorized - Invalid or missing API key
        '404':
          description: Agent not found
      security:
        - CompanyApiKey: []
components:
  schemas:
    ChatMessage:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: The message to send to the chatbot
        thread_id:
          type: string
          description: Thread ID for continuing an existing conversation
        contact_id:
          type: string
          description: Contact ID
        phone_number:
          type: string
          description: Phone number of the user
        full_name:
          type: string
          description: Full name of the user
        platform:
          type: string
          description: >-
            Platform where the message originated (e.g., sms, email, instagram,
            facebook)
        external_customer_id:
          type: string
          description: External customer ID
        stream:
          type: boolean
          default: false
          description: When true, returns an SSE stream of the assistant response.
        testing:
          type: boolean
          default: false
          description: >-
            Testing mode: skips contact persistence for unauthenticated
            requests. Aliases: `test`, `is_test`, `test_mode`.
        visitor_session_id:
          type: string
          description: >-
            Stable per-browser session ID used to reuse the same guest contact
            across turns when no `thread_id` is supplied. Alias: `session_id`.
    ChatResponse:
      type: object
      properties:
        response:
          type: string
          description: The agent's reply message
        thread_id:
          type: string
          description: Conversation thread ID
        thread_message_id:
          type: string
          nullable: true
          description: ID of the message, null if no message created
  securitySchemes:
    CompanyApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: Company API Key

````