0

Delete a tag

by
Published Oct 17, 2025

Remove a Tag from all objects and delete it. __Important__. You must be an unrestricted User in order to access, add, or modify Tags information. > --- - __CLI__. ``` linode-cli tags delete linode-cli tags rm ``` [Learn more...](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-the-linode-cli) - __OAuth scopes__. ``` account:read_write ``` [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
 * Delete a tag
7
 * Remove a Tag from all objects and delete it.
8

9
__Important__. You must be an unrestricted User in order to access, add, or modify Tags information.
10

11

12
>
13

14
---
15

16

17
- __CLI__.
18

19
    ```
20
    linode-cli tags delete
21
linode-cli tags rm
22
    ```
23

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

26
- __OAuth scopes__.
27

28
    ```
29
    account:read_write
30
    ```
31

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

41
  const response = await fetch(url, {
42
    method: "DELETE",
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