const url = '<base-url>/api/v1/threads/%7BthreadId%7D/message';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
body: JSON.stringify({text: 'string', delivery: 'queue', clientKey: 'string'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));