---
title: "Send message to channel"
method: POST
path: "/api/messaging/channels/{channelId}/messages"
tags: ["messaging"]
---

# Send message to channel

`POST /api/messaging/channels/{channelId}/messages`

## Request

- Base URL: `http://localhost:3000`
- URL: `http://localhost:3000/api/messaging/channels/{channelId}/messages`
- Auth: none declared

Send a message to a channel. Supports sync, stream, and websocket response modes.

## Path parameters

- `channelId` string, uuid, required

## Request body

- object
  - `author_id` string, uuid, required
  - `content` string, required
  - `message_server_id` string, uuid, required
  - `in_reply_to_message_id` string, uuid
  - `raw_message` object
  - `metadata` object
  - `source_type` string
  - `mode` 'sync' | 'stream' | 'websocket'

## Response `200`

Message sent 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`: Missing required fields
- `403`: Server ID mismatch
- `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)
