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