const url = 'https://api.sureshake.com/v2/directory/person/<slug>/composition';
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
blocks: [
{
blockType: 'header',
visibility: 'public',
order: 0,
config: {property1: null, property2: null}
}
],
layout: 'standard',
publish: false
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));