Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Modifying a Conversation, Message, or Participant


You can modify certain objects in the Conversations SDK (i.e. Conversation, Message, Participant) for connected Users with appropriate permissions.


Updating

updating page anchor

You can update a Conversation object by calling one of the appropriate methods for your chosen language.

For the Conversation, Message, or Participant data object, you could update some specific properties. Please refer to Update a Conversation, Message or Participant code sample.

Update a Conversation, Message or Participant

update-a-conversation-message-or-participant page anchor
Node.js
Typescript

_17
/* Updating Conversations/Messages/Participants */
_17
_17
/* Conversations */
_17
_17
await conversation.updateAttributes({});
_17
await conversation.updateFriendlyName("foo");
_17
await conversation.updateLastReadMessageIndex(0);
_17
await conversation.updateUniqueName("foo");
_17
_17
/* Messages */
_17
_17
await message.updateAttributes([1, {foo: "bar"}]);
_17
await message.updateBody("bar");
_17
_17
/* Participants */
_17
_17
await participant.updateAttributes({foo: 8});


You can delete a Conversation object by calling the appropriate method for your chosen language. When you remove a Conversation object, all its Messages, attached Media, and Participants will be deleted.

If you want to only delete a Message from a Conversation, call the specific method to remove it from the Conversation, and destroy any attached Media.

If you want to only delete a Participant from a Conversation, call the specific method to remove them from the Conversation.

Delete a Conversation, Message or Participant

delete-a-conversation-message-or-participant page anchor
Node.js
Typescript

_16
/* Deleting and updating Conversations/Messages/Participants */
_16
_16
/* Conversations */
_16
_16
// destroys the conversation, with all its messages and attached media and removes all participants
_16
await conversation.delete();
_16
_16
/* Messages */
_16
_16
// remove a message from the conversation, destroying any attached media
_16
await message.remove();
_16
_16
/* Participants */
_16
_16
// remove participant from the conversation
_16
await participant.remove();

Please note that when you delete a parent object, you will also delete its child object. For example, if you remove a Conversation, then all Messages and Participants will be automatically deleted. Once deleted, these resources are unrecoverable.

Check out our auto-generated documentation for more information about Conversations SDK methods and properties: JavaScript(link takes you to an external page), Android(link takes you to an external page) or iOS(link takes you to an external page).


Congratulations! 🎉 You've finished the getting started guides. Now, let's explore more Conversations SDK guides:


Rate this page: