curl --request POST \
--url https://api.usenexio.com/api/v1/engines/{engine_slug}/runs/{run_id}/annotations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"comment": "The recommendation matched our own review of this supplier.",
"target": {},
"submitter_id": "<string>",
"time_on_task_seconds": 43199
}
'import requests
url = "https://api.usenexio.com/api/v1/engines/{engine_slug}/runs/{run_id}/annotations"
payload = {
"comment": "The recommendation matched our own review of this supplier.",
"target": {},
"submitter_id": "<string>",
"time_on_task_seconds": 43199
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
comment: 'The recommendation matched our own review of this supplier.',
target: {},
submitter_id: '<string>',
time_on_task_seconds: 43199
})
};
fetch('https://api.usenexio.com/api/v1/engines/{engine_slug}/runs/{run_id}/annotations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_id": "<string>",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rating": "good",
"comment": "<string>",
"source": "api",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"target": {},
"submitter_id": "<string>",
"time_on_task_seconds": 123
}{
"code": "missing_comment",
"message": "comment is required and cannot be empty"
}{
"code": "unauthorized",
"message": "Missing or invalid API key"
}{
"code": "engine_binding_forbidden",
"message": "API key is not bound to this run's engine"
}{
"code": "run_not_found",
"message": "run not found"
}{
"code": "scoped_annotation_required",
"message": "Use the scoped Opportunity annotation resource"
}{
"code": "rate_limited",
"message": "Rate limit exceeded"
}{
"code": "internal_error",
"message": "Internal server error"
}{
"code": "auth_unavailable",
"message": "API key authentication is temporarily unavailable"
}{
"code": "request_timeout",
"message": "Request timed out"
}Annotate a run
Attach a rating, a comment and an optional target to a run.
curl --request POST \
--url https://api.usenexio.com/api/v1/engines/{engine_slug}/runs/{run_id}/annotations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"comment": "The recommendation matched our own review of this supplier.",
"target": {},
"submitter_id": "<string>",
"time_on_task_seconds": 43199
}
'import requests
url = "https://api.usenexio.com/api/v1/engines/{engine_slug}/runs/{run_id}/annotations"
payload = {
"comment": "The recommendation matched our own review of this supplier.",
"target": {},
"submitter_id": "<string>",
"time_on_task_seconds": 43199
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
comment: 'The recommendation matched our own review of this supplier.',
target: {},
submitter_id: '<string>',
time_on_task_seconds: 43199
})
};
fetch('https://api.usenexio.com/api/v1/engines/{engine_slug}/runs/{run_id}/annotations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_id": "<string>",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rating": "good",
"comment": "<string>",
"source": "api",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"target": {},
"submitter_id": "<string>",
"time_on_task_seconds": 123
}{
"code": "missing_comment",
"message": "comment is required and cannot be empty"
}{
"code": "unauthorized",
"message": "Missing or invalid API key"
}{
"code": "engine_binding_forbidden",
"message": "API key is not bound to this run's engine"
}{
"code": "run_not_found",
"message": "run not found"
}{
"code": "scoped_annotation_required",
"message": "Use the scoped Opportunity annotation resource"
}{
"code": "rate_limited",
"message": "Rate limit exceeded"
}{
"code": "internal_error",
"message": "Internal server error"
}{
"code": "auth_unavailable",
"message": "API key authentication is temporarily unavailable"
}{
"code": "request_timeout",
"message": "Request timed out"
}Authorizations
Send the key as Authorization: Bearer <key>. Two kinds of key exist.
Organization keys are issued in the portal (Settings, then API keys),
each bound to one environment, shaped nx_<environment slug>_<64 hex>. They carry
no capabilities and pass every capability check, with one exception:
routes under /records, /actions, /operations,
/api/v1/engines/{id}/opportunities, /api/v1/graph and
/api/v1/catalog/documents accept an
organization key only when its environment is live, and refuse any
other with 403 scoped_key_required. Revocation takes effect within 60
seconds.
Scoped keys are issued by Nexio on request, shaped
nxsk_v1_<24 hex key id>_<43 character secret>. Each is bound to one
org, one environment, a set of engines and a set of capabilities. A
malformed, unknown or revoked nxsk_ key fails with 401 and is never
retried as an organization key. Revocation takes effect on the next
request. A scoped key without a route's capability gets 403
insufficient_capability; a scoped key not bound to the engine gets 403
engine_binding_forbidden.
Key-grantable capabilities: engines:read, runs:write, runs:read,
runs:defensibility:read, runs:test, catalog:read,
catalog:documents:read, webhooks:manage, conversations:use,
conversations:export, records:read, records:opportunities:run,
actions:write, actions:read, graph:read, records:analyze.
Routes that accept organization keys only (every scoped key gets 403
insufficient_capability): environment management, engine create,
update, configuration and publish, and conversation instance
authoring. Each operation description names the capability a scoped
key needs.
Path Parameters
Engine identifier slug (e.g. default).
Body
good, bad, neutral Required free-text note with at least one non-whitespace character.
1"The recommendation matched our own review of this supplier."
Optional pointer at the output element the note is about. Any JSON object.
Optional caller-supplied identifier for who submitted the signal.
Seconds the person spent reviewing.
0 <= x <= 86399Response
Annotation recorded.
good, bad, neutral "api"
Microsecond precision.