const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
deployment_request: {
requests: [
{
branch_id: 'agtbrch_8901k4t9z5defmb8vh3e9361y7nj',
deployment_strategy: {traffic_percentage: 0.5, type: 'percentage'}
}
]
}
})
};
fetch('https://api.threetone.in/v1/convai/agents/{agent_id}/deployments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));