DELETE /v1/apiCollections/{id}
from metadata.sdk import configure
from metadata.sdk.entities import APICollections
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
APICollections.delete("0f7ee81c-8163-4097-8adb-45c3d6c7b14b")
# Hard delete
APICollections.delete(
"0f7ee81c-8163-4097-8adb-45c3d6c7b14b",
hard_delete=True
)
# Delete by name (look up the ID first)
entity = APICollections.retrieve_by_name("sample_api_service.pet")
APICollections.delete(entity.id)
# Delete by name with options
entity = APICollections.retrieve_by_name("sample_api_service.pet")
APICollections.delete(entity.id, hard_delete=True)
# Restore a soft-deleted API collection
APICollections.restore("0f7ee81c-8163-4097-8adb-45c3d6c7b14b")
import java.util.Map;
import org.openmetadata.sdk.network.HttpMethod;
// client is an initialized OpenMetadataClient.
// Soft delete
client.apiCollections().delete("0f7ee81c-8163-4097-8adb-45c3d6c7b14b");
// Hard delete
client.apiCollections().delete("0f7ee81c-8163-4097-8adb-45c3d6c7b14b", Map.of("hardDelete", "true"));
// Delete by name
client.getHttpClient().execute(
HttpMethod.DELETE,
"/v1/apiCollections/name/sample_api_service.pet",
null,
Void.class
);
// Restore
client.apiCollections().restore("0f7ee81c-8163-4097-8adb-45c3d6c7b14b");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/apiCollections/0f7ee81c-8163-4097-8adb-45c3d6c7b14b" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/apiCollections/0f7ee81c-8163-4097-8adb-45c3d6c7b14b?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/apiCollections/name/sample_api_service.pet" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted API collection
curl -X PUT "{base_url}/api/v1/apiCollections/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "0f7ee81c-8163-4097-8adb-45c3d6c7b14b"}'
{
"id": "0f7ee81c-8163-4097-8adb-45c3d6c7b14b",
"name": "pet",
"fullyQualifiedName": "sample_api_service.pet",
"version": 0.2,
"updatedAt": 1769982733673,
"updatedBy": "admin",
"endpointURL": "https://petstore3.swagger.io/#/pet",
"service": {
"id": "58d413a8-abc3-4a6d-bd8a-13a0234b1ff8",
"type": "apiService",
"name": "sample_api_service",
"fullyQualifiedName": "sample_api_service"
},
"serviceType": "Rest",
"deleted": true,
"owners": [],
"tags": [],
"domains": []
}
Delete an API Collection
Delete an API collection by ID or name, with soft/hard delete options
DELETE
/
v1
/
apiCollections
/
{id}
DELETE /v1/apiCollections/{id}
from metadata.sdk import configure
from metadata.sdk.entities import APICollections
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
APICollections.delete("0f7ee81c-8163-4097-8adb-45c3d6c7b14b")
# Hard delete
APICollections.delete(
"0f7ee81c-8163-4097-8adb-45c3d6c7b14b",
hard_delete=True
)
# Delete by name (look up the ID first)
entity = APICollections.retrieve_by_name("sample_api_service.pet")
APICollections.delete(entity.id)
# Delete by name with options
entity = APICollections.retrieve_by_name("sample_api_service.pet")
APICollections.delete(entity.id, hard_delete=True)
# Restore a soft-deleted API collection
APICollections.restore("0f7ee81c-8163-4097-8adb-45c3d6c7b14b")
import java.util.Map;
import org.openmetadata.sdk.network.HttpMethod;
// client is an initialized OpenMetadataClient.
// Soft delete
client.apiCollections().delete("0f7ee81c-8163-4097-8adb-45c3d6c7b14b");
// Hard delete
client.apiCollections().delete("0f7ee81c-8163-4097-8adb-45c3d6c7b14b", Map.of("hardDelete", "true"));
// Delete by name
client.getHttpClient().execute(
HttpMethod.DELETE,
"/v1/apiCollections/name/sample_api_service.pet",
null,
Void.class
);
// Restore
client.apiCollections().restore("0f7ee81c-8163-4097-8adb-45c3d6c7b14b");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/apiCollections/0f7ee81c-8163-4097-8adb-45c3d6c7b14b" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/apiCollections/0f7ee81c-8163-4097-8adb-45c3d6c7b14b?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/apiCollections/name/sample_api_service.pet" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted API collection
curl -X PUT "{base_url}/api/v1/apiCollections/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "0f7ee81c-8163-4097-8adb-45c3d6c7b14b"}'
{
"id": "0f7ee81c-8163-4097-8adb-45c3d6c7b14b",
"name": "pet",
"fullyQualifiedName": "sample_api_service.pet",
"version": 0.2,
"updatedAt": 1769982733673,
"updatedBy": "admin",
"endpointURL": "https://petstore3.swagger.io/#/pet",
"service": {
"id": "58d413a8-abc3-4a6d-bd8a-13a0234b1ff8",
"type": "apiService",
"name": "sample_api_service",
"fullyQualifiedName": "sample_api_service"
},
"serviceType": "Rest",
"deleted": true,
"owners": [],
"tags": [],
"domains": []
}
Delete an API Collection
Delete an API collection by ID or fully qualified name. Supports soft delete (default), hard delete, and restore operations.Delete by ID
string
required
UUID of the API collection to delete.
boolean
default:"false"
Recursively delete child entities (API endpoints).
boolean
default:"false"
Permanently delete the API collection. If
false, the API collection is soft-deleted and can be restored.Delete by Name
UseDELETE /v1/apiCollections/name/{fqn} to delete by fully qualified name.
string
required
Fully qualified name of the API collection, for example
sample_api_service.pet.boolean
default:"false"
Recursively delete child entities (API endpoints).
boolean
default:"false"
Permanently delete the API collection.
Restore a Soft-Deleted API Collection
UsePUT /v1/apiCollections/restore to restore a soft-deleted API collection.
string
required
UUID of the soft-deleted API collection to restore.
DELETE /v1/apiCollections/{id}
from metadata.sdk import configure
from metadata.sdk.entities import APICollections
configure(
host="https://your-company.open-metadata.org/api",
jwt_token="your-jwt-token"
)
# Soft delete by ID
APICollections.delete("0f7ee81c-8163-4097-8adb-45c3d6c7b14b")
# Hard delete
APICollections.delete(
"0f7ee81c-8163-4097-8adb-45c3d6c7b14b",
hard_delete=True
)
# Delete by name (look up the ID first)
entity = APICollections.retrieve_by_name("sample_api_service.pet")
APICollections.delete(entity.id)
# Delete by name with options
entity = APICollections.retrieve_by_name("sample_api_service.pet")
APICollections.delete(entity.id, hard_delete=True)
# Restore a soft-deleted API collection
APICollections.restore("0f7ee81c-8163-4097-8adb-45c3d6c7b14b")
import java.util.Map;
import org.openmetadata.sdk.network.HttpMethod;
// client is an initialized OpenMetadataClient.
// Soft delete
client.apiCollections().delete("0f7ee81c-8163-4097-8adb-45c3d6c7b14b");
// Hard delete
client.apiCollections().delete("0f7ee81c-8163-4097-8adb-45c3d6c7b14b", Map.of("hardDelete", "true"));
// Delete by name
client.getHttpClient().execute(
HttpMethod.DELETE,
"/v1/apiCollections/name/sample_api_service.pet",
null,
Void.class
);
// Restore
client.apiCollections().restore("0f7ee81c-8163-4097-8adb-45c3d6c7b14b");
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/apiCollections/0f7ee81c-8163-4097-8adb-45c3d6c7b14b" \
-H "Authorization: Bearer {access_token}"
# Hard delete
curl -X DELETE "{base_url}/api/v1/apiCollections/0f7ee81c-8163-4097-8adb-45c3d6c7b14b?hardDelete=true" \
-H "Authorization: Bearer {access_token}"
# Delete by name
curl -X DELETE "{base_url}/api/v1/apiCollections/name/sample_api_service.pet" \
-H "Authorization: Bearer {access_token}"
# Restore soft-deleted API collection
curl -X PUT "{base_url}/api/v1/apiCollections/restore" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"id": "0f7ee81c-8163-4097-8adb-45c3d6c7b14b"}'
{
"id": "0f7ee81c-8163-4097-8adb-45c3d6c7b14b",
"name": "pet",
"fullyQualifiedName": "sample_api_service.pet",
"version": 0.2,
"updatedAt": 1769982733673,
"updatedBy": "admin",
"endpointURL": "https://petstore3.swagger.io/#/pet",
"service": {
"id": "58d413a8-abc3-4a6d-bd8a-13a0234b1ff8",
"type": "apiService",
"name": "sample_api_service",
"fullyQualifiedName": "sample_api_service"
},
"serviceType": "Rest",
"deleted": true,
"owners": [],
"tags": [],
"domains": []
}
Returns
Soft delete returns the API collection object withdeleted: true. Hard delete returns no content (204). Restore returns the restored API collection object.
Error Handling
| Code | Error Type | Description |
|---|---|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to delete this API collection |
404 | NOT_FOUND | API collection with given ID or FQN does not exist |
Was this page helpful?