Messages

Edit a message

You can edit the text field and the custom data of any message that you know the message ID (id) of. To find the id of the message you want to edit, use the endpoint to list messages in a conversation, or get a list of messages via a Webhook.

To automatically add a timestamp to the message's editedAt field for when a message was last edited, pass the markEdited field and set it to true. Depending on your theme, an indicator that the user edited the message can now appear in the chat UI.

put/v1/{appId}/conversations/{conversationId}/messages/{messageId}

Request

Path parameters

appIdstring required
Example:abcd1234

A unique identifier of your TalkJS app. You can find your app ID on the Settings page of your dashboard.

conversationIdstring required
Example:0123456789abcdef

A unique identifier of a conversation.

messageIdstring required
Example:msg_123ABcdefghiJKlmNOpqRS

An automatically generated unique identifier of a message.

Request body

customobject

A custom object with key-value pairs that you want to associate with a message. Both keys and values must be strings. You can access a custom property in for example API responses, webhook events, and themes.

textstring

Text of a message body. text is only given if the message type is text.

markEditedboolean

Optional field to set the editedAt field of this message to a timestamp for when the message was edited.

Example request

{
  "custom": {
    "priority": "medium"
  },
  "text": "Hi, how are you?",
  "markEdited": true
}

Response

Empty response

object required

Empty response

Changes

No recorded changes to this operation across all 1 revision of this API.