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
| Field | Type | Description | Filter | Sort |
|---|---|---|---|---|
id indexed | string | Unique row ID. | ✓ | ✓ |
project_id indexed | string | Project ID from projects. | ✓ | – |
answer_id indexed | string | AI answer ID. | ✓ | ✓ |
query | string | Search query. | – | – |
kind indexed | string | Query origin.ENGINE_EXECUTED RELATED_SEARCH SYNTHETIC_QUERY | ✓ | ✓ |
position | integer | Query position. | – | – |
Examples
Example
SELECT id, project_id, answer_id, query, kind
FROM ai_answer_queries
WHERE project_id = $1
ORDER BY id ASC
LIMIT 25Calling 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>"
]
}
JSONRow 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
}