0

Update Slack integration mapping

by
Published Oct 17, 2025

Updates a [Slack integration mapping](https://support.box.com/hc/en-us/articles/4415585987859-Box-as-the-Content-Layer-for-Slack). Supports updating the Box folder ID and options. You need Admin or Co-Admin role to use this endpoint.

Script box Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Box = {
3
  token: string;
4
};
5
/**
6
 * Update Slack integration mapping
7
 * Updates a [Slack integration mapping](https://support.box.com/hc/en-us/articles/4415585987859-Box-as-the-Content-Layer-for-Slack).
8
Supports updating the Box folder ID and options.
9

10
You need Admin or Co-Admin role to
11
use this endpoint.
12
 */
13
export async function main(
14
  auth: Box,
15
  integration_mapping_id: string,
16
  body: {
17
    box_item?: { type: "folder"; id: string };
18
    options?: { is_access_management_disabled?: false | true };
19
  },
20
) {
21
  const url = new URL(
22
    `https://api.box.com/2.0/integration_mappings/slack/${integration_mapping_id}`,
23
  );
24

25
  const response = await fetch(url, {
26
    method: "PUT",
27
    headers: {
28
      "Content-Type": "application/json",
29
      Authorization: "Bearer " + auth.token,
30
    },
31
    body: JSON.stringify(body),
32
  });
33
  if (!response.ok) {
34
    const text = await response.text();
35
    throw new Error(`${response.status} ${text}`);
36
  }
37
  return await response.json();
38
}
39