Sample - Slack Web API
POST/stars.add

Add a star to an item

Adds a star to a message, channel, file, or file comment. Supply an authentication token with the stars:write scope and identify the item using the applicable target fields. The request succeeds only when the item is not already starred.

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

1 parameter · 4 body fields
tokenstringrequired
Authentication token with the `stars:write` scope.

Form-encoded fields identifying the item to star.

channelstringoptional
Channel to add star to, or channel where the message to add star to was posted (used with `timestamp`).
filestringoptional
File to add star to.
file_commentstringoptional
File comment to add star to.
timestampstringoptional
Timestamp of the message to add star to.

2 status codes
200Returns an object with `ok` set to true when the item is starred.
okbooleanrequired
Allowed:true
defaultReturns an error object with `ok` set to false and an `error` value describing why the item could not be starred.
callstackstringoptional
Note: PHP callstack is only visible in dev/qa
errorstringrequired
Allowed:bad_timestampmessage_not_foundfile_not_foundfile_comment_not_foundchannel_not_foundno_item_specifiedalready_starrednot_authedinvalid_authaccount_inactivetoken_revokedno_permission
okbooleanrequired
Allowed:false

Error handling

Supply token with the stars:write scope and provide an item target through channel, timestamp, file, or file_comment. The target must identify an existing message, channel, file, or file comment that is not already starred.