Updating messages

Since PubNub stores all messages in a time-series database, it doesn’t expose an API to directly update a message. However, clients can update messages by passing another version of the message using the Message Actions feature.

Update a message

Use the addMessageAction method to update a published message after it has been published by adding an action to it.

channel: 'main'
messageTimetoken: '15610547826970040',
action: {
type: 'updated',
value: 'Hello World! (fixed typo)',
function(status, response) {

Message update event

PubNub triggers events when messages are updated using message actions. Clients subscribed to the channel will receive these events.

"value":"Hello World! (fixed typo)",
show all 17 lines