Invalid query

Resolve invalid query errors.

An invalid query error indicates that the CQL expression contains one or more syntax errors.

Verify the expression syntax against the CQL reference before retrying.

Response

All error responses follow the Problem Details (RFC 9457) format, which defines the type, title, status, detail, and instance fields.

Here is an example of the response returned for this error:

{  "type": "https://croct.help/api/evaluation/invalid-query",  "title": "The query is invalid.",  "status": 422,  "detail": "The query contains one or more syntax errors.",  "errors": [    {      "cause": "No viable alternative at the end of input",      "location": {        "start": {          "line": 1,          "column": 3,          "index": 3        },        "end": {          "line": 1,          "column": 3,          "index": 3        }      }    }  ]}

The response includes the following additional field:

errors
Array<object>

The list of errors found while processing the expression.

cause
string

A human-readable description of the error.

location
object

The source location of the error within the expression.

start
object

The start position of the problematic token.

line
integer

The 1-based line number.

column
integer

The 0-based column number within the line.

index
integer

The 0-based character offset from the start of the expression.

end
object

The end position of the problematic token, with the same shape as start.