Definitions
The Definitions routes of Amiril's HTTP API that an OAuth access token can call, with their parameters, request bodies and responses.
Every customer-declared way of grouping runs into reviewable cross-run units, with the observed ids-key candidates a new definition confirms from.
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.
Definitions and candidates
application/json- response
definitions*array<>candidates*array<>payloadPathCandidates*array<>events*numberunitCounts*curl -X GET 'https://api.amiril.ai/api/definitions'{ "definitions": [ { "id": "string", "name": "string", "label": "string", "identityVersion": 0, "displayVersion": 0, "invalid": true, "link": [ { "kind": "metadata-key", "key": "string", "priority": 0, "blockedValues": [ "string" ] } ], "fields": [ { "id": "string", "name": "string", "type": "string", "derive": { "kind": "extract-path", "paths": [ "string" ], "pick": "first" } } ], "updatedAt": "string" } ], "candidates": [ { "key": "string", "events": 0 } ], "payloadPathCandidates": [ { "path": "string", "events": 0, "values": 0, "agents": 0, "kind": "string" } ], "events": 0, "unitCounts": { "property1": 0, "property2": 0 }}Units only exist from full-history replay, so creating one rebuilds the whole scoring family โ a deliberate full re-score, the rare kind.
Needs a full access token. A read-only token is refused.
accessTokenAuthorizationBearer <JWT>An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.
application/json- body
name*string1 <= length <= 60label*string1 <= length <= 60link*array<|>1 <= items <= 10fields?array<>items <= 20[]Created definition
application/json- response
definition*identityChanged*booleanrescored*booleancurl -X POST 'https://api.amiril.ai/api/definitions' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "label": "string", "link": [ { "kind": "metadata-key", "key": "string" } ]}'{ "definition": { "id": "string", "name": "string", "label": "string", "identityVersion": 0, "displayVersion": 0, "invalid": true, "link": [ { "kind": "metadata-key", "key": "string", "priority": 0, "blockedValues": [ "string" ] } ], "fields": [ { "id": "string", "name": "string", "type": "string", "derive": { "kind": "extract-path", "paths": [ "string" ], "pick": "first" } } ], "updatedAt": "string" }, "identityChanged": true, "rescored": true}The workspace's live environments in which the Agent System has at least one work item, oldest environment first. Each environment's count is read on its own, so nothing reads across environments; the system page's not-seen state links to these.
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.
definitionId*stringWhere it has work items
application/json- response
seenIn*array<>curl -X GET 'https://api.amiril.ai/api/definitions/string/seen-in'{ "seenIn": [ { "id": "string", "name": "string" } ]}Links the newest runs' events with the draft rules and reports what would group โ nothing is stored. The editor's live feedback while a lens is being shaped.
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
link*array<|>1 <= items <= 10What the draft would link
application/json- response
sampledRuns*numberlinkedRuns*numberunits*numberagents*array<string>newInLatestImport*booleantopValues*array<>topUnits*array<>curl -X POST 'https://api.amiril.ai/api/definitions/preview' \ -H 'Content-Type: application/json' \ -d '{ "link": [ { "kind": "metadata-key", "key": "string" } ]}'{ "sampledRuns": 0, "linkedRuns": 0, "units": 0, "agents": [ "string" ], "newInLatestImport": true, "topValues": [ { "value": "string", "runs": 0 } ], "topUnits": [ { "unitId": "string", "runs": 0, "members": [ { "agentName": "string", "startTs": "string" } ] } ]}Removes the definition, every judgment made under it, and its stored units; history re-scores without it.
Needs a full access token. A read-only token is refused.
accessTokenAuthorizationBearer <JWT>An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.
definitionId*stringDeleted
application/json- response
ok*booleancurl -X DELETE 'https://api.amiril.ai/api/definitions/string'{ "ok": true}Link-rule changes open a new judgment namespace (old unit judgments no longer apply โ they were about a different grouping) and re-score history; field edits re-score but keep judgments; a pure rename does neither.
Needs a full access token. A read-only token is refused.
accessTokenAuthorizationBearer <JWT>An OAuth access token from Amiril's authorization server, the kind an MCP client gets when it connects.
definitionId*stringapplication/json- body
name*string1 <= length <= 60label*string1 <= length <= 60link*array<|>1 <= items <= 10fields?array<>items <= 20[]Saved definition
application/json- response
definition*identityChanged*booleanrescored*booleancurl -X PUT 'https://api.amiril.ai/api/definitions/string' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "label": "string", "link": [ { "kind": "metadata-key", "key": "string" } ]}'{ "definition": { "id": "string", "name": "string", "label": "string", "identityVersion": 0, "displayVersion": 0, "invalid": true, "link": [ { "kind": "metadata-key", "key": "string", "priority": 0, "blockedValues": [ "string" ] } ], "fields": [ { "id": "string", "name": "string", "type": "string", "derive": { "kind": "extract-path", "paths": [ "string" ], "pick": "first" } } ], "updatedAt": "string" }, "identityChanged": true, "rescored": true}