Depending on your usecase, you may be able to write/extend the JavaScript Code. During my research I did not find a built-in way to perform redirects with the website frontend Odoo JSON API (using JavaScript _rpc requests). Finally, I used a similar approach as you can see in
\https://github.com/odoo/odoo/blob/14.0/addons/portal/static/src/js/portal_signature.js#L128
this._rpc({
...
}).then(function(data) {
if (data.force_refresh) {
if (data.redirect_url) {
window.location = data.redirect_url;
} else {
\window.location.reload();
}
// to avoid triggering chained .then callbacks
return Promise.reject();
}
...
})
where the route returns a dict à la
return {
'force_refresh': True,
'redirect_url': ...,
)
For the sake of completeness: in the admin backend there is a build-in way, return a URL action
return {
'type': 'ir.actions.act_url',
'url': url,
'target': 'self',
}