REST API / Collections
ai_answers
CollectionLarge: filter on indexed fields
AI answers scoped through their prompt. Default projection omits raw text in Querifold 0.6.2. Select raw_answer explicitly for an excerpt; use get_item answer with rawOffset for continuation. Raw answer text is select-only and truncated to 2000 characters.
- Max rows per query
- 100
- Default order
- id asc
- Required filter
- one of project_id, id, prompt_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. | ✓ | – |
prompt_id indexed | string | Prompt ID. | ✓ | ✓ |
engine indexed | string | Answer engine.CHATGPT GOOGLE_AIO | ✓ | ✓ |
run_at indexed | datetime | Capture time. | ✓ | ✓ |
run_week indexed | datetime | Idempotency week. | ✓ | ✓ |
mentions_brand | boolean | Whether the project brand was mentioned. | – | – |
brand_match_source | string | Inferred evidence, not persisted matcher provenance: answer_text_offset means a valid stored text offset, unverified_legacy means the historical hit has no valid offset, none means no hit. | – | – |
raw_answer_truncated | boolean | Whether raw answer text exceeds this response excerpt. Use get_item resource answer with the returned ID for detail. | – | – |
brand_positionnullable | integer | Deprecated: use avgFirstMentionCharOffset in reports. Stored zero-based UTF-16 character offset of first brand mention; negative values are unknown sentinels, not rank. | – | – |
competitors_hit | string[] | Competitor names mentioned. | – | – |
sentimentnullable | integer | Brand sentiment from 0 to 100; null when unavailable. | – | – |
opportunity_scorenullable indexed | number | Opportunity score. | ✓ | ✓ |
model_slugnullable | string | Model identifier. | – | – |
starred indexed | boolean | Whether starred. | ✓ | ✓ |
seen_atnullable indexed | datetime | When last marked seen. | ✓ | ✓ |
archived_atnullable indexed | datetime | When archived. | ✓ | ✓ |
raw_answernullable | string | Plain answer text, at most 2000 characters. | – | – |
Examples
Example
SELECT id, project_id, prompt_id, engine, run_at
FROM ai_answers
WHERE project_id = $1
ORDER BY id ASC
LIMIT 25Calling it
MCP
Tool call
query({"sql":"SELECT id, project_id, prompt_id, engine, run_at FROM ai_answers 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, prompt_id, engine, run_at FROM ai_answers WHERE project_id = $1 ORDER BY id ASC LIMIT 25",
"params": [
"<value 1>"
]
}
JSONRow JSON Schema
json
{
"type": "object",
"description": "AI answers scoped through their prompt. Default projection omits raw text in Querifold 0.6.2. Select raw_answer explicitly for an excerpt; use get_item answer with rawOffset for continuation. Raw answer text is select-only and truncated to 2000 characters.",
"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
},
"prompt_id": {
"type": "string",
"description": "Prompt ID.",
"x-sensorhub-indexed": true,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"engine": {
"type": "string",
"description": "Answer engine.",
"enum": [
"CHATGPT",
"GOOGLE_AIO"
],
"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
},
"run_at": {
"type": "string",
"description": "Capture time.",
"format": "date-time",
"x-sensorhub-indexed": true,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"run_week": {
"type": "string",
"description": "Idempotency week.",
"format": "date-time",
"x-sensorhub-indexed": true,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"mentions_brand": {
"type": "boolean",
"description": "Whether the project brand was mentioned.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": false,
"x-sensorhub-sortable": false
},
"brand_match_source": {
"type": "string",
"description": "Inferred evidence, not persisted matcher provenance: answer_text_offset means a valid stored text offset, unverified_legacy means the historical hit has no valid offset, none means no hit.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": false,
"x-sensorhub-filterable": false,
"x-sensorhub-sortable": false
},
"raw_answer_truncated": {
"type": "boolean",
"description": "Whether raw answer text exceeds this response excerpt. Use get_item resource answer with the returned ID for detail.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": false,
"x-sensorhub-filterable": false,
"x-sensorhub-sortable": false
},
"brand_position": {
"type": [
"integer",
"null"
],
"description": "Deprecated: use avgFirstMentionCharOffset in reports. Stored zero-based UTF-16 character offset of first brand mention; negative values are unknown sentinels, not rank.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": false,
"x-sensorhub-sortable": false
},
"competitors_hit": {
"type": "array",
"description": "Competitor names mentioned.",
"items": {
"type": "string"
},
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": false,
"x-sensorhub-filterable": false,
"x-sensorhub-sortable": false
},
"sentiment": {
"type": [
"integer",
"null"
],
"description": "Brand sentiment from 0 to 100; null when unavailable.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": false,
"x-sensorhub-filterable": false,
"x-sensorhub-sortable": false
},
"opportunity_score": {
"type": [
"number",
"null"
],
"description": "Opportunity score.",
"x-sensorhub-indexed": true,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"model_slug": {
"type": [
"string",
"null"
],
"description": "Model identifier.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": false,
"x-sensorhub-sortable": false
},
"starred": {
"type": "boolean",
"description": "Whether starred.",
"x-sensorhub-indexed": true,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"seen_at": {
"type": [
"string",
"null"
],
"description": "When last marked seen.",
"format": "date-time",
"x-sensorhub-indexed": true,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"archived_at": {
"type": [
"string",
"null"
],
"description": "When archived.",
"format": "date-time",
"x-sensorhub-indexed": true,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"raw_answer": {
"type": [
"string",
"null"
],
"description": "Plain answer text, at most 2000 characters.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": false,
"x-sensorhub-filterable": false,
"x-sensorhub-sortable": false
}
},
"additionalProperties": false
}