Skip to content

Commit 4f0934e

Browse files
author
Slack API Ref Buildbot
committed
Add channel_ids restrictions to admin.apps.permissions methods
- Added channel_ids argument to admin.apps.permissions.add/remove/set for channel-level restrictions - Added channel_restriction_mode argument and two new errors to admin.apps.permissions.set - Removed is_embedded_preview_enabled argument from admin.apps.config.set - Added response examples for channel restriction scenarios - Expanded chunks description in chat.startStream/chat.stopStream to list supported chunk types
1 parent 60c629e commit 4f0934e

12 files changed

Lines changed: 106 additions & 17 deletions

‎docs.slack.dev/methods/admin.apps.config.set.json‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@
6565
}
6666
}
6767
}
68-
},
69-
"is_embedded_preview_enabled": {
70-
"type": "boolean",
71-
"desc": "Whether the app is allowed to render embedded previews of its work objects on this team. Only settable for apps that have declared embed domains, as the setting does not apply to any other app, and only where the embedded preview feature is available to the caller."
7268
}
7369
}
7470
},

‎docs.slack.dev/methods/admin.apps.permissions.add.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@
4343
"items": {
4444
"schema": "subteam_id"
4545
}
46+
},
47+
"channel_ids": {
48+
"type": "array",
49+
"desc": "List of encoded channel IDs to add to the channel restriction list. Interpretation depends on the app's `channel_restriction_mode`, which is configured via the `admin.apps.permissions.set` method.",
50+
"example": "C00000001,C00000002",
51+
"items": {
52+
"schema": "channel_id"
53+
},
54+
"maxItems": 200
4655
}
4756
}
4857
},

‎docs.slack.dev/methods/admin.apps.permissions.remove.json‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@
4343
"items": {
4444
"schema": "subteam_id"
4545
}
46+
},
47+
"channel_ids": {
48+
"type": "array",
49+
"desc": "List of encoded channel IDs to remove from the channel restriction list. Interpretation depends on the app's `channel_restriction_mode`, which is configured via the `admin.apps.permissions.set` method.",
50+
"example": "C00000001,C00000002",
51+
"items": {
52+
"schema": "channel_id"
53+
},
54+
"maxItems": 200
4655
}
4756
}
4857
},
@@ -93,5 +102,18 @@
93102
"desc": "User does not have permission to perform this action."
94103
}
95104
},
96-
"examples": {}
105+
"examples": {
106+
"channel_restrictions": {
107+
"url": "/api/admin.apps.permissions.remove",
108+
"description": "When the app has channel restrictions configured, the response reflects the updated channel list",
109+
"example": {
110+
"ok": true,
111+
"permission_type": "everyone",
112+
"channel_restriction_mode": "specific_channels",
113+
"channel_ids": [
114+
"C00000001"
115+
]
116+
}
117+
}
118+
}
97119
}

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

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,24 @@
5353
"items": {
5454
"schema": "subteam_id"
5555
}
56+
},
57+
"channel_restriction_mode": {
58+
"desc": "The mode that defines where the app can be used in channels",
59+
"type": "string",
60+
"enum": [
61+
"all_channels",
62+
"specific_channels",
63+
"all_channels_except"
64+
]
65+
},
66+
"channel_ids": {
67+
"type": "array",
68+
"desc": "List of encoded channel IDs for channel restrictions. Semantics depend on channel_restriction_mode: allowlist for specific_channels, exclusion list for all_channels_except",
69+
"example": "C00000001,C00000002",
70+
"items": {
71+
"schema": "channel_id"
72+
},
73+
"maxItems": 200
5674
}
5775
}
5876
},
@@ -101,7 +119,27 @@
101119
},
102120
"restricted_action": {
103121
"desc": "User does not have permission to perform this action."
122+
},
123+
"channel_restrictions_not_available": {
124+
"desc": "Channel restrictions are not available for this workspace."
125+
},
126+
"channel_restriction_requires_app_access": {
127+
"desc": "Channel access cannot be configured while the app is set to no_one, since the app can't be used in any channel."
104128
}
105129
},
106-
"examples": {}
130+
"examples": {
131+
"channel_restrictions": {
132+
"url": "/api/admin.apps.permissions.set",
133+
"description": "When channel restrictions are configured, the response also includes `channel_restriction_mode` and, for `specific_channels` or `all_channels_except`, the `channel_ids` it applies to. When `permission_type` is `no_one`, the response returns `channel_restriction_mode` as `no_one`, since the app can't be used in any channel.",
134+
"example": {
135+
"ok": true,
136+
"permission_type": "everyone",
137+
"channel_restriction_mode": "specific_channels",
138+
"channel_ids": [
139+
"C00000001",
140+
"C00000002"
141+
]
142+
}
143+
}
144+
}
107145
}

