const url = '<base-url>/api/v1/subagents/%7BsubagentId%7D/messages';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));