# タグの更新

`PATCH /api/tag/{tagId}`

URL: https://repsona.com/ja/api/patch-tag-tagid

タグの名前や色を更新します。

## パラメーター

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `tagId` | path | integer | 必須 | タグの ID です。 |

## リクエストボディ

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `name` | body | string |  | タグの名前です (1〜255 文字)。スペース内で重複できません。 |
| `type` | body | tag \| reaction \| null |  | タグの用途です。`tag` はタスクやノートに付けるラベル、`reaction` はコメントへのリアクションに使います。`null` は指定なしです。省略すると変更しません。 |
| `color` | body | string \| null |  | 色です (`#3b82f6` のような 16 進数のカラーコード、20 文字まで)。省略すると変更しません。 |

## リクエスト

```sh
curl -X PATCH "https://<space>.repsona.com/api/tag/{tagId}" \
  -H "Authorization: Bearer $REPSONA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Bug",
    "color": "#dc2626"
  }'
```

## レスポンス

- 200: Updated
- 401: Authentication is required
- 404: Tag not found

## レスポンスの例

```json
{
  "ok": true
}
```
