# ノートの更新

`PATCH /api/note/{noteId}`

URL: https://repsona.com/ja/api/patch-note-noteid

ノートのタイトルや本文などを更新します。

## パラメーター

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `noteId` | path | integer | 必須 | ノートの ID |

## リクエストボディ

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `name` | body | string |  | ノートのタイトル (1〜255 文字) |
| `parentId` | body | integer \| null |  | 移動先の親ノートの ID。`null` にすると最上位に移動します。 |
| `projectId` | body | integer |  | ノートの移動先のプロジェクトの ID |
| `description` | body | string \| null |  | ノートの本文 (Markdown、1,000,000 文字まで)。`null` にすると本文を空にします。 |
| `isWip` | body | boolean \| null |  | 作業中 (WIP) のノートかどうか |

## リクエスト

```sh
curl -X PATCH "https://<space>.repsona.com/api/note/{noteId}" \
  -H "Authorization: Bearer $REPSONA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Release checklist (v1)",
    "description": "## Before launch\n\n- Run the full regression suite\n- Confirm the redirect map with marketing\n- Announce the maintenance window\n- Back up the old site",
    "isWip": false
  }'
```

## レスポンス

- 200: Note updated
- 400: Invalid request payload or move state
- 401: Authentication is required
- 404: Note not found

## レスポンスの例

```json
{
  "note": {
    "id": 187,
    "parentId": null,
    "projectId": 288,
    "spaceId": 603,
    "name": "Release checklist (v1)",
    "sortOrder": null,
    "isWip": false,
    "createdAt": 1793662619233,
    "updatedAt": 1793662619266,
    "deletedAt": null,
    "tags": []
  },
  "siblings": []
}
```
