0

List Org Sheets

by
Published Oct 17, 2025

Gets a summarized list of all sheets owned by the members of the organization account. * **_This operation is only available to system administrators_** * **_You may use the query string parameter numericDates with a value of true to enable strict parsing of dates in numeric format. See Dates and Times for more information._**

Script smartsheet Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Smartsheet = {
3
  token: string;
4
  baseUrl: string;
5
};
6
/**
7
 * List Org Sheets
8
 * Gets a summarized list of all sheets owned by the members of the organization account.
9

10
* **_This operation is only available to system administrators_**
11

12
* **_You may use the query string parameter numericDates with a value of true to enable strict parsing of dates in numeric format. See Dates and Times for more information._**
13

14
 */
15
export async function main(
16
  auth: Smartsheet,
17
  modifiedSince: string | undefined,
18
) {
19
  const url = new URL(`${auth.baseUrl}/users/sheets`);
20
  for (const [k, v] of [["modifiedSince", modifiedSince]]) {
21
    if (v !== undefined && v !== "" && k !== undefined) {
22
      url.searchParams.append(k, v);
23
    }
24
  }
25
  const response = await fetch(url, {
26
    method: "GET",
27
    headers: {
28
      Authorization: "Bearer " + auth.token,
29
    },
30
    body: undefined,
31
  });
32
  if (!response.ok) {
33
    const text = await response.text();
34
    throw new Error(`${response.status} ${text}`);
35
  }
36
  return await response.json();
37
}
38