Sample - Slack Web API
POST/admin.conversations.setConversationPrefs

Set channel conversation preferences

Updates the posting permissions for a public or private channel. Supply channel_id and a stringified JSON prefs value describing the desired conversation preferences. The authenticated user must use a token with the administrative write scope.

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

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

Form-encoded channel conversation preference settings.

channel_idstringrequired
The channel to set the prefs for
prefsstringrequired
The prefs for this channel in a stringified JSON format.

2 status codes
200Returns a successful response containing the `ok` flag after applying the channel preferences.
okbooleanrequired
Allowed:true
defaultReturned when the channel preferences cannot be updated successfully; the response contains `ok: false` and an error value.
errorstringrequired
Allowed:feature_not_enablednot_an_adminchannel_not_foundchannel_type_not_supportedrestricted_actionmissing_scopecould_not_set_channel_prefdefault_org_wide_channel
okbooleanrequired
Allowed:false

Error handling

token must provide the admin.conversations:write scope. The request body must include channel_id and prefs, and prefs must contain stringified JSON representing the channel's posting preferences.