Get query history

Gets the query execution history for the currently logged-in user from the last 30 days.

HTTP request

GET /api/sonar/query-history
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     https://HOSTNAME/api/sonar/query-history
Request parameters
KeyRequiredTypeDescriptionNote
offsetNo32-bit integerNumber of records to skipDefault: 0
limitNo32-bit integerMaximum number of records

Success response

{
  "total_count": 2,
  "queries": [
    {
      "query": "table sys_cpu_logs",
      "created_at": "2024-01-15 10:30:25+0900"
    },
    {
      "query": "system tables",
      "created_at": "2024-01-15 09:15:00+0900"
    }
  ]
}
  • total_count (32-bit integer): Total number of query history records
  • queries (Array): Query history list
    • query (String): Executed query string
    • created_at (String): Query execution date and time