DELETE /v1/tags/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Tags
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
Tags.delete("68ec158c-5f5e-4277-8a19-5e9e0cd5294f")
# Hard delete
Tags.delete(
"68ec158c-5f5e-4277-8a19-5e9e0cd5294f",
hard_delete=True
)
# Delete by name
Tags.delete_by_name("Certification.Bronze")
# Restore a soft-deleted tag
Tags.restore("68ec158c-5f5e-4277-8a19-5e9e0cd5294f")
import static org.openmetadata.sdk.fluent.Tags.*;
// Soft delete
Tags.delete("68ec158c-5f5e-4277-8a19-5e9e0cd5294f").execute();
// Hard delete
Tags.delete("68ec158c-5f5e-4277-8a19-5e9e0cd5294f")
.hardDelete()
.execute();
// Delete by name
Tags.deleteByName("Certification.Bronze").execute();
// Restore
Tags.restore("68ec158c-5f5e-4277-8a19-5e9e0cd5294f");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/tags/68ec158c-5f5e-4277-8a19-5e9e0cd5294f" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/tags/68ec158c-5f5e-4277-8a19-5e9e0cd5294f?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/tags/name/Certification.Bronze" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted tag
curl -X PUT "{base_url}/api/v1/tags/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "68ec158c-5f5e-4277-8a19-5e9e0cd5294f"}'
{
"id": "68ec158c-5f5e-4277-8a19-5e9e0cd5294f",
"name": "Bronze",
"fullyQualifiedName": "Certification.Bronze",
"description": "Bronze certified Data Asset.",
"style": {
"color": "#C08320"
},
"version": 0.2,
"updatedAt": 1769982619666,
"updatedBy": "admin",
"classification": {
"id": "06d90883-6be9-4f7e-9475-753f10a95e94",
"type": "classification",
"name": "Certification",
"fullyQualifiedName": "Certification"
},
"deleted": true,
"owners": [],
"provider": "system",
"mutuallyExclusive": false
}
Delete a Tag
Delete a tag by ID or name, with soft/hard delete options
DELETE
/
v1
/
tags
/
{id}
DELETE /v1/tags/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Tags
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
Tags.delete("68ec158c-5f5e-4277-8a19-5e9e0cd5294f")
# Hard delete
Tags.delete(
"68ec158c-5f5e-4277-8a19-5e9e0cd5294f",
hard_delete=True
)
# Delete by name
Tags.delete_by_name("Certification.Bronze")
# Restore a soft-deleted tag
Tags.restore("68ec158c-5f5e-4277-8a19-5e9e0cd5294f")
import static org.openmetadata.sdk.fluent.Tags.*;
// Soft delete
Tags.delete("68ec158c-5f5e-4277-8a19-5e9e0cd5294f").execute();
// Hard delete
Tags.delete("68ec158c-5f5e-4277-8a19-5e9e0cd5294f")
.hardDelete()
.execute();
// Delete by name
Tags.deleteByName("Certification.Bronze").execute();
// Restore
Tags.restore("68ec158c-5f5e-4277-8a19-5e9e0cd5294f");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/tags/68ec158c-5f5e-4277-8a19-5e9e0cd5294f" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/tags/68ec158c-5f5e-4277-8a19-5e9e0cd5294f?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/tags/name/Certification.Bronze" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted tag
curl -X PUT "{base_url}/api/v1/tags/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "68ec158c-5f5e-4277-8a19-5e9e0cd5294f"}'
{
"id": "68ec158c-5f5e-4277-8a19-5e9e0cd5294f",
"name": "Bronze",
"fullyQualifiedName": "Certification.Bronze",
"description": "Bronze certified Data Asset.",
"style": {
"color": "#C08320"
},
"version": 0.2,
"updatedAt": 1769982619666,
"updatedBy": "admin",
"classification": {
"id": "06d90883-6be9-4f7e-9475-753f10a95e94",
"type": "classification",
"name": "Certification",
"fullyQualifiedName": "Certification"
},
"deleted": true,
"owners": [],
"provider": "system",
"mutuallyExclusive": false
}
Delete a Tag
Delete a tag by ID or fully qualified name. Supports soft delete (default), hard delete, and restore operations.Delete by ID
string
required
UUID of the tag to delete.
boolean
default:"false"
Recursively delete child tags.
boolean
default:"false"
Permanently delete the tag. If
false, the tag is soft-deleted and can be restored.Delete by Name
UseDELETE /v1/tags/name/{fqn} to delete by fully qualified name.
string
required
Fully qualified name of the tag (e.g.,
Certification.Bronze).boolean
default:"false"
Recursively delete child tags.
boolean
default:"false"
Permanently delete the tag.
Restore a Soft-Deleted Tag
UsePUT /v1/tags/restore to restore a soft-deleted tag.
string
required
UUID of the soft-deleted tag to restore.
DELETE /v1/tags/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Tags
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
Tags.delete("68ec158c-5f5e-4277-8a19-5e9e0cd5294f")
# Hard delete
Tags.delete(
"68ec158c-5f5e-4277-8a19-5e9e0cd5294f",
hard_delete=True
)
# Delete by name
Tags.delete_by_name("Certification.Bronze")
# Restore a soft-deleted tag
Tags.restore("68ec158c-5f5e-4277-8a19-5e9e0cd5294f")
import static org.openmetadata.sdk.fluent.Tags.*;
// Soft delete
Tags.delete("68ec158c-5f5e-4277-8a19-5e9e0cd5294f").execute();
// Hard delete
Tags.delete("68ec158c-5f5e-4277-8a19-5e9e0cd5294f")
.hardDelete()
.execute();
// Delete by name
Tags.deleteByName("Certification.Bronze").execute();
// Restore
Tags.restore("68ec158c-5f5e-4277-8a19-5e9e0cd5294f");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/tags/68ec158c-5f5e-4277-8a19-5e9e0cd5294f" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/tags/68ec158c-5f5e-4277-8a19-5e9e0cd5294f?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/tags/name/Certification.Bronze" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted tag
curl -X PUT "{base_url}/api/v1/tags/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "68ec158c-5f5e-4277-8a19-5e9e0cd5294f"}'
{
"id": "68ec158c-5f5e-4277-8a19-5e9e0cd5294f",
"name": "Bronze",
"fullyQualifiedName": "Certification.Bronze",
"description": "Bronze certified Data Asset.",
"style": {
"color": "#C08320"
},
"version": 0.2,
"updatedAt": 1769982619666,
"updatedBy": "admin",
"classification": {
"id": "06d90883-6be9-4f7e-9475-753f10a95e94",
"type": "classification",
"name": "Certification",
"fullyQualifiedName": "Certification"
},
"deleted": true,
"owners": [],
"provider": "system",
"mutuallyExclusive": false
}
Returns
Soft delete returns the tag object withdeleted: true. Hard delete returns no content (204). Restore returns the restored tag object.
Error Handling
| Code | Error Type | Description |
|---|---|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to delete this tag |
404 | NOT_FOUND | Tag with given ID or FQN does not exist |
Was this page helpful?
⌘I