> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sublay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit Message

> Edit the content of a 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`.

## Path Parameters

**conversationId** `string` *required*

The ID of the conversation.

**messageId** `string` *required*

The ID of the message to edit.

## Body Parameters

All fields are optional. Only provided fields are updated.

**content** `string`

New text content. After editing, the message must still have at least one of: content, GIF, or an attached file.

**gif** `object`

Updated GIF attachment. See [GifData](https://docs.sublay.io/v7/data-models/chat-message.md#gifdata) for the expected shape. Set to `null` to remove the GIF.

**mentions** `array`

Updated array of [Mention](https://docs.sublay.io/v7/data-models/chat-message.md#mention) objects.

**metadata** `object`

Updated metadata.

## Response

Returns the updated [ChatMessage](https://docs.sublay.io/v7/data-models/chat-message.md), with `editedAt` set to the current time.

## Error Responses

> [accordion] Forbidden — 403 (not a member)
>
> Also returned to someone who left, was removed or was banned: editing needs an active membership, like sending.
>
> ```json theme={null}
> { "error": "You are not a member of this conversation.", "code": "chat/not-a-member" }
> ```

> [accordion] Not Found — 404
>
> ```json theme={null}
> { "error": "Message not found.", "code": "chat/message-not-found" }
> ```

> [accordion] Forbidden — 403 (not the author)
>
> ```json theme={null}
> { "error": "Only the message author can edit this message.", "code": "chat/forbidden" }
> ```

> [accordion] Message Deleted — 400 Bad Request
>
> ```json theme={null}
> { "error": "Deleted messages cannot be edited.", "code": "chat/message-deleted" }
> ```

> [accordion] Message Removed — 400 Bad Request
>
> ```json theme={null}
> { "error": "Removed messages cannot be edited.", "code": "chat/message-removed" }
> ```

> [accordion] Empty Result — 400 Bad Request
>
> ```json theme={null}
> { "error": "Edited message must have at least content, a GIF, or a file.", "code": "chat/empty-message" }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.