Skip to content

Commit 867464f

Browse files
author
Slack API Ref Buildbot
committed
Add admin.usergroups methods and new error codes
- Added admin.usergroups.addUsers, create, fetch, removeUsers, update, uploadUsers methods - Added new error codes: invalid_scopes, static_prompts_configured, invalid_channel_id, accepter_email_not_verified, posting_to_channel_denied, app_cannot_join_channel, cannot_modify_role_admin - Added permissions schema to admin.workflows.permissions.lookup - Added connector_resource enum value and minItems/maxItems constraints to canvases methods - Bumped auth.teams.list rate_limits from t2 to t3
1 parent 85988b6 commit 867464f

39 files changed

Lines changed: 1240 additions & 8 deletions

‎docs.slack.dev/methods/admin.apps.requests.list.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@
108108
},
109109
"too_many_teams_provided": {
110110
"desc": "Please provide only `team_id` OR `enterprise_id`"
111+
},
112+
"invalid_scopes": {
113+
"desc": "One or more of the given scopes is not a recognized OAuth scope"
111114
}
112115
},
113116
"examples": {

‎docs.slack.dev/methods/admin.conversations.bulkSetExcludeFromSlackAi.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"desc": "Exclude channels from Slack AI in bulk",
2+
"desc": "Exclude channels from Slack AI in bulk.",
33
"http_method": "GET",
44
"scope": {
55
"user": [

‎docs.slack.dev/methods/admin.functions.permissions.set.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"desc": "List of user IDs to allow for `named_entities` visibility.",
4242
"example": "['U00000001', 'U00000002', 'U00000003']",
4343
"items": {
44-
"$schema": "user_id"
44+
"schema": "user_id"
4545
},
4646
"maxItems": 200,
4747
"uniqueItems": true
@@ -68,15 +68,16 @@
6868
"type": "string",
6969
"enum": [
7070
"slack_function",
71-
"private_channel_access"
71+
"private_channel_access",
72+
"connector_resource"
7273
]
7374
},
7475
"user_ids": {
7576
"type": "array",
7677
"desc": "List of user IDs to allow for `named_entities` visibility.",
7778
"example": "['U00000001', 'U00000002', 'U00000003']",
7879
"items": {
79-
"$schema": "user_id"
80+
"schema": "user_id"
8081
},
8182
"maxItems": 200,
8283
"uniqueItems": true
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
{
2+
"desc": "Add members to an existing organizational usergroup. This method is only available to Enterprise Grid organizations.",
3+
"http_method": "POST",
4+
"scope": {
5+
"user": [
6+
"admin.usergroups:write"
7+
]
8+
},
9+
"json_input_supported": true,
10+
"rate_limits": "t2",
11+
"args": {
12+
"type": "object",
13+
"required": [
14+
"token",
15+
"id",
16+
"users"
17+
],
18+
"properties": {
19+
"token": {
20+
"type": "string",
21+
"subtype": "auth",
22+
"desc": "Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter.",
23+
"example": "xxxx-xxxxxxxxx-xxxx"
24+
},
25+
"id": {
26+
"desc": "ID of the usergroup to add users to",
27+
"example": "S0604QSJC",
28+
"type": "string",
29+
"subtype": "user_group",
30+
"schema": "subteam_id"
31+
},
32+
"users": {
33+
"desc": "The encoded user IDs to add to the usergroup, provided as a JSON array or a comma-separated string.",
34+
"example": "U060R4BJ4,U060RNRCZ",
35+
"type": "array",
36+
"maxItems": 15000,
37+
"items": {
38+
"schema": "user_id"
39+
}
40+
}
41+
}
42+
},
43+
"output": {
44+
"type": "object",
45+
"properties": {
46+
"error": {
47+
"type": "string",
48+
"desc": "A string representation of the error type"
49+
},
50+
"invalid_users": {
51+
"type": "array",
52+
"items": {
53+
"type": "object",
54+
"required": [
55+
"user_id",
56+
"reason"
57+
],
58+
"properties": {
59+
"user_id": {
60+
"schema": "user_id"
61+
},
62+
"reason": {
63+
"type": "string",
64+
"enum": [
65+
"guest_user",
66+
"deleted_user",
67+
"user_not_found",
68+
"insert_failed",
69+
"channel_limit_exceeded",
70+
"multi_workspace_idp_group",
71+
"usergroup_limit_exceeded"
72+
]
73+
}
74+
}
75+
}
76+
}
77+
}
78+
},
79+
"errors": {
80+
"feature_not_enabled": {
81+
"desc": "The Admin APIs feature is not enabled for this workspace."
82+
},
83+
"invalid_auth": {
84+
"desc": "The workspace specified is not part of this organization."
85+
},
86+
"restricted_action": {
87+
"desc": "The calling user cannot modify the specified usergroup, or the usergroup's membership is managed by an identity provider (IdP) and can only be changed through SCIM."
88+
},
89+
"not_an_enterprise": {
90+
"desc": "The token passed in does not belong to an Enterprise organization."
91+
},
92+
"invalid_usergroup": {
93+
"desc": "A usergroup with the specified ID does not exist."
94+
},
95+
"invalid_users": {
96+
"desc": "One or more users provided can not be added to the usergroup."
97+
},
98+
"user_not_found": {
99+
"desc": "One or more users provided are invalid or are not a member of the organization."
100+
},
101+
"member_count_would_exceed_visible_limit": {
102+
"desc": "The usergroup is visible and the member count would exceed the limit."
103+
},
104+
"cannot_modify_role_admin": {
105+
"desc": "The user does not have permission to modify the roles admin role."
106+
}
107+
},
108+
"examples": {
109+
"success": {
110+
"url": "/api/admin.usergroups.addUsers?token=YOUR_TOKEN&id=S0604QSJC&users=U060R4BJ4,U060RNRCZ",
111+
"description": "Success response. Any users that could not be added are listed in invalid_users, which is omitted when every user is added successfully.",
112+
"example": {
113+
"ok": true,
114+
"invalid_users": [
115+
{
116+
"user_id": "U060RNRCZ",
117+
"reason": "guest_user"
118+
}
119+
]
120+
}
121+
},
122+
"error": {
123+
"url": "/api/admin.usergroups.addUsers?token=YOUR_TOKEN&id=S0604QSJC&users=U060R4BJ4,U060RNRCZ",
124+
"description": "Typical error response if the calling user cannot modify the specified usergroup",
125+
"example": {
126+
"ok": false,
127+
"error": "restricted_action"
128+
}
129+
}
130+
}
131+
}
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"desc": "Create a new organizational usergroup. This method is only available to Enterprise Grid organizations.",
3+
"http_method": "POST",
4+
"scope": {
5+
"user": [
6+
"admin.usergroups:write"
7+
]
8+
},
9+
"json_input_supported": true,
10+
"rate_limits": "t1",
11+
"args": {
12+
"type": "object",
13+
"required": [
14+
"token",
15+
"name"
16+
],
17+
"properties": {
18+
"token": {
19+
"type": "string",
20+
"subtype": "auth",
21+
"desc": "Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter.",
22+
"example": "xxxx-xxxxxxxxx-xxxx"
23+
},
24+
"name": {
25+
"desc": "Unique name for the usergroup",
26+
"type": "string"
27+
},
28+
"handle": {
29+
"desc": "Optional handle used to mention the usergroup in channel, must be unique",
30+
"type": "string"
31+
},
32+
"purpose": {
33+
"desc": "Optional purpose that describes what the usergroup is about",
34+
"type": "string"
35+
},
36+
"is_visible": {
37+
"desc": "Configure whether or not this usergroup should be visible in the client",
38+
"example": "true",
39+
"type": "boolean"
40+
}
41+
}
42+
},
43+
"output": {
44+
"type": "object",
45+
"properties": {
46+
"error": {
47+
"type": "string",
48+
"desc": "A string representation of the error type"
49+
},
50+
"subteam": {
51+
"schema": "subteam"
52+
}
53+
}
54+
},
55+
"errors": {
56+
"feature_not_enabled": {
57+
"desc": "The Admin APIs feature is not enabled for this workspace."
58+
},
59+
"invalid_auth": {
60+
"desc": "The workspace specified is not part of this organization."
61+
},
62+
"restricted_action": {
63+
"desc": "The calling user is not allowed to create usergroups."
64+
},
65+
"not_an_enterprise": {
66+
"desc": "The token passed in does not belong to an Enterprise organization."
67+
},
68+
"name_already_exists": {
69+
"desc": "The name specified is used by another usergroup and cannot be created."
70+
},
71+
"handle_already_exists": {
72+
"desc": "The handle specified is used by another usergroup or entity and cannot be created."
73+
}
74+
},
75+
"examples": {
76+
"success": {
77+
"url": "/api/admin.usergroups.create?token=YOUR_TOKEN&name=Marketing%20Team&handle=marketing-team&is_visible=true",
78+
"description": "Typical success response",
79+
"example": {
80+
"ok": true,
81+
"subteam": {
82+
"id": "S0604QSJC",
83+
"team_id": "E060RNRCZ",
84+
"enterprise_id": "E060RNRCZ",
85+
"is_subteam": true,
86+
"is_usergroup": true,
87+
"name": "Marketing Team",
88+
"description": "",
89+
"handle": "marketing-team",
90+
"is_external": false,
91+
"date_create": 1446746793,
92+
"date_update": 1446746793,
93+
"date_delete": 0,
94+
"auto_type": null,
95+
"auto_provision": false,
96+
"enterprise_subteam_id": "",
97+
"created_by": "U060R4BJ4",
98+
"updated_by": "U060R4BJ4",
99+
"deleted_by": null,
100+
"is_section": false,
101+
"is_editing_restricted": true,
102+
"is_membership_locked": true,
103+
"is_idp_group": false,
104+
"is_visible": true,
105+
"is_org_level": true,
106+
"user_count": 0,
107+
"channel_count": 0
108+
}
109+
}
110+
},
111+
"error": {
112+
"url": "/api/admin.usergroups.create?token=YOUR_TOKEN&name=Marketing%20Team",
113+
"description": "Typical error response if a usergroup with the given name already exists",
114+
"example": {
115+
"ok": false,
116+
"error": "name_already_exists"
117+
}
118+
}
119+
}
120+
}

0 commit comments

Comments
 (0)