**Version: 202201**

# Update Metafield Definition

**PUT** `/openapi/2022-01/metafield_definition/:id`

Update an existing metafield definition.

## Request

**Path Parameters**

- `id` string (required)

**application/json**

**Body | Example**

**Body**

- `description` string

  Description of metafield definition
- `name` string

  Name of metafield definition

```json
{
  "description": "string",
  "name": "string"
}
```

## Responses

**200 | 404 | 422**

200

**application/json**

**Schema | Example | Result**

**Schema**

- `id` string

  **Example:** `374034306256875562`
- `key` string

  **Example:** `key2`
- `name` string

  **Example:** `long`
- `namespace` string

  **Example:** `test`
- `owner_resource` string

  **Example:** `product`
- `type` string

  **Example:** `boolean`
- `description` string

  **Example:** `desc2`
- `create_at` string

  **Example:** `2024-04-28T03:18:59Z`
- `updated_at` string

  **Example:** `2024-04-28T03:42:42Z`

```json
{
  "id": "374034306256875562",
  "key": "key2",
  "name": "long",
  "namespace": "test",
  "owner_resource": "product",
  "type": "boolean",
  "description": "desc2",
  "create_at": "2024-04-28T03:18:59Z",
  "updated_at": "2024-04-28T03:42:42Z"
}
```

```json
{
  "id": "374034306256875562",
  "key": "key2",
  "name": "long",
  "namespace": "test",
  "owner_resource": "product",
  "type": "boolean",
  "description": "desc2",
  "create_at": "2024-04-28T03:18:59Z",
  "updated_at": "2024-04-28T03:42:42Z"
}
```

404

**application/json**

**Schema | Example | Result**

**Schema**

- `errors` string[]

```json
{
  "errors": [
    "No metafield definition found"
  ]
}
```

```json
{
  "errors": [
    "No metafield definition found"
  ]
}
```

422

**application/json**

**Schema | Example | Result**

**Schema**

- `errors` string[]

```json
{
  "errors": [
    ""
  ]
}
```

```json
{
  "errors": [
    ""
  ]
}
```
