> ## 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.

# Update Metafield Definition

> Update an existing metafield definition. Admin API only.

# Update Metafield Definition

<Warning>
  Admin API only — requires a merchant JWT. Not exposed to OAuth apps.
</Warning>

Updates label, description, validations, or pinned state of an existing
definition. **`namespace`, `key`, `ownerType`, and `type` are immutable** —
delete and recreate if you need to change them.

## Request

```bash theme={null}
curl -X PUT "https://api.launchmystore.io/metafield-definitions/<id>" \
  -H "Authorization: Bearer <merchant-jwt>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Warranty period (years)",
    "validations": { "min": 0, "max": 50 },
    "pinned": true
  }'
```

## Path parameters

<ParamField path="id" type="string" required>
  The definition UUID.
</ParamField>

## Body parameters (all optional)

<ParamField body="name" type="string">Human label.</ParamField>
<ParamField body="description" type="string">Tooltip / helper text.</ParamField>

<ParamField body="validations" type="object">
  Replace the entire validations object. Existing values that fail the new
  rules are **not** retroactively rejected — they continue to exist but
  future writes must comply.
</ParamField>

<ParamField body="pinned" type="boolean">Pin / unpin from the resource detail page.</ParamField>

## Response

Same shape as
[Get definition](/api-reference/metafields/definitions/get).

## Error codes

| Code               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| `UNAUTHORIZED`     | Invalid or missing JWT                                  |
| `FORBIDDEN`        | Wrong store / insufficient role                         |
| `NOT_FOUND`        | Definition does not exist                               |
| `VALIDATION_ERROR` | Validation rule incompatible with the definition's type |
