DELETE /v1/containers/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Containers
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
Containers.delete("14744329-85c2-499e-b1fa-249fb8162341")
# Hard delete
Containers.delete(
"14744329-85c2-499e-b1fa-249fb8162341",
hard_delete=True
)
# Delete by name (look up the ID first)
entity = Containers.retrieve_by_name("s3_datalake.analytics-bucket")
Containers.delete(entity.id)
# Delete by name with options
entity = Containers.retrieve_by_name("s3_datalake.analytics-bucket")
Containers.delete(entity.id, hard_delete=True, recursive=True)
# Restore a soft-deleted container
Containers.restore("14744329-85c2-499e-b1fa-249fb8162341")
import java.util.Map;
import org.openmetadata.sdk.network.HttpMethod;
// client is an initialized OpenMetadataClient.
// Soft delete
client.containers().delete("14744329-85c2-499e-b1fa-249fb8162341");
// Hard delete
client.containers().delete("14744329-85c2-499e-b1fa-249fb8162341", Map.of("hardDelete", "true"));
// Delete by name
client.getHttpClient().execute(
HttpMethod.DELETE,
"/v1/containers/name/s3_datalake.analytics-bucket",
null,
Void.class
);
// Restore
client.containers().restore("14744329-85c2-499e-b1fa-249fb8162341");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/containers/14744329-85c2-499e-b1fa-249fb8162341" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/containers/14744329-85c2-499e-b1fa-249fb8162341?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/containers/name/s3_datalake.analytics-bucket" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted container
curl -X PUT "{base_url}/api/v1/containers/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "14744329-85c2-499e-b1fa-249fb8162341"}'
{
"id": "14744329-85c2-499e-b1fa-249fb8162341",
"name": "analytics-bucket",
"displayName": "Analytics Bucket",
"fullyQualifiedName": "s3_datalake.analytics-bucket",
"description": "Primary analytics data lake bucket",
"version": 0.2,
"updatedAt": 1769982673032,
"updatedBy": "admin",
"service": {
"id": "d1589e1d-2ab0-431c-a383-15e4be20a106",
"type": "storageService",
"name": "s3_datalake",
"fullyQualifiedName": "s3_datalake"
},
"serviceType": "S3",
"deleted": true,
"owners": [],
"tags": [],
"domains": []
}
Delete a Container
Delete a container by ID or name, with soft/hard delete options
DELETE
/
v1
/
containers
/
{id}
DELETE /v1/containers/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Containers
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
Containers.delete("14744329-85c2-499e-b1fa-249fb8162341")
# Hard delete
Containers.delete(
"14744329-85c2-499e-b1fa-249fb8162341",
hard_delete=True
)
# Delete by name (look up the ID first)
entity = Containers.retrieve_by_name("s3_datalake.analytics-bucket")
Containers.delete(entity.id)
# Delete by name with options
entity = Containers.retrieve_by_name("s3_datalake.analytics-bucket")
Containers.delete(entity.id, hard_delete=True, recursive=True)
# Restore a soft-deleted container
Containers.restore("14744329-85c2-499e-b1fa-249fb8162341")
import java.util.Map;
import org.openmetadata.sdk.network.HttpMethod;
// client is an initialized OpenMetadataClient.
// Soft delete
client.containers().delete("14744329-85c2-499e-b1fa-249fb8162341");
// Hard delete
client.containers().delete("14744329-85c2-499e-b1fa-249fb8162341", Map.of("hardDelete", "true"));
// Delete by name
client.getHttpClient().execute(
HttpMethod.DELETE,
"/v1/containers/name/s3_datalake.analytics-bucket",
null,
Void.class
);
// Restore
client.containers().restore("14744329-85c2-499e-b1fa-249fb8162341");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/containers/14744329-85c2-499e-b1fa-249fb8162341" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/containers/14744329-85c2-499e-b1fa-249fb8162341?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/containers/name/s3_datalake.analytics-bucket" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted container
curl -X PUT "{base_url}/api/v1/containers/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "14744329-85c2-499e-b1fa-249fb8162341"}'
{
"id": "14744329-85c2-499e-b1fa-249fb8162341",
"name": "analytics-bucket",
"displayName": "Analytics Bucket",
"fullyQualifiedName": "s3_datalake.analytics-bucket",
"description": "Primary analytics data lake bucket",
"version": 0.2,
"updatedAt": 1769982673032,
"updatedBy": "admin",
"service": {
"id": "d1589e1d-2ab0-431c-a383-15e4be20a106",
"type": "storageService",
"name": "s3_datalake",
"fullyQualifiedName": "s3_datalake"
},
"serviceType": "S3",
"deleted": true,
"owners": [],
"tags": [],
"domains": []
}
Delete a Container
Delete a container by ID or fully qualified name. Supports soft delete (default), hard delete, and restore operations.Delete by ID
string
required
UUID of the container to delete.
boolean
default:"false"
Recursively delete child containers.
boolean
default:"false"
Permanently delete the container. If
false, the container is soft-deleted and can be restored.Delete by Name
UseDELETE /v1/containers/name/{fqn} to delete by fully qualified name.
string
required
Fully qualified name of the container, for example
s3_datalake.analytics-bucket.boolean
default:"false"
Recursively delete child containers.
boolean
default:"false"
Permanently delete the container.
Restore a Soft-Deleted Container
UsePUT /v1/containers/restore to restore a soft-deleted container.
string
required
UUID of the soft-deleted container to restore.
DELETE /v1/containers/{id}
from metadata.sdk import configure
from metadata.sdk.entities import Containers
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
Containers.delete("14744329-85c2-499e-b1fa-249fb8162341")
# Hard delete
Containers.delete(
"14744329-85c2-499e-b1fa-249fb8162341",
hard_delete=True
)
# Delete by name (look up the ID first)
entity = Containers.retrieve_by_name("s3_datalake.analytics-bucket")
Containers.delete(entity.id)
# Delete by name with options
entity = Containers.retrieve_by_name("s3_datalake.analytics-bucket")
Containers.delete(entity.id, hard_delete=True, recursive=True)
# Restore a soft-deleted container
Containers.restore("14744329-85c2-499e-b1fa-249fb8162341")
import java.util.Map;
import org.openmetadata.sdk.network.HttpMethod;
// client is an initialized OpenMetadataClient.
// Soft delete
client.containers().delete("14744329-85c2-499e-b1fa-249fb8162341");
// Hard delete
client.containers().delete("14744329-85c2-499e-b1fa-249fb8162341", Map.of("hardDelete", "true"));
// Delete by name
client.getHttpClient().execute(
HttpMethod.DELETE,
"/v1/containers/name/s3_datalake.analytics-bucket",
null,
Void.class
);
// Restore
client.containers().restore("14744329-85c2-499e-b1fa-249fb8162341");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/containers/14744329-85c2-499e-b1fa-249fb8162341" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/containers/14744329-85c2-499e-b1fa-249fb8162341?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/containers/name/s3_datalake.analytics-bucket" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted container
curl -X PUT "{base_url}/api/v1/containers/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "14744329-85c2-499e-b1fa-249fb8162341"}'
{
"id": "14744329-85c2-499e-b1fa-249fb8162341",
"name": "analytics-bucket",
"displayName": "Analytics Bucket",
"fullyQualifiedName": "s3_datalake.analytics-bucket",
"description": "Primary analytics data lake bucket",
"version": 0.2,
"updatedAt": 1769982673032,
"updatedBy": "admin",
"service": {
"id": "d1589e1d-2ab0-431c-a383-15e4be20a106",
"type": "storageService",
"name": "s3_datalake",
"fullyQualifiedName": "s3_datalake"
},
"serviceType": "S3",
"deleted": true,
"owners": [],
"tags": [],
"domains": []
}
Returns
Soft delete returns the container object withdeleted: true. Hard delete returns no content (204). Restore returns the restored container object.
Error Handling
| Code | Error Type | Description |
|---|---|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to delete this container |
404 | NOT_FOUND | Container with given ID or FQN does not exist |
Was this page helpful?