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

# Add a single message

> Adds a message to a conversation. Supports lazy conversation creation if workspace_id, title, and source are provided alongside conversation_id.




## OpenAPI

````yaml /openapi/ai-brain.yaml post /ai-chat/messages
openapi: 3.1.0
info:
  title: Connie AI & Brain API
  version: 1.0.0
  description: >
    API for the AI & Brain module â€” the orchestration layer powering all AI
    features: the main conversational AI (Brain), AI chat conversations, browser
    automation tasks, agent identity management, and AI usage tracking.

    The Brain is the core AI engine. It accepts messages, orchestrates tool
    calls via Temporal workflows, and streams responses back. It powers the AI
    copilot across the entire product.
servers:
  - url: https://connie.ai/api
    description: Production
security:
  - cookieAuth: []
tags:
  - name: Brain
    description: Core AI engine â€” conversation, streaming, and workflow orchestration
  - name: Brain Plans
    description: Agent planning context (goal, steps, status)
  - name: AI Chat
    description: Persistent conversation and message management
  - name: AI Chat Attachments
    description: File uploads for AI context
  - name: Browser Tasks
    description: AI-driven browser automation tasks
  - name: Artifacts
    description: KB, table, and workflow artifacts attached to conversations
  - name: Agent Identities
    description: Named AI agent configuration and tool assignments
  - name: AI Cache
    description: FAQ response caching
  - name: AI Usage
    description: Token usage statistics
paths:
  /ai-chat/messages:
    post:
      tags:
        - AI Chat
      summary: Add a single message
      description: >
        Adds a message to a conversation. Supports lazy conversation creation if
        workspace_id, title, and source are provided alongside conversation_id.
      operationId: createAiChatMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - conversation_id
              properties:
                conversation_id:
                  type: string
                role:
                  type: string
                  enum:
                    - user
                    - assistant
                    - tool
                  default: user
                content:
                  type: string
                model:
                  type: string
                tool_calls:
                  type: array
                tool_results:
                  type: array
                metadata:
                  type: object
                tokens_used:
                  type: integer
                workspace_id:
                  type: string
                  description: For lazy conversation creation
                title:
                  type: string
                  description: For lazy conversation creation
                source:
                  type: string
                  description: For lazy conversation creation
      responses:
        '201':
          description: Message created
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    $ref: '#/components/schemas/AiMessage'
components:
  schemas:
    AiMessage:
      type: object
      properties:
        id:
          type: string
        conversation_id:
          type: string
        role:
          type: string
          enum:
            - user
            - assistant
            - tool
        content:
          type: string
          nullable: true
        model:
          type: string
          nullable: true
        tool_calls:
          type: array
          nullable: true
        tool_results:
          type: array
          nullable: true
        tokens_used:
          type: integer
          nullable: true
        metadata:
          type: object
          nullable: true
        created_at:
          type: string
          format: date-time
  securitySchemes:
    cookieAuth:
      type: apiKey
      in: cookie
      name: session

````

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