SQL Queries

List SQL Queries

Changed on

List your saved queries. Returns { status, result: [...] } following the house list-endpoint standard; there is no total key. Page by requesting successive page values until a short page is returned.

get/sql

Request

Query parameters

fieldsstring
Example:id,name,tags

Columns to project, repeated (fields[]=id&fields[]=name) or comma-joined (fields=id,name). Allowlisted to id, name, tags, active, created_at, updated_at. Any other field is a 400; the remaining row fields, including query, params, and the derived session_context, are returned by GET /sql/{sqlID}. Default ["id","name","tags"].

filter[name]string
Example:hot

Case-insensitive substring match on name.

filter[active]boolean
Example:true

Boolean (true/1 vs anything else).

filter[tags][0][key]string
Example:kind

Tag match key (paired with the value; applied as a jsonb containment).

filter[tags][0][value]string
Example:report

Tag match value (paired with the key).

orderBystring
Example:name,asc

Column + direction: orderBy=name,asc. Column allowlisted to name / updated_at / created_at; anything else falls back to created_at. A bare list defaults to created_at descending.

amountinteger
Example:20

Default 20, clamped 1..=100.

pageinteger
Example:1

1-based, floor 1.

Response

List of your saved queries (projected to the requested fields).

statusboolean

Example response

{
  "status": true,
  "result": [
    {
      "id": "6a1b2c3d4e5f6a1b2c3d4e5f",
      "name": "hot sensors",
      "active": true
    }
  ]
}

Changes