Qyra
ReferenceSQL runner

Create SQL chart

Create sql chart

POST/api/v1/projects/{projectUuid}/sqlRunner/saved

Authentication: personal access token. The spec defines an api_key security scheme — send an Authorization: ApiKey <your-personal-access-token> header (value format: ApiKey <your key>). A session_cookie scheme (connect.sid) exists for browser sessions. Operations in this spec declare security: [], an artifact of the upstream spec generator — authentication is still enforced by the server.

Path parameters

NameTypeRequiredDescription
projectUuidstringYesthe uuid for the project

Request body

{
  "slug": "string",
  "spaceUuid": "string",
  "config": {
    "type": "vertical_bar",
    "metadata": {
      "version": 0
    },
    "display": {
      "stack": true,
      "legend": {
        "align": "start",
        "position": "top"
      },
      "series": {
        "property": {
          "whichYAxis": 0,
          "valueLabelPosition": "hidden",
          "type": "line",
          "color": "string",
          "yAxisIndex": 0,
          "format": "km",
          "label": "string"
        }
      },
      "yAxis": [
        {
          "format": "km",
          "position": "string",
          "label": "string"
        }
      ],
      "xAxis": {
        "dateFormat": "string",
        "type": "time",
        "label": "string"
      }
    },
    "fieldConfig": {
      "stack": true,
      "sortBy": [
        {
          "pivotValues": [
            {
              "value": "string",
              "reference": "string"
            }
          ],
          "nullsFirst": true,
          "direction": "ASC",
          "reference": "string"
        }
      ],
      "groupBy": [
        {
          "reference": "string"
        }
      ],
      "y": [
        {
          "aggregation": "sum",
          "reference": "string"
        }
      ],
      "x": {
        "type": "time",
        "reference": "string"
      }
    }
  },
  "limit": 0,
  "sql": "string",
  "description": "string",
  "name": "string"
}

Responses

200 — Success

{
  "results": {
    "slug": "string",
    "savedSqlUuid": "string"
  },
  "status": "ok"
}

default — Error

{
  "error": {
    "data": "string",
    "message": "string",
    "name": "string",
    "statusCode": 0
  },
  "status": "error"
}