Qyra
ReferenceProjects

Get SQL charts as code

Gets SQL charts in code representation

GET/api/v1/projects/{projectUuid}/code/sqlCharts

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
projectUuidstringYes

Query parameters

NameTypeRequiredDescription
idsarray[string]No
offsetnumberNo

Responses

200 — Success

{
  "results": {
    "offset": 0,
    "total": 0,
    "spaces": [
      {
        "access": {
          "groups": [
            {
              "role": "viewer",
              "name": "string"
            }
          ],
          "users": [
            {
              "role": "viewer",
              "email": "string"
            }
          ],
          "projectMemberAccessRole": {},
          "inheritParentPermissions": true
        },
        "slug": "string",
        "spaceName": "string",
        "version": 1,
        "contentType": "space"
      }
    ],
    "missingIds": [
      "string"
    ],
    "sqlCharts": [
      {
        "name": "string",
        "description": "string",
        "slug": "string",
        "limit": 0,
        "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"
            }
          }
        },
        "sql": "string",
        "chartKind": "line",
        "downloadedAt": "2024-01-01T00:00:00.000Z",
        "updatedAt": "2024-01-01T00:00:00.000Z",
        "spaceSlug": "string",
        "contentType": "sql_chart",
        "version": 0
      }
    ]
  },
  "status": "ok"
}

default — Error

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