const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
prompt: '<string>',
schedule: {kind: 'every', everyMs: 123, anchorMs: 0},
description: '<string>',
enabled: true,
deleteAfterRun: true,
target: 'chat_turn'
})
};
fetch('https://www.dench.com/api/v1/routines/{jobId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));