0

Remove classification from folder

by
Published Oct 17, 2025

Removes any classifications from a folder. This API can also be called by including the enterprise ID in the URL explicitly, for example `/folders/:id/enterprise_12345/securityClassification-6VMVochwUWo`.

Script box Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Box = {
3
  token: string;
4
};
5
/**
6
 * Remove classification from folder
7
 * Removes any classifications from a folder.
8

9
This API can also be called by including the enterprise ID in the
10
URL explicitly, for example
11
`/folders/:id/enterprise_12345/securityClassification-6VMVochwUWo`.
12
 */
13
export async function main(auth: Box, folder_id: string) {
14
  const url = new URL(
15
    `https://api.box.com/2.0/folders/${folder_id}/metadata/enterprise/securityClassification-6VMVochwUWo`,
16
  );
17

18
  const response = await fetch(url, {
19
    method: "DELETE",
20
    headers: {
21
      Authorization: "Bearer " + auth.token,
22
    },
23
    body: undefined,
24
  });
25
  if (!response.ok) {
26
    const text = await response.text();
27
    throw new Error(`${response.status} ${text}`);
28
  }
29
  return await response.json();
30
}
31