POST
/chat.deleteDelete a message
Deletes a message from a channel. Supply ts and channel to identify the message, and use as_user to control whether deletion occurs as the authenticated user or with bot scope. Use this method only when the authenticated user or bot has permission to delete the specified message.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
tokenstringoptional
Authentication token with the `chat:write` scope.
The message identification and deletion-identity options.
tsnumberoptional
Timestamp of the message to be deleted.
channelstringoptional
Channel containing the message to be deleted.
as_userbooleanoptional
Pass true to delete the message as the authed user with `chat:write:user` scope. [Bot users](/bot-users) in this context are considered authed users. If unused or false, the message will be deleted with `chat:write:bot` scope.
200Returns the deleted message's channel identifier and timestamp with `ok: true`.
channelstringrequired
okbooleanrequired
tsstringrequired
defaultReturns `ok: false` with an error when the message or channel cannot be found, deletion is not permitted, authentication fails, or an argument is invalid.
callstackstringoptional
Note: PHP callstack is only visible in dev/qa
errorstringrequired
okbooleanrequired
Error handling
Provide ts as the message timestamp and channel as the containing channel. If you set as_user to true, the token must have the chat:write:user scope; otherwise deletion uses the chat:write:bot scope.