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

Set channel workspace connections

Sets the workspaces connected to a public or private channel in an Enterprise Grid organization. Supply channel_id, and use team_id, target_team_ids, or org_channel to control the channel's workspace sharing.

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

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

Form data describing the channel and the workspaces to connect. channel_id is required.

channel_idstringrequired
The encoded `channel_id` to add or remove to workspaces.
team_idstringoptional
The workspace to which the channel belongs. Omit this argument if the channel is a cross-workspace shared channel.
target_team_idsstringoptional
A comma-separated list of workspaces to which the channel should be shared. Not required if the channel is being shared org-wide.
org_channelbooleanoptional
True if channel has to be converted to an org channel

2 status codes
200Returns an object containing `ok: true` when the channel workspace connections are updated.
okbooleanrequired
Allowed:true
defaultReturns an object containing `ok: false` when the operation cannot be completed.
okbooleanrequired
Allowed:false

Error handling

channel_id is required. Omit team_id for a cross-workspace shared channel, and omit target_team_ids when sharing the channel organization-wide. Use a token with the admin.conversations:write scope.