Refresh session after datasource creation with API

I create datasources via API while I have an opened Grafana session in my browser.
After successfully creation, I don’t see datasource. I need to refresh the page and then all work fine.
There is a procedure to do this with API?
I tryed “Renew session based on remember cookie” (GET /api/login/ping) but arrived{‘message’: ‘Unauthorized’}.

Thanks so much.

I solved in my custom plugin code with this function:

import config from 'app/core/config';


refreshDatasourceSrv() {
  return this.backendSrv.get('/api/frontend/settings').then(settings => {
    config.datasources = settings.datasources;
    config.defaultDatasource = settings.defaultDatasource;

It would be nice to do it with a specific API request.

Best regards