Skip to main content
Send Message
Creates a new message in a conversation. The caller must be an active member. At least one of content, gif, or an uploaded image or file is required. For space conversations with postingPermission: "team", only users with admin or moderator role in the parent Space can send messages. In a space chat, the caller must also be an active member of the chat’s space and able to see it (visibility). Anyone else, including a pending, rejected or banned member and someone who left or was removed from the space, gets 403 chat/not-a-member, as a non-member does, even while they still hold a conversation membership. Deleting their own messages, leaving the conversation and muting it stay allowed: they need the conversation membership and sight of the space, not an active space membership. Sending is refused while the caller is banned. Banned in the space itself: 403 chat/not-a-member (a ban ends the space membership and the chat membership). An active member of the space who is banned in a space above it: 403 chat/banned. In a direct conversation where one of the two users has blocked the other, sending answers 403 chat/conversation-read-only. The conversation stays readable. This endpoint accepts multipart/form-data to upload images and files with the message. A message’s files are set when it is sent: editing a message changes its text only, and deleting it deletes its files.

Path Parameters

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

Body Parameters

string
Text content of the message. Optional if a GIF or file is provided.
object
GIF attachment. Optional. See GifData for the expected shape.
array
Array of Mention objects for @mentions in the message content. Optional.
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) that isn’t deleted or removed. Optional.
string
ID of a message to quote inline. The message stays in the main stream but renders the quoted content as a preview. Must be a message in this conversation that isn’t deleted or removed. Optional.
object
Custom key-value data. Limited to 10 KB. Optional.
string
Client-generated identifier for optimistic deduplication. The server echoes it back in the response but never stores it. Optional.
file[]
Images (multipart/form-data), up to 50 MB each, processed into sizes per images.options: each comes back with image and its variants. Requires images.options. A request takes at most 20 files over images and files together. Optional.
string
JSON-stringified image-processing options applied to every image (mode is required), the same options as Create Entity’s. A key the options don’t take, a key of another mode included (for example sizes with exact-dimensions), is refused with 400 chat/invalid-body, param naming it.
file[]
Files (multipart/form-data), up to 50 MB each, stored as uploaded. Each file’s type comes from its MIME type, and its image is null, an image sent here included. Optional.
string
Optional JSON-stringified file options: pathParts (string[]) customizes the storage path. A key other than pathParts is refused with 400 chat/invalid-body, param naming it.
The message’s files list the images first, then the files, each in upload order. An images.options or files.options sent without its files isn’t used, but is still validated: invalid options get a 400. Uploads require the files-images bundle.
string
Service key only, and required with one: the user this request acts as. The message author; must be an active member. On a multipart request, send it as a form field. A user token always acts as its own user and must not send it (400 chat/acting-user-not-allowed).

Space-scoped reputation

This endpoint has a space in context, so it accepts the opt-in reputation params, in the body with the other fields. They add a spaceReputation field to the message sender’s user, alongside the always-present reputation total. In JSON, spaceReputationDescendants is a boolean; on a multipart request both are form fields, with spaceReputationDescendants as "true" or "false". Only spaces the viewer can read count: a space they can’t read reads 0 (see Who sees space reputation). Requires the reputation bundle. See the Reputation data model for the full contract.
Every field goes in the body (or the multipart form). A body field sent in the query string returns 400 chat/wrong-location.

Response

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

Error Responses

Returned with no JSON body: 401 when no Authorization header is sent, 403 when the access token is invalid or expired. Checked before any uploaded file is read, so a request with no credentials gets 401 rather than a body or acting-user error.
A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
A body field — actingUserId, content, spaceReputationId, spaceReputationDescendants or any other — was sent in the query string.
Returned when a service key names an actingUserId that isn’t a user in this project.
The request sent userId. On this route the user a service key acts as is actingUserId.With a service key:
With a user token:
A service key sent no actingUserId.
Also returned in a space chat to anyone who isn’t an active member of its space or can’t see it, including someone banned in the space itself.
A direct conversation between two users where one has blocked the other. It stays readable, but takes no new messages. The response doesn’t say why.
The space chat’s postingPermission is "team" and the caller isn’t an active admin or moderator of the space.
The caller is an active member of the chat’s space but is banned in a space above it. Banned in the space itself answers 403 chat/not-a-member instead.
The parent isn’t a message in this conversation, was deleted or removed, or is itself a reply.
The quoted message is not in this conversation, or was deleted or removed.
On a multipart/form-data request, gif, mentions or metadata isn’t valid JSON. param names the field.
A file was refused as the body was read: 413 chat/file-too-large (a file over 50 MB), 413 chat/too-many-files (more than 20 files), chat/unsupported-file-type or chat/unexpected-file-field (a file in a field other than images and files), with param naming the field when there is one. A body over 250 MB gets 413 request/body-too-large; one that can’t be read at all gets request/invalid-multipart or request/field-too-large. See Upload errors.
Returned when images or files are uploaded on a project without the files-images bundle. missingTables lists the tables that aren’t installed and bundleId the bundle to install. While the bundle is still being installed, the response is 503 database/tables-provisioning instead. See Bundles.
A file in images can’t be read as an image. error names the file as it was uploaded. An image over 10000 px on a side gets the same code. error gives its size:
images was sent without images.options. Checked before the validation webhook and before anything is uploaded, so nothing is stored.
images.options without mode, or with a mode that isn’t one of the five (other options fields the same way, named in error and param):
In an aspect-ratio mode, a variant’s computed side would be outside 1–10000 px. Checked once the image is read, before anything is stored. param names the option:
In aspect-ratio-height-based it names a heights option and gives a width. In multi-aspect-ratio it names a sizes option, and the ratio is the one in aspectRatios closest to the image, so the text reads ”… at the 3:1 aspect ratio, the one in aspectRatios closest to this image. Each side of a variant must be 1–10000 px.” More than 30 entries in dimensions, widths, heights or sizes (one variant each). param names the option:
A variant name that uses a character other than letters, digits, _, - and ., that is longer than 64 characters, that contains .., or that is original. param names the option:
A key the options don’t take (also a key of another mode). error names the object holding it, param the key itself:
files.options takes only pathParts; any other key gets the same code:
The uploaded files would take the project past its plan’s file-storage limit. Nothing is sent or stored.