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

# Send a message

> Sends a message to the AI agent and returns a streaming SSE response. The request body must not exceed 1 MB.



## OpenAPI

````yaml /openapi.json post /chat/messages
openapi: 3.0.3
info:
  title: Agentic Trust API
  description: >-
    Runtime API for the Agentic Trust AI customer support platform. Use these
    endpoints to manage conversations, send messages, verify user identity, and
    collect feedback.
  version: 1.0.0
  contact:
    name: Agentic Trust Support
    email: security@agentictrust.com
servers:
  - url: https://platform.agentictrust.com/api/v1
    description: Production
security:
  - ApiKeyHeader: []
tags:
  - name: Widget
    description: Widget configuration endpoints.
  - name: Chat
    description: Conversation and message endpoints.
  - name: Identity
    description: User identity verification endpoints.
  - name: Feedback
    description: Conversation feedback endpoints.
paths:
  /chat/messages:
    post:
      tags:
        - Chat
      summary: Send a message
      description: >-
        Sends a message to the AI agent and returns a streaming SSE response.
        The request body must not exceed 1 MB.
      operationId: sendMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                conversationId:
                  type: string
                projectId:
                  type: string
                messages:
                  type: array
                  items:
                    $ref: '#/components/schemas/ChatMessage'
                  minItems: 1
                pageContext:
                  $ref: '#/components/schemas/PageContext'
                userTokens:
                  type: object
                  additionalProperties:
                    type: string
                    maxLength: 4096
                  description: Custom headers forwarded to action endpoints. Max 10 keys.
              required:
                - conversationId
                - projectId
                - messages
      responses:
        '200':
          description: SSE stream of AI responses.
          content:
            text/event-stream:
              schema:
                type: string
          headers:
            x-vercel-ai-ui-message-stream:
              schema:
                type: string
                example: v1
        '400':
          description: Invalid or expired conversation, or validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Project does not match API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Project not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Request body exceeds 1 MB.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ChatMessage:
      type: object
      properties:
        role:
          type: string
        content:
          type: string
        id:
          type: string
        parts:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              text:
                type: string
      required:
        - role
        - content
    PageContext:
      type: object
      description: DOM context from the page where the widget is embedded.
      properties:
        url:
          type: string
        title:
          type: string
        description:
          type: string
        referrer:
          type: string
        textContent:
          type: string
          maxLength: 10000
        headings:
          type: array
          items:
            type: string
          maxItems: 30
        buttons:
          type: array
          items:
            type: string
          maxItems: 30
        links:
          type: array
          maxItems: 80
          items:
            type: object
            properties:
              href:
                type: string
                maxLength: 2048
              text:
                type: string
        formFields:
          type: array
          maxItems: 20
          items:
            type: object
            properties:
              name:
                type: string
              type:
                type: string
              label:
                type: string
              placeholder:
                type: string
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  headers:
    RateLimitLimit:
      schema:
        type: integer
      description: Maximum requests allowed in the current window.
    RateLimitRemaining:
      schema:
        type: integer
      description: Remaining requests in the current window.
    RateLimitReset:
      schema:
        type: integer
      description: Unix timestamp when the rate limit window resets.
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key in `lum_pk_*` format. Pass via `x-api-key` header or
        `Authorization: Bearer <key>`.

````