Skip to content
Docs
Operation

Run an ad-hoc query

POST/reports/query
Execute an arbitrary (validated + guarded) Insights query. Tenant- and account-scoped via the analytics principal; data models/members restricted and cost capped.

Body

▼query*object
measuresstring[]
dimensionsstring[]
▶timeDimensionsobject[]
▶filtersobject[]
segmentsstring[]
orderobject | array[]
limitinteger
offsetinteger
timezonestring

Returns

Query executed

Errors

400
Bad Request - Invalid input
401
Unauthorized - Authentication required
403
Forbidden - Insufficient permissions
404
Not Found - Resource not found
500
Internal Server Error

Every error names its code and links to it. All error codes

curl -X POST "https://api.ticketlayer.com/v1/reports/query" \  -H "Authorization: Bearer tlak_..." \  -H "X-Ticketlayer-Org: your-org-slug" \  -H "Content-Type: application/json" \  -d '{    "query": {      "measures": [        "string"      ],      "dimensions": [        "string"      ],      "timeDimensions": [        {          "dimension": "string",          "granularity": "hour",          "dateRange": "string"        }      ],      "filters": [        {          "member": "string",          "operator": "string",          "values": [            "string"          ]        }      ],      "segments": [        "string"      ],      "order": {},      "limit": 0,      "offset": 0,      "timezone": "string"    }  }'
Response 200
{
  "status": "success",
  "data": {
    "rows": [
      {}
    ],
    "query": {}
  }
}

Try it in test mode

Body