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));