Detach Tag Association
If vSphere APIs begin with /rest (vs /api), any maps are consumed/returned instead as arrays of objects, each containing a key and a value property field.
Detaches the tag from the given object. If the tag is already removed from the object, then this operation is a no-op and an error will not be thrown. To invoke this operation, you need the attach tag privilege on the tag and the read privilege on the object.
Request
URLURL
https://{api_host}/rest/com/vmware/cis/tagging/tag-association/id:{tag_id}?~action=detach
Parameters
Parameters
string
tag_id
Required
The identifier of the input tag.
The parameter must be an identifier for the resource type: com.vmware.cis.tagging.Tag.
Header Parameters
Header Parameters
string
vmware-api-session-id
Required
Required session ID, obtained by first calling Create Session API
Example: b00db39f948d13ea1e59b4d6fce56389
Request Body
Request Body
TaggingTagAssociationDetachRequestBody of type application/json (required){}
Std_DynamicID
object_id
Required
The identifier of the input object.
cURL Command
curl -X POST -H "vmware-api-session-id: b00db39f948d13ea1e59b4d6fce56389" -H "Content-Type: application/json" -d '{}' https://{api_host}/rest/com/vmware/cis/tagging/tag-association/id:{tag_id}?~action=detach
Errors
401
com.vmware.vapi.std.errors.unauthorized : if you do not have the privilege to detach the tag or do not have the privilege to read the given object. | com.vmware.vapi.std.errors.unauthenticated : if the user can not be authenticated.
404
com.vmware.vapi.std.errors.not_found : if the tag for the given tagId does not exist in the system.