Sample - Slack Web API
POST/chat.update

Update a message

Updates an existing message in a channel. Supply channel and ts, then change the message text or provide new blocks or attachments; omitted content fields retain their existing values unless the request explicitly replaces them. Use parse and link_names to control message formatting and linking.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 8 body fields
tokenstringrequired
Authentication token with the `chat:write` scope.

Optional message update fields; provide the target channel and timestamp, plus the content or formatting fields to change.

as_userstringoptional
Pass true to update the message as the authed user. [Bot users](/bot-users) in this context are considered authed users.
attachmentsstringoptional
A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting `text`. If you don't include this field, the message's previous `attachments` will be retained. To remove previous `attachments`, include an empty array for this field.
blocksstringoptional
A JSON-based array of [structured blocks](/block-kit/building), presented as a URL-encoded string. If you don't include this field, the message's previous `blocks` will be retained. To remove previous `blocks`, include an empty array for this field.
channelstringrequired
Channel containing the message to be updated.
link_namesstringoptional
Find and link channel names and usernames. Defaults to `none`. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, `none`.
parsestringoptional
Change how messages are treated. Defaults to `client`, unlike `chat.postMessage`. Accepts either `none` or `full`. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, `client`.
textstringoptional
New text for the message, using the [default formatting rules](/reference/surfaces/formatting). It's not required when presenting `blocks` or `attachments`.
tsstringrequired
Timestamp of the message to be updated.

2 status codes
200Returns the updated channel, message timestamp, text, and message object.
channelstringrequired
messageobjectrequired
okbooleanrequired
Allowed:true
textstringrequired
tsstringrequired
defaultReturned when the message cannot be found or updated, the edit window has closed, the content is too long, or authentication is invalid.
callstackstringoptional
Note: PHP callstack is only visible in dev/qa
errorstringrequired
Allowed:message_not_foundcant_update_messagechannel_not_foundedit_window_closedmsg_too_longtoo_many_attachmentsrate_limitedno_textnot_authedinvalid_authaccount_inactivetoken_revoked
okbooleanrequired
Allowed:false

Error handling

channel and ts are required and must identify the message to update. Provide text unless the request includes blocks or attachments; parse accepts none or full and defaults to client when omitted.