---
title: "Submit a message to the central messaging system"
method: POST
path: "/api/messaging/submit"
tags: ["messaging"]
---

# Submit a message to the central messaging system

`POST /api/messaging/submit`

## Request

- Base URL: `http://localhost:3000`
- URL: `http://localhost:3000/api/messaging/submit`
- Auth: none declared

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.

## Request body

- object
  - `channel_id` string, uuid, required: Central channel ID where the message is posted
  - `server_id` string, uuid, required: Server ID (use '00000000-0000-0000-0000-000000000000' for default)
  - `author_id` string, uuid, required: ID of the message author (user or agent)
  - `content` string, required: The message content text
  - `in_reply_to_message_id` string, uuid: Optional ID of the message being replied to
  - `source_type` string, required: Source type (e.g., 'agent_response', 'user_message')
  - `raw_message` object, required: Raw message object containing additional data
  - `metadata` object: Additional metadata including agent_name if from agent

## Response `201`

Message submitted successfully

- object
  - `success` boolean
  - `data` Message
    - `id` string, uuid: Unique identifier for the message
    - `text` string: Message text content
    - `userId` string, uuid: ID of the user who sent the message
    - `agentId` string, uuid: ID of the agent (if sent by agent)
    - `roomId` string, uuid: ID of the room the message belongs to
    - `createdAt` integer: Unix timestamp when the message was created
    - `metadata` object: Additional message metadata

## Other responses

- `400`: Invalid request
- `500`: Error processing message

---

[API](https://skmtc.dev/elizaos/apis/eliza-os-api.md) - [All operations](https://skmtc.dev/elizaos/apis/eliza-os-api/llms.txt) - [OpenAPI document](https://skmtc.dev/elizaos/apis/eliza-os-api/revisions/d606a12682bb?raw)
