Skip to main content
POST
/
:projectId
/
api
/
v7
/
conversations
/
:conversationId
/
messages
Send Message
curl --request POST \
  --url https://api.sublay.io/api/v6/:projectId/api/v7/conversations/:conversationId/messages \
  --header 'Content-Type: application/json' \
  --data '
{
  "content": "<string>",
  "gif": {},
  "mentions": [
    {}
  ],
  "parentMessageId": "<string>",
  "quotedMessageId": "<string>",
  "metadata": {},
  "localId": "<string>",
  "files": [
    null
  ]
}
'
Creates a new message in a conversation. The caller must be an active member. At least one of content, gif, or a file attachment is required. For space conversations with postingPermission: "admins", only users with admin or moderator role in the parent Space can send messages. This endpoint accepts multipart/form-data to support file attachments alongside message content.

Path Parameters

conversationId
string
required
The ID of the conversation to send the message to.

Body Parameters

content
string
Text content of the message. Optional if a GIF or file is provided.
gif
object
GIF attachment. Optional. See GifData for the expected shape.
mentions
array
Array of Mention objects for @mentions in the message content. Optional.
parentMessageId
string
ID of a message in this conversation to reply to in a thread. The referenced message must be a main-stream message (threads are one level deep only). Optional.
quotedMessageId
string
ID of a message to quote inline. The message stays in the main stream but renders the quoted content as a preview. Optional.
metadata
object
Custom key-value data. Limited to 10 KB. Optional.
localId
string
Client-generated identifier for optimistic deduplication. The server echoes it back in the response but never stores it. Optional.
files
file[]
File attachments (multipart/form-data). Up to 10 files per message. Optional.

Query Parameters

Space-scoped reputation

This endpoint has a space in context, so it accepts the opt-in reputation params. They add a spaceReputation field to the message sender’s user, alongside the always-present reputation total. Requires the reputation bundle. See the Reputation data model for the full contract.
spaceReputationId
string
Adds spaceReputation to each returned user. One of: a space <uuid> (that space’s bucket), none (the project-general bucket), or context (the space derived from this request’s context — per-row on lists). The empty string and the legacy general / null aliases are rejected (400). Missing buckets read as 0.
spaceReputationDescendants
boolean
Only honored with an explicit space <uuid>. When true, spaceReputation is the subtree sum — the space plus all of its descendants (the root space’s own bucket included). Ignored for none; not allowed with context.

Response

Returns the created ChatMessage object, fully populated with user, quotedMessage, files, reactionCounts (empty on creation), and userReactions (empty on creation). If localId was provided, it is echoed in the response.

Error Responses

{ "error": "Message must have content, a GIF, or at least one file.", "code": "chat/empty-message" }
{ "error": "You are not a member of this conversation.", "code": "chat/not-a-member" }
{ "error": "Parent message not found, not in this conversation, already removed, or is itself a reply.", "code": "chat/invalid-parent" }