Removing Integration Associations from Content

Problem

You want to remove the association between an integration and a content item.

Solution

Get a content item, then use the content item’s oauth.associations.delete() method to delete the association.

from posit import connect

GUID = "a080baef-854e-411f-ac3c-d2bc47bcb109"

client = connect.Client()
content = client.content.get(GUID)
content.oauth.associations.delete()

Get the content item’s guid, then use the connectapi client to make a direct call to the associations endpoint using an empty list.

library(connectapi)

GUID <- "a080baef-854e-411f-ac3c-d2bc47bcb109"

client <- connect()
client$PUT(paste0("v1/content/", GUID, "/oauth/integrations/associations"), body = "[]")

Discussion

To confirm that the association was deleted follow the Finding Integrations Associated to Content recipe.

See also