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

# Delete Metafield

> Permanently delete a metafield by id

# Delete Metafield

Permanently deletes a metafield owned by **your app**. Apps cannot delete
metafields written by other apps or by merchants. The action cannot be
undone.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.launchmystore.io/api/v1/metafields/<metafieldId>.json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(`https://api.launchmystore.io/api/v1/metafields/${id}.json`, {
    method: 'DELETE',
    headers: { Authorization: `Bearer ${accessToken}` },
  });
  ```
</CodeGroup>

## Required scope

`write_metafields`

## Path parameters

<ParamField path="id" type="string" required>
  The metafield's UUID (the `id` field from list/create responses).
</ParamField>

## Response

```json theme={null}
{
  "status": 200,
  "state": "success",
  "message": "Metafield deleted successfully"
}
```

## Cache invalidation

Deletion automatically expires the storefront caches for the owning
resource. The next render will not include the deleted field — Aqua/Liquid
access (`{{ owner.metafields.namespace.key }}`) returns an empty drop, no
error thrown.

## Notes

* Themes that read this metafield will see an empty drop on the next
  render. `{{ … }}` renders empty string; `{% if … %}` is falsy. No
  exceptions thrown.
* If the merchant or another app also writes a metafield with the same
  `(ownerType, namespace, key, ownerId)`, that one is **not** affected —
  rows are scoped per `appId`.

## Error codes

| Code           | Description                                             |
| -------------- | ------------------------------------------------------- |
| `UNAUTHORIZED` | Invalid or missing access token                         |
| `FORBIDDEN`    | App doesn't have `write_metafields` scope               |
| `NOT_FOUND`    | Metafield does not exist, or wasn't written by your app |
