**版本：202201**

# 更新元字段定义

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

通过元字段定义 ID 更新现有元字段定义的详细信息。

## 请求

**Path参数**

- `id` string (required)

  待更新的元字段定义 ID。

**application/json**

**请求体 | 示例**

**请求体**

- `description` string

  Description of metafield definition
- `name` string

  Name of metafield definition

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

## 响应

**200 | 404 | 422**

200

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `id` string

  **示例：** `374034306256875562`
- `key` string

  **示例：** `key2`
- `name` string

  **示例：** `long`
- `namespace` string

  **示例：** `test`
- `owner_resource` string

  **示例：** `product`
- `type` string

  **示例：** `boolean`
- `description` string

  **示例：** `desc2`
- `create_at` string

  **示例：** `2024-04-28T03:18:59Z`
- `updated_at` string

  **示例：** `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**

**数据结构 | 示例 | Result**

**数据结构**

- `errors` string[]

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

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

422

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `errors` string[]

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

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