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

Skip to Content
AMIRILDocs
/

Definitions

The Definitions routes of Amiril's HTTP API that an OAuth access token can call, with their parameters, request bodies and responses.

GET
/api/definitions

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.

Authorization

accessToken
headerAuthorizationBearer <JWT>

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

Response Body

Definitions and candidates

application/json
  1. response
definitions*array<>
candidates*array<>
payloadPathCandidates*array<>
events*number
unitCounts*
Example Request
curl -X GET 'https://api.amiril.ai/api/definitions'
Example Response200
{  "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  }}

Create a data lens

POST
/api/definitions

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.

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
name*string
Length1 <= length <= 60
label*string
Length1 <= length <= 60
link*array<|>
Items1 <= items <= 10
fields?array<>
Itemsitems <= 20
Default[]

Response Body

Created definition

application/json
  1. response
definition*
identityChanged*boolean
rescored*boolean
Example Request
curl -X POST 'https://api.amiril.ai/api/definitions' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "label": "string",  "link": [    {      "kind": "metadata-key",      "key": "string"    }  ]}'
Example Response200
{  "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}
GET
/api/definitions/{definitionId}/seen-in

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.

Authorization

accessToken
headerAuthorizationBearer <JWT>

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

Path Parameters

definitionId*string

Response Body

Where it has work items

application/json
  1. response
seenIn*array<>
Example Request
curl -X GET 'https://api.amiril.ai/api/definitions/string/seen-in'
Example Response200
{  "seenIn": [    {      "id": "string",      "name": "string"    }  ]}
POST
/api/definitions/preview

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.

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
link*array<|>
Items1 <= items <= 10

Response Body

What the draft would link

application/json
  1. response
sampledRuns*number
linkedRuns*number
units*number
agents*array<string>
newInLatestImport*boolean
topValues*array<>
topUnits*array<>
Example Request
curl -X POST 'https://api.amiril.ai/api/definitions/preview' \  -H 'Content-Type: application/json' \  -d '{  "link": [    {      "kind": "metadata-key",      "key": "string"    }  ]}'
Example Response200
{  "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"        }      ]    }  ]}

Delete a data lens

DELETE
/api/definitions/{definitionId}

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.

Authorization

accessToken
headerAuthorizationBearer <JWT>

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

Path Parameters

definitionId*string

Response Body

Deleted

application/json
  1. response
ok*boolean
Example Request
curl -X DELETE 'https://api.amiril.ai/api/definitions/string'
Example Response
{  "ok": true}

Edit a data lens

PUT
/api/definitions/{definitionId}

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.

Authorization

accessToken
headerAuthorizationBearer <JWT>

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

Path Parameters

definitionId*string

Request Body

application/json
  1. body
name*string
Length1 <= length <= 60
label*string
Length1 <= length <= 60
link*array<|>
Items1 <= items <= 10
fields?array<>
Itemsitems <= 20
Default[]

Response Body

Saved definition

application/json
  1. response
definition*
identityChanged*boolean
rescored*boolean
Example Request
curl -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"    }  ]}'
Example Response
{  "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}