curl --request PATCH \
--url https://api.usenexio.com/api/v1/conversation-instances/{instance_slug}/eval-scenarios/{scenario_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"script": [
{
"message": "<string>",
"tool_results": {},
"confirmations": {}
}
],
"rubric": {
"must_refuse": [
"<string>"
],
"must_escalate": [
"<string>"
],
"must_call_tools": [
{
"name": "<string>",
"input_contains": "<string>"
}
],
"must_emit_components": [
{
"component": "<string>"
}
],
"must_cite": [
"<string>"
],
"must_not_refuse": true,
"final_must_not_contain": [
"<string>"
],
"judge": [
{
"name": "<string>",
"criteria": "<string>"
}
]
}
}
'import requests
url = "https://api.usenexio.com/api/v1/conversation-instances/{instance_slug}/eval-scenarios/{scenario_id}"
payload = {
"name": "<string>",
"script": [
{
"message": "<string>",
"tool_results": {},
"confirmations": {}
}
],
"rubric": {
"must_refuse": ["<string>"],
"must_escalate": ["<string>"],
"must_call_tools": [
{
"name": "<string>",
"input_contains": "<string>"
}
],
"must_emit_components": [{ "component": "<string>" }],
"must_cite": ["<string>"],
"must_not_refuse": True,
"final_must_not_contain": ["<string>"],
"judge": [
{
"name": "<string>",
"criteria": "<string>"
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
script: [{message: '<string>', tool_results: {}, confirmations: {}}],
rubric: {
must_refuse: ['<string>'],
must_escalate: ['<string>'],
must_call_tools: [{name: '<string>', input_contains: '<string>'}],
must_emit_components: [{component: '<string>'}],
must_cite: ['<string>'],
must_not_refuse: true,
final_must_not_contain: ['<string>'],
judge: [{name: '<string>', criteria: '<string>'}]
}
})
};
fetch('https://api.usenexio.com/api/v1/conversation-instances/{instance_slug}/eval-scenarios/{scenario_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"script": [
{
"message": "<string>",
"tool_results": {},
"confirmations": {}
}
],
"rubric": {
"must_refuse": [
"<string>"
],
"must_escalate": [
"<string>"
],
"must_call_tools": [
{
"name": "<string>",
"input_contains": "<string>"
}
],
"must_emit_components": [
{
"component": "<string>"
}
],
"must_cite": [
"<string>"
],
"must_not_refuse": true,
"final_must_not_contain": [
"<string>"
],
"judge": [
{
"name": "<string>",
"criteria": "<string>"
}
]
},
"origin": "authored",
"suite": "gate",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"annotation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"code": "unauthorized",
"message": "Missing or invalid API key"
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"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"
}Update an eval scenario
Correct a scenario in place, keeping its id and past results. Organization API keys only.
curl --request PATCH \
--url https://api.usenexio.com/api/v1/conversation-instances/{instance_slug}/eval-scenarios/{scenario_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"script": [
{
"message": "<string>",
"tool_results": {},
"confirmations": {}
}
],
"rubric": {
"must_refuse": [
"<string>"
],
"must_escalate": [
"<string>"
],
"must_call_tools": [
{
"name": "<string>",
"input_contains": "<string>"
}
],
"must_emit_components": [
{
"component": "<string>"
}
],
"must_cite": [
"<string>"
],
"must_not_refuse": true,
"final_must_not_contain": [
"<string>"
],
"judge": [
{
"name": "<string>",
"criteria": "<string>"
}
]
}
}
'import requests
url = "https://api.usenexio.com/api/v1/conversation-instances/{instance_slug}/eval-scenarios/{scenario_id}"
payload = {
"name": "<string>",
"script": [
{
"message": "<string>",
"tool_results": {},
"confirmations": {}
}
],
"rubric": {
"must_refuse": ["<string>"],
"must_escalate": ["<string>"],
"must_call_tools": [
{
"name": "<string>",
"input_contains": "<string>"
}
],
"must_emit_components": [{ "component": "<string>" }],
"must_cite": ["<string>"],
"must_not_refuse": True,
"final_must_not_contain": ["<string>"],
"judge": [
{
"name": "<string>",
"criteria": "<string>"
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
script: [{message: '<string>', tool_results: {}, confirmations: {}}],
rubric: {
must_refuse: ['<string>'],
must_escalate: ['<string>'],
must_call_tools: [{name: '<string>', input_contains: '<string>'}],
must_emit_components: [{component: '<string>'}],
must_cite: ['<string>'],
must_not_refuse: true,
final_must_not_contain: ['<string>'],
judge: [{name: '<string>', criteria: '<string>'}]
}
})
};
fetch('https://api.usenexio.com/api/v1/conversation-instances/{instance_slug}/eval-scenarios/{scenario_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"script": [
{
"message": "<string>",
"tool_results": {},
"confirmations": {}
}
],
"rubric": {
"must_refuse": [
"<string>"
],
"must_escalate": [
"<string>"
],
"must_call_tools": [
{
"name": "<string>",
"input_contains": "<string>"
}
],
"must_emit_components": [
{
"component": "<string>"
}
],
"must_cite": [
"<string>"
],
"must_not_refuse": true,
"final_must_not_contain": [
"<string>"
],
"judge": [
{
"name": "<string>",
"criteria": "<string>"
}
]
},
"origin": "authored",
"suite": "gate",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"annotation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"code": "unauthorized",
"message": "Missing or invalid API key"
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"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 /api/v1/records, /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
Conversation instance identifier slug (e.g. platform-assistant).
Body
Must not be blank. At most 200 UTF-8 bytes.
200A scripted multi-turn conversation.
1 - 8 elementsHide child attributes
Hide child attributes
The user message that opens the turn.
Client tool NAME to the scripted result posted back when the turn hands that tool off. An unscripted handoff receives a scripted error result.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Expected behavior for a scenario. Every non-judge field is a
deterministic check decided in code; judge dimensions are scored by
the model judge, recorded per scenario, and can never fail a scenario.
Hide child attributes
Hide child attributes
Guardrail rule ids that must fire with a refused decision.
Guardrail rule ids that must fire with an escalated decision.
Source references that must appear in the final answer (in a citation block's refs or the final assistant prose).
True asserts the conversation ended in a delivered answer: no
refusal fired anywhere, and the final turn did not stop at
refusal, escalated, output_check_triggered, or
max_output_tokens.
Phrases that must not appear in the final assistant prose, compared case-insensitively.
gate, workflows, adversarial, smoke Response
The updated scenario.
One stored eval scenario.
A scripted multi-turn conversation.
1 - 8 elementsHide child attributes
Hide child attributes
The user message that opens the turn.
Client tool NAME to the scripted result posted back when the turn hands that tool off. An unscripted handoff receives a scripted error result.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Expected behavior for a scenario. Every non-judge field is a
deterministic check decided in code; judge dimensions are scored by
the model judge, recorded per scenario, and can never fail a scenario.
Hide child attributes
Hide child attributes
Guardrail rule ids that must fire with a refused decision.
Guardrail rule ids that must fire with an escalated decision.
Source references that must appear in the final answer (in a citation block's refs or the final assistant prose).
True asserts the conversation ended in a delivered answer: no
refusal fired anywhere, and the final turn did not stop at
refusal, escalated, output_check_triggered, or
max_output_tokens.
Phrases that must not appear in the final assistant prose, compared case-insensitively.
authored, promoted_from_annotation The suite the scenario belongs to. gate scenarios run on every
publish; the others run only when a run of that suite is
requested.
gate, workflows, adversarial, smoke The source annotation for promoted scenarios; omitted for authored ones.