0

List agreements

by
Published Oct 17, 2025

Returns all agreements and their acceptance status for your account. > --- - __OAuth scopes__. ``` account:read_only ``` [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)

Script linode Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Linode = {
3
  token: string;
4
};
5
/**
6
 * List agreements
7
 * Returns all agreements and their acceptance status for your account.
8

9

10
>
11

12
---
13

14

15
- __OAuth scopes__.
16

17
    ```
18
    account:read_only
19
    ```
20

21
    [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)
22
 */
23
export async function main(auth: Linode, apiVersion: "v4" | "v4beta") {
24
  const url = new URL(
25
    `https://api.linode.com/${apiVersion}/account/agreements`,
26
  );
27

28
  const response = await fetch(url, {
29
    method: "GET",
30
    headers: {
31
      Authorization: "Bearer " + auth.token,
32
    },
33
    body: undefined,
34
  });
35
  if (!response.ok) {
36
    const text = await response.text();
37
    throw new Error(`${response.status} ${text}`);
38
  }
39
  return await response.json();
40
}
41