0

Get a profile

by
Published Oct 17, 2025

Returns information about the current user. Use this to see who is acting in applications where more than one token is managed, such as a third-party OAuth application. > 📘 > > A third-party OAuth application accessing a profile with this operation has full access to all aspects of that profile. > --- - __CLI__. ``` linode-cli profile view ``` [Learn more...](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-the-linode-cli)

Script linode Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Linode = {
3
  token: string;
4
};
5
/**
6
 * Get a profile
7
 * Returns information about the current user. Use this to see who is acting in applications where more than one token is managed, such as a third-party OAuth application.
8

9
> 📘
10
>
11
> A third-party OAuth application accessing a profile with this operation has full access to all aspects of that profile.
12

13

14
>
15

16
---
17

18

19
- __CLI__.
20

21
    ```
22
    linode-cli profile view
23
    ```
24

25
    [Learn more...](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-the-linode-cli)
26
 */
27
export async function main(auth: Linode, apiVersion: "v4" | "v4beta") {
28
  const url = new URL(`https://api.linode.com/${apiVersion}/profile`);
29

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