0

Get a user

by
Published Oct 17, 2025

Returns information about a single user on your account. > 📘 > > This operation can only be accessed by account users with _unrestricted_ access. > --- - __CLI__. ``` linode-cli users view example_user ``` [Learn more...](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-the-linode-cli) - __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
 * Get a user
7
 * Returns information about a single user on your account.
8

9
> 📘
10
>
11
> This operation can only be accessed by account users with _unrestricted_ access.
12

13

14
>
15

16
---
17

18

19
- __CLI__.
20

21
    ```
22
    linode-cli users view example_user
23
    ```
24

25
    [Learn more...](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-the-linode-cli)
26

27
- __OAuth scopes__.
28

29
    ```
30
    account:read_only
31
    ```
32

33
    [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)
34
 */
35
export async function main(
36
  auth: Linode,
37
  apiVersion: "v4" | "v4beta",
38
  username: string,
39
) {
40
  const url = new URL(
41
    `https://api.linode.com/${apiVersion}/account/users/${username}`,
42
  );
43

44
  const response = await fetch(url, {
45
    method: "GET",
46
    headers: {
47
      Authorization: "Bearer " + auth.token,
48
    },
49
    body: undefined,
50
  });
51
  if (!response.ok) {
52
    const text = await response.text();
53
    throw new Error(`${response.status} ${text}`);
54
  }
55
  return await response.json();
56
}
57