Add query history

Adds a new entry to the query execution history for the currently logged-in user.

Required Permissions

A logged-in user can only add entries to their own query history.

HTTP Request

POST /api/sonar/query-history
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -d query="table sys_cpu_logs" \
     -X POST \
     https://HOSTNAME/api/sonar/query-history
Request Parameters
KeyRequiredTypeDescriptionNote
queryYesStringQuery string

Success Response

{}

Error Responses

query parameter is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "query should be not null"
}