
## Delete custom metadata

URL: https://docs.atlan.com/product/capabilities/build-apps/sdks/python/custom-metadata/how-tos/delete-custom-metadata

> Remove custom metadata structure definitions from Atlan using the Python SDK — note that deleted structures still count against the ~1000 tenant-wide property limit.

# CustomMetadataDef: delete custom metadata type definitions

Use `CustomMetadataDef` in the Atlan Python SDK to programmatically delete custom metadata type definitions and their attributes.

:::warning[There are limits to the number of custom metadata properties you can create]
Atlan currently preserves details of custom metadata in its audit log. This allows Atlan to retain an audit trail of actions users took on custom metadata on each asset, even if the custom metadata definition itself is deleted.

However, this also places an upper limit on the number of custom metadata properties you can create in Atlan. Even if you delete the custom metadata definitions, any that you have previously defined will still take up "space" within this limit.

> *More details — see full content on the documentation site.*

:::
To delete a custom metadata structure:

### Java

```java showLineNumbers title="Delete custom metadata structure"
CustomMetadataDef.purge(client, "RACI"); // (1)
```

1. You only need to call the `CustomMetadataDef.purge()` method with the human-readable name of the custom metadata structure, and it will be deleted. Because this operation will remove the structure from Atlan, you must [provide it an `AtlanClient`](https://docs.atlan.com/llms/platform/python/set-up-sdk/llms.txt) through which to connect to the tenant.

### Python

```python showLineNumbers title="Delete custom metadata structure"
from pyatlan.model.typedef import CustomMetadataDef
from pyatlan.client.atlan import AtlanClient

client = AtlanClient()
response = client.typedef.purge("RACI", CustomMetadataDef) # (1)
```

1. You only need to call the `typedef.purge()` method with the human-readable name of the custom metadata structure, and it will be deleted.

### Kotlin

```kotlin showLineNumbers title="Delete custom metadata structure"
CustomMetadataDef.purge(client, "RACI") // (1)
```

1. You only need to call the `CustomMetadataDef.purge()` method with the human-readable name of the custom metadata structure, and it will be deleted. Because this operation will remove the structure from Atlan, you must [provide it an `AtlanClient`](https://docs.atlan.com/llms/platform/python/set-up-sdk/llms.txt) through which to connect to the tenant.

### Raw REST API

```json showLineNumbers title="DELETE /api/meta/types/typedef/name/MNJ8mpLsIOaP4OQnLNhRta"
```

:::warning[Use the hashed-string representation]
When deleting the custom metadata structure using the raw API, you must use the hashed-string representation of its name in the API call.
:::

---
