SQL Queries
Get SQL Query
Changed onFetch one saved query by id. A saved query that belongs to another profile is invisible (404, never 403).
get/sql/{sqlID}
Request
- Base URLhttps://api.us-e1.tago.io
- AuthAPI key in header Profile-Token
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Response
The saved query.
Example response
{
"status": true,
"result": {
"id": "6a1b2c3d4e5f6a1b2c3d4e5f",
"name": "hot sensors",
"description": "temperatures above a threshold",
"query": "SELECT variable, value, time FROM device('DEVICE_ID') AS d WHERE value > $1 ORDER BY time DESC LIMIT 100",
"params": [
{
"key": "$1",
"value": "30"
}
],
"cache_enabled": true,
"cache_ttl_seconds": 60,
"rate_limit_rpm": 30,
"active": true,
"version": 1,
"cache_version": 1,
"created_at": "2026-07-06T12:00:00+00:00",
"updated_at": "2026-07-06T12:00:00+00:00"
}
}Changes
- info
endpoint added
- info