Use the ably channels update command to update a message on an Ably Pub/Sub channel.
Synopsis
ably channels update <channel-name> <message-serial> <message> [options]Arguments
channel-name Required
The name of the channel containing the message.
message-serial Required
The serial of the message to update.
message Required
The new message content. This can be plain text or JSON.
Options
--description
A description for the update.
--encoding | -e
The encoding of the message, such as json/utf-8.
--name | -n
The event name for the updated message.
--client-id
A client ID to use when updating the message.
--json
Output results as compact JSON. Mutually exclusive with --pretty-json.
--pretty-json
Output results in formatted JSON. Mutually exclusive with --json.
--verbose | -v
Enable verbose logging. Can be combined with --json or --pretty-json.
Examples
Update a message:
ably channels update my-channel "msg-serial" "Updated message content"Update a message with a description:
ably channels update my-channel "msg-serial" '{"key": "new-value"}' --description "Fixed typo"Update a message with plain text content:
ably channels update my-channel "msg-serial" "Updated plain text"Update a message and set an event name:
ably channels update my-channel "msg-serial" '{"data":"updated"}' --name event-nameUpdate a message and output the result in JSON format:
ably channels update my-channel "msg-serial" '{"data":"updated"}' --jsonUpdate a message and output the result in formatted JSON:
ably channels update my-channel "msg-serial" '{"data":"updated"}' --pretty-jsonSee also
- Channels — Explore all
ably channelscommands. - CLI reference — Full list of available commands.