0

List permissions

by
Published Apr 8, 2025

Retrieve a list of all permissions available to the current access token. The results are **not** paginated. > 🔑 Access with > > Access token

Script mollie Verified

The script

Submitted by hugo697 Bun
Verified 428 days ago
1
//native
2
type Mollie = {
3
  token: string;
4
};
5
/**
6
 * List permissions
7
 * Retrieve a list of all permissions available to the current access token.
8

9
The results are **not** paginated.
10

11
> 🔑 Access with
12
>
13
> Access token
14
 */
15
export async function main(auth: Mollie) {
16
  const url = new URL(`https://api.mollie.com/v2/permissions`);
17

18
  const response = await fetch(url, {
19
    method: "GET",
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.text();
30
}
31