Sample - Slack Web API
POST/conversations.leave

Leave a conversation

Leaves an existing conversation for the authenticated user. Supply the conversation identifier in channel to specify which conversation to leave, using an authentication token with the conversations:write scope when authorization is required.

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

1 parameter · 1 body field
tokenstringoptional
Authentication token for the request; it must provide the `conversations:write` scope.

Optional form-encoded conversation details.

channelstringoptional
Conversation to leave

2 status codes
200Returns a success object with `ok` set to true and may include `not_in_channel` set to true when the authenticated user was not a member.
not_in_channelbooleanoptional
Allowed:true
okbooleanrequired
Allowed:true
defaultTypical error response when attempting to leave a workspace's "general" channel
callstackstringoptional
Note: PHP callstack is only visible in dev/qa
errorstringrequired
Allowed:method_not_supported_for_channel_typelast_membermissing_scopechannel_not_foundis_archivedcant_leave_generalnot_authedinvalid_authaccount_inactiveuser_is_botuser_is_restricteduser_is_ultra_restricted
neededstringoptional
okbooleanrequired
Allowed:false
providedstringoptional

Error handling

channel must identify a conversation that the authenticated user can leave and must not be the workspace's general channel. The token must provide the conversations:write scope when supplied for authentication.