sensorhubDevelopers
Open SensorhubGet an API key
Browse documentation
REST API / Collections

ai_answer_queries

CollectionLarge: filter on indexed fields

Queries actually run by an answer engine, related searches and synthetic discovery queries.

Max rows per query
100
Default order
id asc
Required filter
one of project_id, id, answer_id
Max offset
2000
Cursor paging
by id

Use read report_* for dashboard headline metrics and anchored comparison windows.

Fields

FieldTypeDescriptionFilterSort
id
indexed
stringUnique row ID.✓✓
project_id
indexed
stringProject ID from projects.✓–
answer_id
indexed
stringAI answer ID.✓✓
query
stringSearch query.––
kind
indexed
stringQuery origin.
ENGINE_EXECUTED RELATED_SEARCH SYNTHETIC_QUERY
✓✓
position
integerQuery position.––

Examples

Example
SELECT id, project_id, answer_id, query, kind
FROM ai_answer_queries
WHERE project_id = $1
ORDER BY id ASC
LIMIT 25

Calling it

MCP

Tool call
query({"sql":"SELECT id, project_id, answer_id, query, kind FROM ai_answer_queries WHERE project_id = $1 ORDER BY id ASC LIMIT 25","params":["<value 1>"]})

REST

curl
curl -X POST "https://app.sensorhub.ai/api/v1/query" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "sql": "SELECT id, project_id, answer_id, query, kind FROM ai_answer_queries WHERE project_id = $1 ORDER BY id ASC LIMIT 25",
  "params": [
    "<value 1>"
  ]
}
JSON
Row JSON Schema
json
{
  "type": "object",
  "description": "Queries actually run by an answer engine, related searches and synthetic discovery queries.",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique row ID.",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "project_id": {
      "type": "string",
      "description": "Project ID from projects.",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": false,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": false
    },
    "answer_id": {
      "type": "string",
      "description": "AI answer ID.",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "query": {
      "type": "string",
      "description": "Search query.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": false
    },
    "kind": {
      "type": "string",
      "description": "Query origin.",
      "enum": [
        "ENGINE_EXECUTED",
        "RELATED_SEARCH",
        "SYNTHETIC_QUERY"
      ],
      "x-sensorhub-filter-operators": [
        "=",
        "!=",
        "<>",
        "IN",
        "NOT IN",
        "IS NULL",
        "IS NOT NULL"
      ],
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "position": {
      "type": "integer",
      "description": "Query position.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": false
    }
  },
  "additionalProperties": false
}