Is there any API service to generate(add) a Query on dashboard?

When I read documentation, I cannot find any API service that generates query such as Team or User. And then, I tried to explore that which API service is called while generating a query on UI dashboard. Then I realized that there is a service called as http://localhost:3000/api/tsdb/query and it takes
“rawSql”: “EXECUTE GetTemperature 2”,
“refId” : “A”
object as a parameter but I cannot understand “from” and “to” properties. Finally, when I execute it on postman, I cannot see the query which is expected as auto generated.

In other words, I would like to generate a query which is described on Picture with API call .

Picture :

Best Regards,

/api/tsdb/query is internal point to get data from datasources,
the parameter from and to, are the limits of time.

i think that you need to get all dashboard and update with a new query
on dashbord json, you can see a “targets” field, you need add a new target

“targets”: [
“alias”: “”,
“dimensions”: {},
“format”: “table”,
“hide”: false,
“metricName”: “”,
“namespace”: “”,
“period”: “”,
“rawSql”: “Select * from mytable”,
“refId”: “A”,
“region”: “default”,
“statistics”: [

1 Like

Thank you Daniel,

Your answer was exactly what I am looking for. “targets” fields solve my problem thank you again.

Best Regards,