Skip to main content
Edit Message
Updates the content, GIF, mentions, or metadata of an existing message. Only the message author can edit their own messages. Deleted or moderator-removed messages cannot be edited. If no fields actually changed, the endpoint returns the current message without updating editedAt. 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. Editing 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, editing answers 403 chat/conversation-read-only. The conversation stays readable.

Path Parameters

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

Body Parameters

All fields are optional. Only provided fields are updated.
string
New text content. After editing, the message must still have at least one of: content, GIF, or an attached file.
object
Updated GIF attachment. See GifData for the expected shape. Set to null to remove the GIF.
array
Updated array of Mention objects.
object
Updated metadata.
string
Service key only, and required with one: the user this request acts as. Must be the message author. A user token always acts as its own user and must not send it (400 chat/acting-user-not-allowed).

Response

Returns the updated ChatMessage, with editedAt set to the current time.

Error Responses

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 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.
Also returned to someone who left, was removed or was banned: editing needs an active membership, like sending. In a space chat, also returned to anyone who isn’t an active member of its space or can’t see it.
A direct conversation between two users where one has blocked the other. It stays readable, but takes no edits. The response doesn’t say why.
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.
No message has this ID in the conversation, or the message was deleted or removed: it can’t be edited, and answers like a missing one. Checked before the author check.