# ログインユーザーの設定更新

`PATCH /api/me`

URL: https://repsona.com/ja/api/patch-me

プロフィール・言語・通知の設定を部分的に更新します。

## リクエストボディ

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `name` | body | string |  | ユーザー名 (@name) です。英数字と `.` `_` `-` の 3〜15 文字で、スペース内で重複しないものを指定します。 |
| `fullName` | body | string |  | 表示名です。255 文字までです。 |
| `whatAreYouDoing` | body | string |  | プロフィールに表示する、今していることの一言です。10,000 文字までです。 |
| `languageId` | body | integer |  | 表示言語の ID です。 |
| `timeZoneId` | body | integer |  | タイムゾーンの ID です。 |
| `emailNotification` | body | all \| mentions \| none |  | メールで通知する範囲です。`all` はすべて、`mentions` は自分へのメンションだけ、`none` は通知しません。 |
| `notificationSettings` | body | object |  | 通知の設定です。送ったキーだけが変わります。 |
| `wantsUpdateInformation` | body | boolean |  | サービスのお知らせをメールで受け取るかどうかです。 |
| `wantsReminderEmail` | body | boolean |  | リマインドをメールで受け取るかどうかです。 |
| `extra` | body | object |  | 表示の設定です。送ったキーだけが変わります。 |
| `timeZoneCode` | body | string |  | Asia/Tokyo のような IANA のタイムゾーン名です。`timeZoneId` と同じくタイムゾーンを設定しますが、名前で指定できます。 |

## リクエスト

```sh
curl -X PATCH "https://<space>.repsona.com/api/me" \
  -H "Authorization: Bearer $REPSONA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fullName": "Reon Walls",
    "whatAreYouDoing": "Preparing the beta release",
    "emailNotification": "mentions",
    "extra": {
      "dateFormat": "M/D",
      "firstDay": 1
    }
  }'
```

## レスポンス

- 200: Updated settings
- 400: Invalid request payload or name conflict
- 401: Authentication is required

## レスポンスの例

```json
{
  "id": 1126,
  "name": "reon",
  "fullName": "Reon Walls",
  "whatAreYouDoing": "Preparing the beta release",
  "avatarUrl": null,
  "backgroundUrl": null,
  "email": "reon.walls@example.com",
  "emailVerified": true,
  "changeRequestedEmail": null,
  "languageId": 1,
  "timeZoneId": 100,
  "emailNotification": "mentions",
  "notificationSettings": {
    "withoutUpdatesByMyself": true,
    "notifyTo": {
      "email": true,
      "browserPush": true,
      "mobilePush": true
    },
    "reminder": {
      "hurries": true,
      "starts": true,
      "ballHoldings": true,
      "responsibles": true
    }
  },
  "wantsUpdateInformation": true,
  "wantsReminderEmail": false,
  "twoFactorEnabled": false,
  "pushTokens": {
    "web": false,
    "mobile": false
  },
  "extra": {
    "dateFormat": "M/D",
    "firstDay": 1,
    "color": null,
    "autoTimeZone": true
  }
}
```
