Unit query
The Unit query routes of Amiril's HTTP API that an OAuth access token can call, with their parameters, request bodies and responses.
Two-segment paginated result: 50 data rows in segment order, per-segment totals, the divider boundary, split sections, the slider max, and work-item metadata.
Any access token can call this, read-only or full.
accessTokenAuthorizationBearer <JWT>An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.
application/json- body
filterState*page?integer1 <= value <= 90071992547409911One page of units
application/json- response
grain*string"runs""work-items"unit*stringwindowFrom*string|nullwindowTo*string|nullnewestEnd*string|nullrows*array<>page*numberpageCount*numbertotalDataRows*numbershowingFrom*numbershowingTo*numberunreviewedTotal*numberreviewedTotal*numberdividerIndex*number|nullsections*array<>maxScoreExcludingMin*numberdanglingAgent*booleandanglingSystem*booleandanglingField*booleandanglingDetectionType*booleanscoring*booleanclusterName*string|nulltotal*number|nullceiling*|nullcurl -X POST 'https://api.amiril.ai/api/unit-query/query' \ -H 'Content-Type: application/json' \ -d '{ "filterState": { "grain": "runs", "system": "string", "agents": [ "string" ], "window": { "kind": "preset", "preset": "1h" }, "tools": [ "string" ], "detectionType": "all", "rank": "strongest", "minScore": 0, "extremes": true, "sharedIdValue": "string", "trackedFieldFilters": [ { "fieldId": "string", "negated": false, "value": "string" } ], "split": true, "reviewed": "hide", "sort": { "column": "score", "dir": "asc" }, "cols": [ "string" ] }}'{ "grain": "runs", "unit": "string", "windowFrom": "string", "windowTo": "string", "newestEnd": "string", "rows": [ { "id": "string", "grain": "runs", "unit": "string", "score": 0, "scores": { "top3": 0, "sum": 0, "mean": 0 }, "wholeRunScore": 0, "singleEventScore": 0, "anomalyClass": "whole_run", "wholeRunAnomaly": true, "singleEventAnomaly": true, "findings": 0, "status": "new", "judgedCount": 0, "review": "real", "agentKey": "string", "agentName": "string", "summary": "string", "headline": "string", "topShare": 0, "complete": true, "startTs": "string", "endTs": "string", "scoredAt": "string", "sectionId": "string", "events": 0, "toolCalls": 0, "durationMs": 0, "tokens": 0, "cost": 0, "errorCount": 0, "models": [ "string" ], "runCount": 0, "fields": { "property1": "string", "property2": "string" }, "systemName": "string", "systemLabel": "string", "agentNames": [ "string" ], "agentKeys": [ "string" ], "badCluster": { "key": "string", "name": "string" }, "turnReasons": [ { "kind": "turn_cluster", "role": "user", "position": 0, "cluster": { "key": "string", "name": "string" } } ], "badFacetClusters": [ { "key": "string", "name": "string" } ], "turns": 0, "succeeded": true, "outcomeExpected": true, "blockedCalls": 0 } ], "page": 0, "pageCount": 0, "totalDataRows": 0, "showingFrom": 0, "showingTo": 0, "unreviewedTotal": 0, "reviewedTotal": 0, "dividerIndex": 0, "sections": [ { "agentId": "string", "agentName": "string", "unreviewedCount": 0, "reviewedCount": 0 } ], "maxScoreExcludingMin": 0, "danglingAgent": true, "danglingSystem": true, "danglingField": true, "danglingDetectionType": true, "scoring": true, "clusterName": "string", "total": 0, "ceiling": { "ranked": 0, "of": 0 }}Wraps the unit query: one window value, an array of widget filter states, per-widget results in one round trip. Stats and daily results carry a budget note when they cover the whole grain.
Any access token can call this, read-only or full.
accessTokenAuthorizationBearer <JWT>An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.
application/json- body
window*||nullentries*array<>items <= 60Per-widget results
application/json- response
results*array<||||>scoringAgentIds*array<string>curl -X POST 'https://api.amiril.ai/api/unit-query/dashboard-data' \ -H 'Content-Type: application/json' \ -d '{ "window": { "kind": "preset", "preset": "1h" }, "entries": [ { "filterState": { "grain": "runs", "system": "string", "agents": [ "string" ], "window": { "kind": "preset", "preset": "1h" }, "tools": [ "string" ], "detectionType": "all", "rank": "strongest", "minScore": 0, "extremes": true, "sharedIdValue": "string", "trackedFieldFilters": [ { "fieldId": "string", "negated": false, "value": "string" } ], "split": true, "reviewed": "hide", "sort": { "column": "score", "dir": "asc" }, "cols": [ "string" ] } } ]}'{ "results": [ { "aggregate": null, "query": { "grain": "runs", "unit": "string", "windowFrom": "string", "windowTo": "string", "newestEnd": "string", "rows": [ { "id": "string", "grain": "runs", "unit": "string", "score": 0, "scores": { "top3": 0, "sum": 0, "mean": 0 }, "wholeRunScore": 0, "singleEventScore": 0, "anomalyClass": "whole_run", "wholeRunAnomaly": true, "singleEventAnomaly": true, "findings": 0, "status": "new", "judgedCount": 0, "review": "real", "agentKey": "string", "agentName": "string", "summary": "string", "headline": "string", "topShare": 0, "complete": true, "startTs": "string", "endTs": "string", "scoredAt": "string", "sectionId": "string", "events": 0, "toolCalls": 0, "durationMs": 0, "tokens": 0, "cost": 0, "errorCount": 0, "models": [ "string" ], "runCount": 0, "fields": { "property1": "string", "property2": "string" }, "systemName": "string", "systemLabel": "string", "agentNames": [ "string" ], "agentKeys": [ "string" ], "badCluster": { "key": "string", "name": "string" }, "turnReasons": [ { "kind": "turn_cluster", "role": "user", "position": 0, "cluster": { "key": "string", "name": "string" } } ], "badFacetClusters": [ { "key": "string", "name": "string" } ], "turns": 0, "succeeded": true, "outcomeExpected": true, "blockedCalls": 0 } ], "page": 0, "pageCount": 0, "totalDataRows": 0, "showingFrom": 0, "showingTo": 0, "unreviewedTotal": 0, "reviewedTotal": 0, "dividerIndex": 0, "sections": [ { "agentId": "string", "agentName": "string", "unreviewedCount": 0, "reviewedCount": 0 } ], "maxScoreExcludingMin": 0, "danglingAgent": true, "danglingSystem": true, "danglingField": true, "danglingDetectionType": true, "scoring": true, "clusterName": "string", "total": 0, "ceiling": { "ranked": 0, "of": 0 } } } ], "scoringAgentIds": [ "string" ]}The detection type ids some enabled detector emits, in display order. Ids only; the client labels them.
Any access token can call this, read-only or full.
accessTokenAuthorizationBearer <JWT>An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.
Detection type ids
application/json- response
detectionTypes*array<string>curl -X GET 'https://api.amiril.ai/api/detection-types'{ "detectionTypes": [ "string" ]}