Skip to main content
POST
/
api
/
v1
/
projects
/
{projectUuid}
/
sqlRunner
/
runPivotQuery
Error
A valid request URL is required to generate request examples
{
  "results": {
    "jobId": "<string>"
  },
  "status": "ok"
}

Documentation Index

Fetch the complete documentation index at: https://lightdash-docs-okta-cloud-sso-setup.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Path Parameters

projectUuid
string
required

Body

application/json
sql
string
required
valuesColumns
object[]
required
limit
number<double>
sortOnlyColumns
object[]

Fields referenced only via sortBy that aren't on any axis or in pivot columns. Items with aggregation are metrics/table calculations merged into valuesColumns for sort-anchor CTEs; items without aggregation are dimensions that ride through group_by_query to drive column_index ORDER BY. Both are excluded from pivotDetails so they don't appear as chart series.

metricsAsRows
boolean

When true, metrics are displayed as rows instead of columns. This affects column limit calculation - when metrics are rows, we don't need to divide the column limit by the number of metrics. Defaults to false for backward compatibility (SQL runner behavior).

sortBy
object[]
groupByColumns
object[]
indexColumn
object
savedSqlUuid
string

Response

Success

results
object
required
status
enum<string>
required
Available options:
ok