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

# Submit a message to the central messaging system

> Submit a message to the central messaging bus for agent processing. This is the primary endpoint
for sending messages to agents, replacing the deprecated agent-specific message endpoints.

The message is submitted to a central channel and the appropriate agent(s) will process it
based on the channel and room configuration. This architecture allows for multi-agent
conversations and better message routing.

**Important**: Do not use `/api/agents/{agentId}/message` - that endpoint no longer exists.
All messages should go through this central messaging system.




## OpenAPI

````yaml post /api/messaging/submit
openapi: 3.1.0
info:
  title: Eliza OS API
  description: >-
    API documentation for Eliza OS v1.2.0 - A flexible and scalable AI agent
    framework.


    This API is designed to be used with a locally running Eliza instance.
    Endpoints allow for creating,

    managing, and interacting with AI agents through a REST interface.


    The API is organized into the following domains:

    - **System**: System-wide operations and environment management

    - **Agents**: Agent lifecycle and management operations

    - **Memory**: Agent memory and room management

    - **Messaging**: Message handling, channels, and servers

    - **Audio**: Audio processing and speech synthesis

    - **Media**: File upload and media management

    - **TEE**: Trusted Execution Environment operations

    - **WebSocket**: Real-time communication via Socket.IO
  version: 1.2.0
  contact:
    name: Eliza OS Community
    url: https://github.com/elizaos/eliza
servers:
  - url: http://localhost:3000
    description: Local development server
security: []
tags:
  - name: system
    description: System-wide operations and environment management
  - name: agents
    description: Operations for managing AI agents
  - name: memory
    description: Operations for managing agent memories
  - name: rooms
    description: Operations for managing rooms
  - name: messaging
    description: Operations for messages, channels, and servers
  - name: audio
    description: Operations for speech and audio processing
  - name: media
    description: Operations for file uploads and media management
  - name: logs
    description: Operations for accessing system and agent logs
  - name: tee
    description: Trusted Execution Environment operations
  - name: websocket
    description: Real-time WebSocket communication
paths:
  /api/messaging/submit:
    post:
      tags:
        - messaging
      summary: Submit a message to the central messaging system
      description: >
        Submit a message to the central messaging bus for agent processing. This
        is the primary endpoint

        for sending messages to agents, replacing the deprecated agent-specific
        message endpoints.


        The message is submitted to a central channel and the appropriate
        agent(s) will process it

        based on the channel and room configuration. This architecture allows
        for multi-agent

        conversations and better message routing.


        **Important**: Do not use `/api/agents/{agentId}/message` - that
        endpoint no longer exists.

        All messages should go through this central messaging system.
      operationId: submitMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - channel_id
                - server_id
                - author_id
                - content
                - source_type
                - raw_message
              properties:
                channel_id:
                  type: string
                  format: uuid
                  description: Central channel ID where the message is posted
                server_id:
                  type: string
                  format: uuid
                  description: >-
                    Server ID (use '00000000-0000-0000-0000-000000000000' for
                    default)
                author_id:
                  type: string
                  format: uuid
                  description: ID of the message author (user or agent)
                content:
                  type: string
                  description: The message content text
                in_reply_to_message_id:
                  type: string
                  format: uuid
                  description: Optional ID of the message being replied to
                source_type:
                  type: string
                  description: Source type (e.g., 'agent_response', 'user_message')
                raw_message:
                  type: object
                  description: Raw message object containing additional data
                metadata:
                  type: object
                  description: Additional metadata including agent_name if from agent
      responses:
        '201':
          description: Message submitted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/Message'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Error processing message
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Message:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the message
        text:
          type: string
          description: Message text content
        userId:
          type: string
          format: uuid
          description: ID of the user who sent the message
        agentId:
          type: string
          format: uuid
          description: ID of the agent (if sent by agent)
        roomId:
          type: string
          format: uuid
          description: ID of the room the message belongs to
        createdAt:
          type: integer
          format: int64
          description: Unix timestamp when the message was created
        metadata:
          type: object
          description: Additional message metadata
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code
            message:
              type: string
              description: Error message
            details:
              type: string
              description: Detailed error information

````