# Update my notification settings

`PUT /api/v1/users/me/notification-settings`

Authentication (security requirement alternatives):

```json
[
  {
    "OAuth2": []
  }
]
```

- OAuth2: oauth2. Authenticating via OAuth requires the following steps:
- Have an activated account
- [Generate] an access token for that account at `/api/v1/users/token`.
- Make requests with the *Authorization: Bearer <token\>* header
- Profit, depending on the role assigned to the account

Note that the __access token is valid for 1 day__ and is given
along with a __refresh token valid for 2 weeks__.

[Generate]: https://docs.joinpeertube.org/api/rest-getting-started


Request body: application/json

Type: UserNotificationSettings

Schema: [UserNotificationSettings](https://sourcey-peertube.pages.dev/api-rest-reference/models/usernotificationsettings.md)

- `abuseAsModerator` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `videoAutoBlacklistAsModerator` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `newUserRegistration` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `newVideoFromSubscription` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `blacklistOnMyVideo` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `myVideoPublished` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `myVideoImportFinished` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `commentMention` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `newCommentOnMyVideo` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `newFollow` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `newInstanceFollower` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `autoInstanceFollowing` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `abuseStateChange` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `abuseNewMessage` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `newPeerTubeVersion` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `newPluginVersion` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `myVideoStudioEditionFinished` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

- `myVideoTranscriptionGenerated` (optional)
  Reference: [NotificationSettingValue](https://sourcey-peertube.pages.dev/api-rest-reference/models/notificationsettingvalue.md); Type: NotificationSettingValue
  
  Notification type. One of the following values, or a sum of multiple values:
  - `0` NONE
  - `1` WEB
  - `2` EMAIL
  

Responses:

- 204: successful operation

## Examples

### cURL

```bash
curl -X PUT 'https://peertube2.cpy.re/api/v1/users/me/notification-settings' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "abuseAsModerator": 0,
  "videoAutoBlacklistAsModerator": 0,
  "newUserRegistration": 0,
  "newVideoFromSubscription": 0,
  "blacklistOnMyVideo": 0,
  "myVideoPublished": 0,
  "myVideoImportFinished": 0,
  "commentMention": 0,
  "newCommentOnMyVideo": 0,
  "newFollow": 0,
  "newInstanceFollower": 0,
  "autoInstanceFollowing": 0,
  "abuseStateChange": 0,
  "abuseNewMessage": 0,
  "newPeerTubeVersion": 0,
  "newPluginVersion": 0,
  "myVideoStudioEditionFinished": 0,
  "myVideoTranscriptionGenerated": 0
}'
```

### JavaScript

```javascript
const body = `{
  "abuseAsModerator": 0,
  "videoAutoBlacklistAsModerator": 0,
  "newUserRegistration": 0,
  "newVideoFromSubscription": 0,
  "blacklistOnMyVideo": 0,
  "myVideoPublished": 0,
  "myVideoImportFinished": 0,
  "commentMention": 0,
  "newCommentOnMyVideo": 0,
  "newFollow": 0,
  "newInstanceFollower": 0,
  "autoInstanceFollowing": 0,
  "abuseStateChange": 0,
  "abuseNewMessage": 0,
  "newPeerTubeVersion": 0,
  "newPluginVersion": 0,
  "myVideoStudioEditionFinished": 0,
  "myVideoTranscriptionGenerated": 0
}`;

const response = await fetch('https://peertube2.cpy.re/api/v1/users/me/notification-settings', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "abuseAsModerator": 0,
  "videoAutoBlacklistAsModerator": 0,
  "newUserRegistration": 0,
  "newVideoFromSubscription": 0,
  "blacklistOnMyVideo": 0,
  "myVideoPublished": 0,
  "myVideoImportFinished": 0,
  "commentMention": 0,
  "newCommentOnMyVideo": 0,
  "newFollow": 0,
  "newInstanceFollower": 0,
  "autoInstanceFollowing": 0,
  "abuseStateChange": 0,
  "abuseNewMessage": 0,
  "newPeerTubeVersion": 0,
  "newPluginVersion": 0,
  "myVideoStudioEditionFinished": 0,
  "myVideoTranscriptionGenerated": 0
}'''

response = requests.put(
    'https://peertube2.cpy.re/api/v1/users/me/notification-settings',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
