const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: '<string>'})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/captain/tasks/flow_from_text', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));