Skip to main content
Update Conversation
Updates one or more fields on a conversation. Only group and space conversations can be updated — direct conversations return a 400. Send a JSON body, or multipart/form-data when uploading a new avatar. removeFileIds removes the current avatar. Authorization:
  • group conversations: caller must be an active admin member.
  • space conversations: caller must be an active admin or moderator of the parent Space (a banned admin or moderator can’t).

Path Parameters

string
required
The ID of the conversation to update.

Body Parameters

All fields are optional. Only provided fields are updated.
string
New display name for the conversation. Maximum 200 characters.
string
New description. Maximum 1000 characters.
file
New avatar image: JPEG, PNG or WebP, maximum 50 MB. Requires avatarFile.options. The image is processed into the variants the options ask for, and the previous avatar, if any, is deleted.
object
JSON-encoded image-processing options for avatarFile: a mode and the fields it needs, for example { "mode": "original-aspect", "sizes": { "small": 64, "large": 256 } }. See Image Processing Modes. 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.
string[]
Files to remove from the conversation: its avatarFileId, nothing else. Removing it clears the avatar (avatarFileId becomes null and the file is deleted). Works alone or with a new avatarFile in the same request; uploading a new avatar while listing the old one is a plain replace. On a multipart request, send it as a JSON string ('["<fileId>"]'). Any other id refuses the whole request with 400 chat/invalid-remove-file-ids.
string
Who can post messages. Only valid for space conversations. Accepted values: "members" (any active member), "team" (only the space’s active admins and moderators). Any other value, "admins" included, is refused with 400 chat/invalid-body.
string
Service key only, and required with one: the user this request acts as. Must be allowed to update the conversation (see Authorization above). A user token always acts as its own user and must not send it (400 chat/acting-user-not-allowed).

Response

Returns the updated Conversation object, with avatarFile populated if set.

Real-time event

When the request sets at least one field, every active member of the conversation connected to chat receives a conversation:updated socket event naming the conversation and carrying each field the request set, as stored:
avatarFileId and avatarFile are there only when the avatar changed: avatarFile is the new avatar’s File, the same as this response’s, or null when the avatar was removed. Its links are signed and expire like any File’s (File links). The SDK’s ChatProvider applies the event for you (Real-time Features).

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.
Returned when a service key names an actingUserId that isn’t a user in this project.
The request sent avatarFileId. The avatar is the image itself, uploaded as avatarFile; this endpoint never takes the id of a file uploaded elsewhere.
The request sent userId. On this route the user a service key acts as is actingUserId.With a service key:
With a user token, or with no credentials:
A service key sent no actingUserId.
The acting user isn’t an active member of the conversation. In a space conversation: anyone who isn’t an active member of its space or can’t see it, including a pending or banned member.
The acting user is a member of the group without the admin role.
The acting user is an active member of the space without the admin or moderator role in the space.
removeFileIds names a file that isn’t this conversation’s current avatar. invalidIds lists those ids. Checked before anything is uploaded, so nothing is stored or removed.
A removeFileIds that isn’t an array of file ids gets 400 chat/invalid-body instead.
Returned when an avatar is 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.
The file can’t be read as an image.
An image over 10000 px on a side gets the same code. error gives its size:
avatarFile was uploaded without avatarFile.options.
avatarFile.options isn’t valid JSON, or isn’t valid image options.
avatarFile.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:
A file was refused as the body was read: chat/unsupported-file-type or chat/unexpected-file-field, 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.