Skip to main content
err:user:bad_request:invalid_analytics_query
We can’t run the query you sent to an analytics endpoint (analytics.getVerifications, analytics.getRatelimits, analytics.getGatewayRequests, or analytics.getRuntimeLogs). You get HTTP 400, and detail says what’s wrong.
Example response

Likely causes

  • More than one statement, separated by ;, or no statement at all.
  • SELECT *, or a column that isn’t exposed. The message says the column isn’t available.
  • A SETTINGS clause, often pasted from a console session, such as SETTINGS max_threads = 4.
  • A syntax error, or no FROM clause.
  • An IN that reads from a table, such as IN (SELECT ... FROM table).
  • The query is too big: more than 64 selected columns, more than 16 KiB of text, or more than 2000 syntax tree nodes (Analytics query is too complex).
  • The query failed while running, for example on an unknown column (Unknown identifier), a type mismatch, or a division by zero.
A disallowed table, a disallowed function, and a statement that isn’t a SELECT each have their own error.

How to fix

  1. Send exactly one SELECT with a FROM, using only the documented columns of the analytics tables.
  2. Remove SETTINGS.
  3. Replace an IN (SELECT ... FROM table) with a literal list or a CTE.
  4. For Unknown identifier, check the spelling and any CTE aliases.
  5. Keep the query under 16 KiB and 64 output columns.
Last modified on October 6, 2026