# プロジェクトの更新

`PATCH /api/project/{projectId}`

URL: https://repsona.com/ja/api/patch-project-projectid

プロジェクトの名前・目的・公開設定・休日の設定を更新します。管理者で、かつプロジェクトのメンバーである場合だけ使えます。

## パラメーター

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `projectId` | path | integer | 必須 | プロジェクトの ID です。 |

## リクエストボディ

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `name` | body | string |  | プロジェクトのキーです。英数字と `_` `-` `.` で 3〜30 文字、スペース内で重複できません。 |
| `fullName` | body | string |  | プロジェクトの表示名です (255 文字まで)。 |
| `purpose` | body | string |  | プロジェクトの目的・説明です (10,000 文字まで)。 |
| `isPublic` | body | boolean |  | ログインしていない人でも、公開 URL からタスクの一覧を見られるようにするかどうかです。メンバーの名前とアイコンも公開されます。 |
| `holidays` | body | object[] |  | プロジェクト独自の休日です (366 件まで)。いまの一覧を置き換えます。 |
| `regularHolidays` | body | integer[] |  | 毎週休みにする曜日です (0 が日曜、6 が土曜)。いまの設定を置き換えます。新しいプロジェクトは `[0, 6]` です。 |
| `avatarUrl` | body | null |  | `null` を渡すとプロジェクトのアイコンを外します。 |
| `backgroundUrl` | body | null |  | `null` を渡すとプロジェクトの背景画像を外します。 |
| `productImageUrl` | body | null |  | `null` を渡すとプロジェクトのプロダクト画像を外します。 |

## リクエスト

```sh
curl -X PATCH "https://<space>.repsona.com/api/project/{projectId}" \
  -H "Authorization: Bearer $REPSONA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fullName": "Website renewal",
    "purpose": "Rebuild the marketing site with a new design and faster pages.",
    "isPublic": false,
    "holidays": [
      {
        "name": "Summer break",
        "start": "2026-08-10",
        "end": "2026-08-14"
      }
    ],
    "regularHolidays": [
      0,
      6
    ]
  }'
```

## レスポンス

- 200: Updated project detail
- 400: Validation error or project name already exists
- 401: Authentication is required
- 403: Admin only
- 404: Project not found

## レスポンスの例

```json
{
  "id": 253,
  "name": "WEB",
  "fullName": "Website renewal",
  "purpose": "Rebuild the marketing site with a new design and faster pages.",
  "avatarUrl": "",
  "backgroundUrl": "",
  "productImageUrl": "",
  "isClosed": false,
  "isPublic": false,
  "free": true,
  "holidays": [
    {
      "name": "Summer break",
      "start": "2026-08-10",
      "end": "2026-08-14"
    }
  ],
  "regularHolidays": [
    0,
    6
  ],
  "members": [
    {
      "id": 987,
      "name": "sam.carter",
      "fullName": "Sam Carter",
      "avatarUrl": null,
      "color": null,
      "state": "active"
    },
    {
      "id": 988,
      "name": "reon.walls",
      "fullName": "Reon Walls",
      "avatarUrl": null,
      "color": null,
      "state": "active"
    }
  ],
  "hasTask": false
}
```
