v106

OpenAPI 3.1.0raw.githubusercontent.com2026-08-02160524464.6 KB
Insights

Create Saved Query

Saves a new named SQL query for later reuse.

post/api/v1/insights/queries

Request body

namestring required

Human-readable query name.

sqlstring required

SQL query text.

Example request

{
  "name": "Run duration by workflow",
  "sql": "SELECT workflow_name, AVG(duration_seconds) FROM runs GROUP BY 1"
}

Response

Query saved

idstring required

Unique query identifier.

namestring required

Human-readable query name.

sqlstring required

SQL query text.

created_atstring date-time required

Timestamp when the query was saved.

updated_atstring date-time required

Timestamp when the query was last modified.

Example response

{
  "id": "1",
  "name": "Run duration by workflow",
  "sql": "SELECT workflow_name, AVG(duration_seconds) FROM runs GROUP BY 1",
  "created_at": "2026-03-01T10:00:00Z",
  "updated_at": "2026-03-05T14:30:00Z"
}