0

List all classifications

by
Published Oct 17, 2025

Retrieves the classification metadata template and lists all the classifications available to this enterprise. This API can also be called by including the enterprise ID in the URL explicitly, for example `/metadata_templates/enterprise_12345/securityClassification-6VMVochwUWo/schema`.

Script box Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Box = {
3
  token: string;
4
};
5
/**
6
 * List all classifications
7
 * Retrieves the classification metadata template and lists all the
8
classifications available to this enterprise.
9

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

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