---
title: "Delete Metadata Schema"
method: DELETE
path: "/management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}"
tags: ["Management"]
---

# Delete Metadata Schema

`DELETE /management/v1/projects/{projectId}/metadata-schemas/{metadataSchemaId}`

Deletes permanently the metadata schema.

In standard metadata schemas, this endpoint removes permanently all definitions. The standard metadata schemas are:
- Campaign
- Voucher
- Publication
- Redemption
- Product
- Customer
- Order
- Order line item
- Loyalty Tier
- Promotion Tier
- Earning rule
- Reward

If you want to delete only one definition, use the [Update Metadata Schema](/api-reference/management/update-metadata-schema) endpoint. In the request, provide the `"deleted": true` pair in the definition object. This definition will be moved to Removed definitions.

If you want to create a new standard metadata schema, use the [Create Metadata Schema](/api-reference/management/create-metadata-schema) endpoint.

> 🚧 Metadata Purging
>
>This endpoint deletes permanently the metadata schemas only. However, it does not purge the metadata from associated entities, so the metadata added to those entities will remain.
>
>If you want to purge metadata from the entities:
>1. Remove all the definitions you want to purge. You can do this either in Voucherify Project Settings > Metadata Schema tab or with the [Update Metadata Schema](/api-reference/management/update-metadata-schema) endpoint.
>2. In Voucherify Project Settings > Metadata Schema tab, go to the relevant metadata schema.
>3. In Removed definitions, click the bin button next to the definitions whose metadata you want to purge from entities.
>Note:
>- This is an asynchronous action. You will be notified when it has been completed.
>- You cannot purge metadata for the Redemption and Publication schemas.
>4. Use the Delete Metadata Schema request to delete the metadata schema from Voucherify.

> 📘 Metadata Documentation
>
> Read [the Getting Started with Metadata](/prepare/metadata) and [Metadata Mapping](/guides/metadata-mapping) articles to learn how metadata work in Voucherify.

## Response `204`

Returns no content if the metadata schema has been successfully deleted.

## Other responses

- `401` — Returns an error if an invalid token was provided.
- `402` — Returns an error if the current plan does not include the Management API feature.
- `404` — Returns an error when a resource could not be found.

---

[API](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions.md) · [All operations](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voucherifyio/voucherify-api-async-actions/revisions/4982266e0494/schema)
