0

Get an OAuth client

by
Published Oct 17, 2025

Returns information about a single OAuth client. > --- - __CLI__. ``` linode-cli account client-view \ edc6790ea9db4d224c5c ``` [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 an OAuth client
7
 * Returns information about a single OAuth client.
8

9

10
>
11

12
---
13

14

15
- __CLI__.
16

17
    ```
18
    linode-cli account client-view \
19
  edc6790ea9db4d224c5c
20
    ```
21

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

24
- __OAuth scopes__.
25

26
    ```
27
    account:read_only
28
    ```
29

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

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