Sample - Slack Web API
POST/pins.add

Pin an item to a channel

Pins an item to a channel. Supply the target channel and, when pinning a 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 pin.

channelstringrequired
Channel to pin the item in.
timestampstringoptional
Timestamp of the message to pin.

2 status codes
200Returns an object with `ok` set to true confirming that the item was pinned.
okbooleanrequired
Allowed:true
defaultReturned when the channel or item cannot be found, the item is already pinned or cannot be 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_timestampmessage_not_foundchannel_not_foundno_item_specifiedalready_pinnedpermission_deniedfile_not_sharednot_pinnablenot_authedinvalid_authaccount_inactiveno_permission
okbooleanrequired
Allowed:false

Error handling

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