Need more detail? Connect your coding agent to the full docs.

Skip to Content
AMIRILDocs
/

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.

POST
/api/unit-query/query

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.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Request Body

application/json
  1. body
filterState*
page?integer
Range1 <= value <= 9007199254740991
Default1

Response Body

One page of units

application/json
  1. response
grain*string
Value in"runs""work-items"
unit*string
windowFrom*string|null
windowTo*string|null
newestEnd*string|null
rows*array<>
page*number
pageCount*number
totalDataRows*number
showingFrom*number
showingTo*number
unreviewedTotal*number
reviewedTotal*number
dividerIndex*number|null
sections*array<>
maxScoreExcludingMin*number
danglingAgent*boolean
danglingSystem*boolean
danglingField*boolean
danglingDetectionType*boolean
scoring*boolean
clusterName*string|null
total*number|null
ceiling*|null
Example Request
curl -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"    ]  }}'
Example Response200
{  "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  }}
POST
/api/unit-query/dashboard-data

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.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Request Body

application/json
  1. body
window*||null
entries*array<>
Itemsitems <= 60

Response Body

Per-widget results

application/json
  1. response
results*array<||||>
scoringAgentIds*array<string>
Example Request
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"        ]      }    }  ]}'
Example Response200
{  "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"  ]}

Detection type ids

GET
/api/detection-types

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.

Authorization

accessToken
headerAuthorizationBearer <JWT>

An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.

Response Body

Detection type ids

application/json
  1. response
detectionTypes*array<string>
Example Request
curl -X GET 'https://api.amiril.ai/api/detection-types'
Example Response200
{  "detectionTypes": [    "string"  ]}