Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Execute Agent Insights free-form SQL

POST/v1/internal/analytics-queries/projects/{projectId}Execute Agent Insights free-form SQL

Runs Ollie-generated read-only SQL bounded to the caller's workspace and the requested project. Returns 501 when the Agent Insights toggle is off.

Parameters

projectIdstring · uuidpathrequired

Request body

application/json
objectAnalyticsQueryRequest
querystringrequired

Read-only ClickHouse SQL. Must return exactly one column named `result` produced via toJSONString(...)

minLength 1

Example request
{
  "query": "string"
}

Responses

200Query resultsapplication/json
objectAnalyticsQueryResponse
resultsarray of object
Show child attributes
Example response
{
  "results": [
    {}
  ]
}
400Bad Requestapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
422Unprocessable Contentapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
501Agent Insights queries are not enabled
Documentation menu