# Update a tag

Modify the name of the tag in different languages.

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/im/v2/tags/:tag_id
HTTP Method | PATCH
Rate Limit | [5 per second](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App、Store App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | Update tag information(im:tag:write)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `tenant_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

### Path parameters

Parameter | Type | Description
---|---|---
tag_id | string | **Example value**: "716168xxxxx"

### Request body

Parameter | Type | Required | Description
---|---|---|---
patch_tag | patch_tag | No | Patch a tag
id | string | No | Tag ID<br>**Example value**: "716168xxxxx"
name | string | No | Tag name<br>**Example value**: "tag name"
i18n_names | tag_i18n_name\[\] | No | Tag name in various languages<br>**Data validation rules**:<br>- Length range: `0` ～ `40`
locale | string | Yes | Language<br>**Example value**: "en_us"
name | string | No | Name<br>**Example value**: "tagName1"

### Request body example
```json
{
    "patch_tag": {
        "id": "716168xxxxx",
        "name": "tag name",
        "i18n_names": [
            {
                "locale": "en_us",
                "name": "tagName1"
            }
        ]
    }
}
```

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-
tag_info | tag_info | Tag's information
id | string | Tag ID
tag_type | string | Tag type
name | string | Tag's default name
i18n_names | tag_i18n_name\[\] | Tag name in various languages
locale | string | Language
name | string | name
create_time | string | Create time
update_time | string | Update time
patch_tag_fail_reason | patch_tag_fail_reason | Fail reason
duplicate_id | string | Duplicated id of tag

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "tag_info": {
            "id": "716168xxxxx",
            "tag_type": "tenant",
            "name": "tagName1",
            "i18n_names": [
                {
                    "locale": "en_us",
                    "name": "tagName1"
                }
            ],
            "create_time": "1700793403850",
            "update_time": "1700793403850"
        },
        "patch_tag_fail_reason": {
            "duplicate_id": "716168xxxxx"
        }
    }
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 230001 | param is invalid | Parameter error, please re-enter according to the error information returned by the interface or the content of the document.

