Sample - Slack Web API
POST/pins.remove

Remove a pinned item from a channel

Removes a pinned item from a channel. Supply the target channel and, when removing a pinned message, provide its timestamp to identify the item. Use an authentication token with the pins:write scope to perform the operation.

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

1 parameter · 2 body fields
tokenstringrequired
Authentication token with the `pins:write` scope.

Form data identifying the channel and item to unpin.

channelstringrequired
Channel where the item is pinned to.
timestampstringoptional
Timestamp of the message to un-pin.

2 status codes
200Returns an object with `ok` set to true confirming that the item was unpinned.
okbooleanrequired
Allowed:true
defaultReturned when the channel or pinned item cannot be found, the item is not pinned, or authentication, permission, or request arguments are invalid; the response includes `ok` set to false and an `error` reason.
callstackstringoptional
Note: PHP callstack is only visible in dev/qa
errorstringrequired
Allowed:bad_timestampfile_not_foundfile_comment_not_foundmessage_not_foundno_item_specifiednot_pinnedpermission_deniednot_authedinvalid_authaccount_inactiveno_permissioninvalid_arg_name
okbooleanrequired
Allowed:false

Error handling

The token must include the pins:write scope, and channel must identify the channel containing the pinned item. Supply timestamp when removing a pinned message, using the message timestamp rather than a reply timestamp.