> ## 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 a Storage Service

> Delete a storage service by ID or name, with soft/hard delete options

# Delete a Storage Service

Delete a storage service by ID or fully qualified name. Supports soft delete (default), hard delete, and restore operations.

## Delete by ID

**id** `string` *required*

UUID of the storage service to delete.

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

Recursively delete child entities (containers).

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

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

## Delete by Name

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

**fqn** `string` *required*

Fully qualified name of the storage service, for example `s3_datalake`.

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

Recursively delete child entities (containers).

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

Permanently delete the storage service.

## Restore a Soft-Deleted Storage Service

Use `PUT /v1/services/storageServices/restore` to restore a soft-deleted storage service.

**id** `string` *required*

UUID of the soft-deleted storage service to restore.

```python DELETE /v1/services/storageServices/{id} theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import StorageServices

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)

# Soft delete by ID
StorageServices.delete("d1589e1d-2ab0-431c-a383-15e4be20a106")

# Hard delete
StorageServices.delete(
    "d1589e1d-2ab0-431c-a383-15e4be20a106",
    hard_delete=True
)

# Delete by name
StorageServices.delete(StorageServices.retrieve_by_name("s3_datalake").id)

# Delete by name with options
StorageServices.delete(
    StorageServices.retrieve_by_name("s3_datalake").id,
    hard_delete=True,
    recursive=True
)

# Restore a soft-deleted storage service
StorageServices.restore("d1589e1d-2ab0-431c-a383-15e4be20a106")
```

```java DELETE /v1/services/storageServices/{id} theme={null}
import org.openmetadata.schema.entity.services.StorageService;
import org.openmetadata.sdk.fluent.StorageServices;

// client is an initialized OpenMetadataClient.

// Soft delete
StorageServices.delete("d1589e1d-2ab0-431c-a383-15e4be20a106").execute();

// Hard delete
StorageServices.delete("d1589e1d-2ab0-431c-a383-15e4be20a106")
    .hardDelete()
    .execute();

// Delete by name (look up the ID first)
StorageService service = StorageServices.retrieveByName("s3_datalake");
StorageServices.delete(service.getId()).execute();

// Restore. The fluent class has no restore method, so use the client service.
client.storageServices().restore("d1589e1d-2ab0-431c-a383-15e4be20a106");
```

```bash DELETE /v1/services/storageServices/{id} theme={null}
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/services/storageServices/d1589e1d-2ab0-431c-a383-15e4be20a106" \
  -H "Authorization: Bearer {access_token}"

# Hard delete
curl -X DELETE "{base_url}/api/v1/services/storageServices/d1589e1d-2ab0-431c-a383-15e4be20a106?hardDelete=true" \
  -H "Authorization: Bearer {access_token}"

# Delete by name
curl -X DELETE "{base_url}/api/v1/services/storageServices/name/s3_datalake" \
  -H "Authorization: Bearer {access_token}"

# Restore soft-deleted storage service
curl -X PUT "{base_url}/api/v1/services/storageServices/restore" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{"id": "d1589e1d-2ab0-431c-a383-15e4be20a106"}'
```

```json Response (Soft Delete) theme={null}
{
  "id": "d1589e1d-2ab0-431c-a383-15e4be20a106",
  "name": "s3_datalake",
  "fullyQualifiedName": "s3_datalake",
  "serviceType": "S3",
  "description": "Production S3 data lake for analytics",
  "connection": {
    "config": {
      "type": "S3",
      "awsConfig": {
        "enabled": false,
        "awsAccessKeyId": "AKIA...",
        "awsSecretAccessKey": "*********",
        "awsRegion": "us-east-1",
        "endPointURL": "https://s3.amazonaws.com/"
      }
    }
  },
  "version": 0.2,
  "updatedAt": 1769982621820,
  "updatedBy": "admin",
  "owners": [],
  "tags": [],
  "deleted": true,
  "domains": []
}
```

***

## Returns

Soft delete returns the storage service object with `deleted: true`. Hard delete returns no content (204). Restore returns the restored storage service object.

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to delete this storage service |
| `404` | `NOT_FOUND` | Storage service with given ID or FQN does not exist |


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