Sample - Slack Web API
POST/usergroups.disable

Disable a User Group

Disables an existing User Group. Supply the encoded User Group identifier and optionally request the number of users in the returned object. The response returns the User Group after it has been disabled.

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

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

Form-encoded fields identifying the User Group to disable and controlling returned user-count information.

include_countbooleanoptional
Include the number of users in the User Group.
usergroupstringrequired
The encoded ID of the User Group to disable.

2 status codes
200Returns an object with `ok` set to true and a `usergroup` object containing the disabled User Group and its current configuration.
okbooleanrequired
Allowed:true
usergroupobjectrequired
defaultReturns an error object with `ok` set to false and an `error` value describing why the User Group could not be disabled.
callstackstringoptional
Note: PHP callstack is only visible in dev/qa
errorstringrequired
Allowed:permission_deniednot_authedinvalid_authaccount_inactivetoken_revokedno_permissionorg_login_requireduser_is_botuser_is_restrictedinvalid_arg_nameinvalid_array_arginvalid_charset
okbooleanrequired
Allowed:false

Error handling

Supply token with the usergroups:write scope and provide usergroup. The usergroup value must identify an existing encoded User Group, and include_count controls whether its user count is included.