REST API / Collections
alert_events
Collection
Historical alert occurrences and their observed metric values.
- Max rows per query
- 100
- Default order
- id asc
- 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. | ✓ | – |
name | string | Rule name when fired. | ✓ | ✓ |
metric | string | Monitored metric. | ✓ | ✓ |
threshold | number | Trigger threshold. | ✓ | ✓ |
value | number | Observed metric value. | ✓ | ✓ |
message | string | Alert summary. | ✓ | ✓ |
fired_at | datetime | Time fired. | ✓ | ✓ |
status | string | Review state.NONE TODO IN_PROGRESS DONE | ✓ | ✓ |
starred | boolean | Whether starred. | ✓ | ✓ |
seen_atnullable | datetime | When last marked seen. | ✓ | ✓ |
archived_atnullable | datetime | When archived. | ✓ | ✓ |
opportunity_scorenullable | number | Opportunity score. | ✓ | ✓ |
Examples
Example
SELECT id, project_id, name, metric, threshold
FROM alert_events
ORDER BY id ASC
LIMIT 25Calling it
MCP
Tool call
query({"sql":"SELECT id, project_id, name, metric, threshold FROM alert_events ORDER BY id ASC LIMIT 25"})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, name, metric, threshold FROM alert_events ORDER BY id ASC LIMIT 25"
}
JSONRow JSON Schema
json
{
"type": "object",
"description": "Historical alert occurrences and their observed metric values.",
"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": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": false
},
"name": {
"type": "string",
"description": "Rule name when fired.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"metric": {
"type": "string",
"description": "Monitored metric.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"threshold": {
"type": "number",
"description": "Trigger threshold.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"value": {
"type": "number",
"description": "Observed metric value.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"message": {
"type": "string",
"description": "Alert summary.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"fired_at": {
"type": "string",
"description": "Time fired.",
"format": "date-time",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"status": {
"type": "string",
"description": "Review state.",
"enum": [
"NONE",
"TODO",
"IN_PROGRESS",
"DONE"
],
"x-sensorhub-filter-operators": [
"=",
"!=",
"<>",
"IN",
"NOT IN",
"IS NULL",
"IS NOT NULL"
],
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"starred": {
"type": "boolean",
"description": "Whether starred.",
"x-sensorhub-indexed": false,
"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": false,
"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": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
},
"opportunity_score": {
"type": [
"number",
"null"
],
"description": "Opportunity score.",
"x-sensorhub-indexed": false,
"x-sensorhub-searchable": false,
"x-sensorhub-aggregatable": true,
"x-sensorhub-filterable": true,
"x-sensorhub-sortable": true
}
},
"additionalProperties": false
}