Skip to main content
The Channels API provides comprehensive endpoints for creating, reading, updating, and deleting messages within channels.

Message Endpoints

List Messages

Retrieves messages from a channel with pagination. Query Parameters:
  • skip (integer): Number of messages to skip (default: 0)
  • limit (integer): Maximum number of messages to return (default: 50)
Response: Array of message objects with user information and reactions

Get Pinned Messages

Retrieves pinned messages from a channel. Query Parameters:
  • page (integer): Page number for pagination (default: 1, 20 items per page)
Response: Array of pinned message objects

Post Message

Request Body:
  • content (string, required): Message text content
  • reply_to_id (string, optional): ID of message being replied to
  • parent_id (string, optional): ID of thread parent message
  • data (object, optional): Additional message data (files, etc.)
  • meta (object, optional): Message metadata
  • temp_id (string, optional): Temporary client-side ID for optimistic updates
Response: Created message object

Get Single Message

Retrieves a specific message by ID. Response: Message object with user information

Get Message Data

Retrieves only the data field of a message (files, attachments, etc.). Response: Message data object

Get Thread Replies

Retrieves all replies in a message thread. Query Parameters:
  • skip (integer): Number of replies to skip (default: 0)
  • limit (integer): Maximum number of replies to return (default: 50)
Response: Array of reply message objects

Update Message

Request Body:
  • content (string, required): Updated message text
  • data (object, optional): Updated message data
  • meta (object, optional): Updated metadata
Response: Updated message object Notes:
  • Users can update their own messages
  • Admins and users with write access can update any message in the channel
  • Updates trigger real-time socket events to all channel members

Pin/Unpin Message

Request Body:
  • is_pinned (boolean, required): true to pin, false to unpin
Response: Updated message object with pin information

Add Reaction

Request Body:
  • name (string, required): Emoji or reaction name
Response: Boolean indicating success

Remove Reaction

Request Body:
  • name (string, required): Emoji or reaction name to remove
Response: Boolean indicating success

Delete Message

Deletes a message and all its reactions. Response: Boolean indicating success Notes:
  • Users can delete their own messages
  • Admins and users with write access can delete any message
  • Deleting a message with replies will keep the replies but remove the parent content
  • Emits real-time socket events to notify all channel members

Message Object Schema

Real-time Updates

All message operations emit real-time events via WebSocket to channel members:
  • message - New message posted
  • message:update - Message edited
  • message:delete - Message deleted
  • message:reply - New reply in thread
  • message:reaction:add - Reaction added
  • message:reaction:remove - Reaction removed

Model Mentions

Messages can mention AI models using the @model_id syntax. When a model is mentioned:
  1. The model automatically responds to the message
  2. Thread history is included in the model’s context
  3. Images from thread messages are processed
  4. Response is posted as a new message with model metadata

Webhooks

Messages can be posted via webhooks without authentication. See the Webhooks section for details.