Deleting Tags

Problem

You want to delete a tag.

Warning

You must have administrator privileges to delete a tag.

Solution

You need the identifier of the tag you wish to delete. See Viewing Tag Information for details.

from posit import connect

TAG_ID = "your-tag-id"

client = connect.Client()

# Destroy using the tag ID
client.tags.destroy(TAG_ID)

# Destroy using the tag object
tag = client.tags.get(TAG_ID)
tag.destroy()

Create a Tag object representing the tag you wish to delete, and pass that to delete_tag().

library(connectapi)
client <- connect()

tags <- get_tags(client)
target_tag <- tags$Departments

delete_tag(client, depts_tag)

The delete_tag() function returns a copy of the client object.