const url = 'https://api.hostedez.com/v1/sites/string/redirects';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'__Secure-better-auth.session_token': '<value>'
},
body: JSON.stringify({
enabled: true,
matchType: 'exact',
preserveQuery: true,
sourcePath: 'string',
statusCode: 301,
targetUrl: 'string'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));