‎docs.slack.dev/methods/chat.startStream.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"subtype": "channel"
3232
},
3333
"chunks": {
34-
"desc": "Array of streaming chunks.",
34+
"desc": "Array of streaming chunks. Can include [markdown text chunk](#markdown_text-chunks) objects, [task update chunk](#task_update-chunks) objects, [plan update chunks](#plan_update-chunks), or [blocks chunks](#blocks-chunks).",
3535
"type": "array"
3636
},
3737
"markdown_text": {

‎docs.slack.dev/methods/chat.stopStream.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"subtype": "channel"
3333
},
3434
"chunks": {
35-
"desc": "Array of streaming chunks.",
35+
"desc": "Array of streaming chunks. Can include [markdown text chunk](#markdown_text-chunks) objects, [task update chunk](#task_update-chunks) objects, [plan update chunks](#plan_update-chunks), or [blocks chunks](#blocks-chunks).",
3636
"type": "array",
3737
"schema": ""
3838
},

‎methods/admin/admin.apps.config.set.json‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
"required": false,
2424
"desc": "Domain restrictions for the app. Should be an object with two properties: urls and emails. Each is an array of strings, and each sets the allowed URLs and emails for connector authorization, respectively.",
2525
"type": "object"
26-
},
27-
"is_embedded_preview_enabled": {
28-
"required": false,
29-
"desc": "Whether the app is allowed to render embedded previews of its work objects on this team. Only settable for apps that have declared embed domains, as the setting does not apply to any other app, and only where the embedded preview feature is available to the caller.",
30-
"type": "boolean"
3126
}
3227
},
3328
"response": {

‎methods/admin/admin.apps.permissions.add.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
"example": "S00000001,S00000002",
2222
"desc": "List of encoded usergroup IDs.",
2323
"type": "array"
24+
},
25+
"channel_ids": {
26+
"required": false,
27+
"example": "C00000001,C00000002",
28+
"desc": "List of encoded channel IDs to add to the channel restriction list. Interpretation depends on the app's channel_restriction_mode, which is configured via the admin.apps.permissions.set method.",
29+
"type": "array"
2430
}
2531
},
2632
"response": {

‎methods/admin/admin.apps.permissions.remove.json‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,18 @@
2121
"example": "S00000001,S00000002",
2222
"desc": "List of encoded usergroup IDs.",
2323
"type": "array"
24+
},
25+
"channel_ids": {
26+
"required": false,
27+
"example": "C00000001,C00000002",
28+
"desc": "List of encoded channel IDs to remove from the channel restriction list. Interpretation depends on the app's channel_restriction_mode, which is configured via the admin.apps.permissions.set method.",
29+
"type": "array"
2430
}
2531
},
2632
"response": {
27-
"examples": []
33+
"examples": [
34+
"{\n \"ok\": true,\n \"permission_type\": \"everyone\",\n \"channel_restriction_mode\": \"specific_channels\",\n \"channel_ids\": [\n \"C00000001\"\n ]\n}"
35+
]
2836
},
2937
"errors": {
3038
"access_denied": "This actor does not have access to the permissions on this resource.",

‎methods/admin/admin.apps.permissions.set.json‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,23 @@
2626
"example": "S00000001,S00000002",
2727
"desc": "List of encoded usergroup IDs.",
2828
"type": "array"
29+
},
30+
"channel_restriction_mode": {
31+
"required": false,
32+
"desc": "The mode that defines where the app can be used in channels.",
33+
"type": "enum"
34+
},
35+
"channel_ids": {
36+
"required": false,
37+
"example": "C00000001,C00000002",
38+
"desc": "List of encoded channel IDs for channel restrictions. Semantics depend on channel_restriction_mode: allowlist for specific_channels, exclusion list for all_channels_except.",
39+
"type": "array"
2940
}
3041
},
3142
"response": {
32-
"examples": []
43+
"examples": [
44+
"{\n \"ok\": true,\n \"permission_type\": \"everyone\",\n \"channel_restriction_mode\": \"specific_channels\",\n \"channel_ids\": [\n \"C00000001\",\n \"C00000002\"\n ]\n}"
45+
]
3346
},
3447
"errors": {
3548
"access_denied": "This actor does not have access to the permissions on this resource.",
@@ -38,6 +51,8 @@
3851
"app_not_found": "This app does not exist.",
3952
"channel_ids_required": "channel_ids is required when channel_restriction_mode is specific_channels or all_channels_except.",
4053
"channel_not_found": "One or more channel IDs are not valid.",
54+
"channel_restriction_requires_app_access": "Channel access cannot be configured while the app is set to no_one, since the app can't be used in any channel.",
55+
"channel_restrictions_not_available": "Channel restrictions are not available for this workspace.",
4156
"deprecated_endpoint": "The endpoint has been deprecated.",
4257
"ekm_access_denied": "Administrators have suspended the ability to post a message.",
4358
"enterprise_is_restricted": "The method cannot be called from an Enterprise.",

0 commit comments

Comments
 (0)