> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete an API Endpoint

> Delete an API endpoint by ID or name, with soft/hard delete options

# 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

**id** `string` *required*

UUID of the API endpoint to delete.

**recursive** `boolean` (default: false)

Recursively delete child entities.

**hardDelete** `boolean` (default: false)

Permanently delete the API endpoint. If `false`, the API endpoint is soft-deleted and can be restored.

## Delete by Name

Use `DELETE /v1/apiEndpoints/name/{fqn}` to delete by fully qualified name.

**fqn** `string` *required*

Fully qualified name of the API endpoint, for example `sample_api_service.pet.addPet`.

**recursive** `boolean` (default: false)

Recursively delete child entities.

**hardDelete** `boolean` (default: false)

Permanently delete the API endpoint.

## Restore a Soft-Deleted API Endpoint

Use `PUT /v1/apiEndpoints/restore` to restore a soft-deleted API endpoint.

**id** `string` *required*

UUID of the soft-deleted API endpoint to restore.

```python DELETE /v1/apiEndpoints/{id} theme={null}
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")
```

```java DELETE /v1/apiEndpoints/{id} theme={null}
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");
```

```bash DELETE /v1/apiEndpoints/{id} theme={null}
# 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"}'
```

```json Response (Soft Delete) theme={null}
{
  "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 with `deleted: 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 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.