/policyengine/v1/tags/: DELETE

Deletes an existing tag definition.

The following table shows which roles can access this REST API endpoint:
Table 1. Access by role
Data admin Data user Collection Admin Collection user Admin Service user
1 X2 X X Χ Χ
1 For read/write access to 'Open', 'Restricted', and 'Characteristics' types of tags.
2 For read-only access to 'Open' and 'Restricted' types of tags, and read/write access to 'Characteristics' tags.
Important: You cannot delete the "Collection" and "Temperature" tags.

Synopsis of the request URL

$ curl -H "Authorization: Bearer <token>" -k
https://<spectrum_discover_host>:443/policyengine/v1/tags/<tag_name> -X DELETE

Supported request types and response formats

Supported request types:
Supported response formats:
  • JSON


  1. If a tag specified from the set of currently defined tags is in-use (its nondefault value is set in at least one document) the delete tag operation returns an error:
    < HTTP/1.0 403 FORBIDDEN
    < Content-Type: text/html; charset=utf-8
    < Content-Length: 102
    < Server: Werkzeug/0.14.1 Python/2.7.5
    < Date: Wed, 09 May 2018 17:20:05 GMT
    Cannot delete tag <tag_name> because it is in use in '38' records. Force deletion with
    'force' option.
  2. To force deletion of an in-use tag, use the 'force' option as follows:
    $ curl -H "Authorization: Bearer <token>" -k
    https://<spectrum_discover_host>:443/policyengine/v1/tags/<tag_name> -X DELETE -d
    '{"force":"true"}' -H "Content-Type: application/json"
    Important: The force option results in the deletion of the tag and its values are set by default to NULL or empty string.