---
title: "Replace notification event/channel preferences"
---

> Documentation Index
> Fetch the complete documentation index at: https://tryshiba.dev/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Shiba public API › notifications

`PUT /notifications/preferences`

## Authentication

Requires one of the following:

- `bearerAuth`, http, header `Authorization`, format `API key`
- `cookieAuth`, apiKey, in cookie

## Request body

_Required._

- `events` (`putNotificationPreferences.events`; map<boolean>, optional)
  - default `{}`
- `channels` (`putNotificationPreferences.channels`; map<boolean>, optional)
  - default `{}`

## Example request

```json
{
  "events": {},
  "channels": {}
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url '<base-url>/api/v1/notifications/preferences' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "events": {},
  "channels": {}
}
'
```

### TypeScript

```typescript
const url = '<base-url>/api/v1/notifications/preferences';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({events: {}, channels: {}})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/api/v1/notifications/preferences"

payload = {
    "events": {},
    "channels": {}
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Success

#### Example

```json
{
  "events": {},
  "channels": {}
}
```

- `events` (`putNotificationPreferences.response.200.events`; map<boolean>, optional)
  - default `{}`
- `channels` (`putNotificationPreferences.response.200.channels`; map<boolean>, optional)
  - default `{}`

### 401

Unauthorized

#### Example

```json
{
  "ok": false,
  "error": "string",
  "detail": "string",
  "code": "string"
}
```

- `error` (`putNotificationPreferences.response.401.error`; string, required)
- `ok` (`putNotificationPreferences.response.401.ok`; boolean, optional)
- `detail` (`putNotificationPreferences.response.401.detail`; string, optional)
- `code` (`putNotificationPreferences.response.401.code`; string, optional)


Source: https://tryshiba.dev/reference/api/notifications/putNotificationPreferences/index.md
