Evaluation API reference
This page lists everything you can send to the Evaluation API and everything it returns. For a first test, start with Your first test in 5 minutes.
Scopes
A scope is a right given to an application in Settings › Applications. The table below says what each scope allows.
| Scope | Allows |
|---|---|
evaluation:read | reading simulations, turns, traces, datasets, scenarios and runs |
evaluation:write | opening, feeding and closing simulations, creating, replacing and archiving datasets, starting and cancelling runs |
evaluation:secured_variables | with evaluation:write, sending secured variables accepted as verified (see Variables) |
A program that runs tests and reads the results needs evaluation:read and evaluation:write.
Endpoints
Every path starts with the address of the API, for example https://chatbot.viasay.io/api. The table below gives the scope each call needs.
| Call | Scope | Use |
|---|---|---|
POST /oauth/token | none | get a token, valid for 1 hour, with the client ID and the secret in an Authorization: Basic header |
GET /v1/evaluation/me | any | check a token: application name, scopes, seconds left |
POST /v1/evaluation/simulations | write | open a simulation |
GET /v1/evaluation/simulations | read | list your manual simulations, without their turns |
GET /v1/evaluation/simulations/{id} | read | read a simulation with all its turns |
POST /v1/evaluation/simulations/{id}/messages | write | send a message |
GET /v1/evaluation/simulations/{id}/turns/{n} | read | read one turn, with its trace |
DELETE /v1/evaluation/simulations/{id} | write | close a simulation |
GET /v1/evaluation/trace/{trace_id} | read | read the trace of a turn later |
POST /v1/evaluation/datasets | write | create a dataset |
GET /v1/evaluation/datasets | read | list the datasets that are not archived |
GET /v1/evaluation/datasets/{id} | read | read a dataset, without its scenarios |
GET /v1/evaluation/datasets/{id}/scenarios | read | read the scenarios of a dataset, with their scenario_id |
PUT /v1/evaluation/datasets/{id} | write | replace a dataset, with the same body as the creation |
DELETE /v1/evaluation/datasets/{id} | write | archive a dataset |
POST /v1/evaluation/runs | write | start a run |
GET /v1/evaluation/runs | read | list the runs |
GET /v1/evaluation/runs/{id} | read | read a run with the result of each scenario |
POST /v1/evaluation/runs/{id}/cancel | write | cancel a run |
Targets and versions
Each simulation and each scenario has a target and a version, both required. A scenario can take them from the defaults of its dataset. The first table describes the targets.
target | The messages go… |
|---|---|
{"type": "bot"} | to the bot, as on your widget: it detects the intent and picks the use case |
{"type": "use_case", "use_case_id": 5190} | to one use case, which speaks first in turn 0. Your messages answer it; once it has ended, a text goes through intent detection. use_case_id is the number in the address of the use case (/use_cases/5190) |
{"type": "ai_assistant"} | to Louis, the AI assistant, for each text message |
Note: with a
use_casetarget, the platform starts the use case with a technical message, like the Test flow button of the bot builder. A Generate with AI step at the start reads that message as if the user wrote it, and may pass it to Louis. To test such a use case, use thebottarget with a first message that triggers it.
The second table describes the versions.
version | What is played |
|---|---|
draft | the last saved version of the use cases, published or not |
live | the version published on the environment of the application: in production, the one your customers talk to. A use case never published answers 422 use_case_not_published |
Messages you can send
A message takes one of the forms below.
| Message | Effect |
|---|---|
{"text": "…"} | the user types a text, 2,000 characters at most |
{"click": "Yes"} | the user clicks the quick reply or the button (not a link button) of the previous turn with this label. Unknown label: the turn fails |
{"click": "Yes", "text": "Yes please"} | the click if the label exists, otherwise the text is sent (warning quick_reply_not_found) |
{"postback": "…"} | the click given by its value: copy the postback string of a quick reply or a button of the previous turn, as is |
{"file": "invoice.pdf"} | the user sends a simulated file: only its name, one line without / or \, 255 characters at most, never a content. Send it without text, click or postback |
- A question with choices (
waiting_for.expectsisselect) only accepts aclickor apostback: a text, even equal to a label, makes the bot ask again. - A message that would run a real command is refused with
400 invalid_request: a text whose first word is/issue(which creates an issue in the dashboard),/csat_eventor/nps_rating, or a CSAT or NPS rating. In a dataset, the run is refused when it starts. - Each message can also carry
variables(see below). They replace the current values before the bot reads the message.
Variables
variables can be given when a simulation opens, in a scenario, or with a message, in three categories:
{
"target": { "type": "bot" },
"version": "draft",
"variables": {
"system": { "bot_language": "fr_FR", "user_channel_type": "whatsapp" },
"user_channel": { "customer_ref": "A-1234" },
"custom": { "loyalty_level": "gold" }
}
}
A value is a text, a number, a boolean, or null to erase it. The table below describes the categories.
| Category | Content |
|---|---|
system | system variables, by their name in the bot builder: bot_language, user_channel_type (widget by default), and the browsing variables chatter_browser_language, chatter_actual_url, chatter_start_url, chatter_browser, chatter_operating_system, chatter_local_time, chatter_number_pages_viewed, chatter_browsing_time |
user_channel | the variables your website sends to the widget, by their name |
custom | the custom variables of the bot, by their name. An unknown name is ignored (warning unknown_variable) |
bot_languageanduser_channel_typeare set when the simulation opens. Changing them later is ignored (warningvariable_not_updatable). Anothersystemvariable is refused (400 invalid_request).- A secured variable is a user channel variable that your website must sign to be trusted. In a test, it is accepted as verified when the token has
evaluation:secured_variables. Without this scope, it is removed (warningsecured_variable_ignored).
Fields of a turn
GET /v1/evaluation/simulations/{id}/turns/{n} returns the fields below.
| Field | Content |
|---|---|
turn | 0 for the opening of a use case, then 1, 2… for each of your messages |
status | pending (read again later), completed, timeout (no answer in 60 s) or error |
sent_as | how your message was sent: text, click, postback or file; null for turn 0 |
state | where the conversation stands: awaiting_user (the bot waits for an answer or a click), ended (the use case is over), handed_over or error (the bot showed its error message) |
answers[] | the bot's bubbles, in order: text, markdown (whether the text is rendered as Markdown), quick_replies (label, postback), buttons, image, asks_for_csat, ai_generated, sources (the passages used by Louis) |
handled_by | who answered: use_case (with use_case_id, use_case_uuid, name), ai_assistant (Louis), misunderstanding (the bot did not understand) or legacy_flow (an answer from a legacy flow of the bot, not a use case). intent_record_id is the intent that triggered the use case, null after a click |
waiting_for | when the bot asks a question: the question, the answer it expects (free_text, email, date, select, regex, file) and the variable_name that receives it |
variables_written | the variables the bot wrote during the turn, with their values |
handover | the handover that would have happened: executed (always false), available (true when an agent was available, null when not checked) and target, the agent tool; otherwise null |
started_at, completed_at, duration_ms | timing of the turn |
trace_id, trace_status, trace | the steps, API calls and variables of the turn, secrets masked. trace_status is available, pending (up to 30 s after the turn), not_found, unavailable or forbidden. ?trace=none leaves the trace out |
warnings[] | what was not executed, called for real, or ignored (see Warnings) |
ended means the use case is over, not the simulation: a next message goes back to the bot as a new message.
Statuses of a simulation
A simulation moves through the statuses below.
status | When |
|---|---|
queued | in a run, waiting for its turn |
running | in progress |
completed | in a run, all its messages were played; by hand, closed with DELETE while no turn was pending |
handed_over | a handover step was reached and not executed |
failed | a turn failed: failure_reason is turn_timeout, turn_error or quick_reply_not_found |
cancelled | the run was cancelled, or the simulation was closed while a turn was pending |
expired | a manual simulation without a message for 15 minutes |
Result of a run
GET /v1/evaluation/runs/{id} returns the fields below.
| Field | Content |
|---|---|
status | queued, running, then completed or cancelled. A run ends completed even when some scenarios failed |
progress | the number of scenarios per status: total, queued, running, completed, handed_over, failed, cancelled, expired |
labels | the labels given when the run started |
simulations[] | one result per scenario: simulation_id, scenario_id, scenario_name, status, final_state (the state of its last finished turn), failure_reason, turns (the number of turns played), handled_by (who answered, without repeats), metadata (yours, as is), messages_unused (the messages never sent because the scenario stopped before) |
Datasets
The rules below apply to POST and PUT /v1/evaluation/datasets.
- 1 to 1,000 scenarios, of 1 to 100 messages each. The use case of each
targetis checked when you save (422 unknown_use_case). PUTreplaces the whole dataset. An unchanged scenario keeps itsscenario_id, a changed one gets a new one. A scenario whose last simulation in a run endedcompletedcannot be changed or removed (409 scenario_completed).DELETEarchives the dataset: it stays readable, but can no longer be run or changed, and leaves the list. Its runs stay readable.- A run can also take its scenarios in its body (
"scenarios": […], each with its target and version) instead of adataset_id.
Warnings
A warning does not fail the turn, except quick_reply_not_found on a click without text. The table below lists them.
| Code | Meaning |
|---|---|
handover_not_executed | a handover to an agent was reported, not executed |
ticket_not_created | a ticket was reported, not created |
external_api_call | an API Call step called your system, for real: one warning per call, with its address without the query. The API tools of Louis and of the Generate with AI steps also call for real, without a warning |
file_simulated | a file message: no real file was sent |
quick_reply_not_found | the click label is not in the previous turn |
invalid_postback | the postback could not be read: the bot showed its error message |
unknown_variable | an unknown custom variable, ignored |
secured_variable_ignored | a secured variable without the evaluation:secured_variables scope, removed |
variable_not_updatable | bot_language or user_channel_type changed after the opening, ignored |
legacy_flow | the answer came from a legacy flow: the turn ends after a short silence |
Errors
Every error of /v1/evaluation/… has the same shape: {"error": {"code": "…", "message": "…", "request_id": "…"}}. Give the request_id to the support team. /oauth/token answers in the OAuth format, {"error": "…", "error_description": "…"}, for example invalid_client or rate_limited. The table below lists the codes.
| HTTP | Code | What to do |
|---|---|---|
| 400 | invalid_request | fix the request: message says what is wrong |
| 401 | invalid_token | get a new token |
| 403 | insufficient_scope | ask a Manager to add the scope to the application |
| 404 | simulation_not_found, turn_not_found, dataset_not_found, run_not_found | unknown identifier, or one of another environment |
| 404 | trace_not_found | unknown trace, not saved yet, or expired |
| 409 | turn_in_progress | wait for the end of the previous turn |
| 409 | simulation_handed_over, simulation_closed | open a new simulation |
| 409 | scenario_completed | keep this scenario as it is in the PUT, and add a new one |
| 410 | simulation_expired | open a new simulation |
| 422 | unknown_use_case, use_case_not_published | check the use case and the version |
| 422 | unsupported_language, no_bot_channel | no bot is set up in this bot_language, or the environment has no bot channel |
| 429 | rate_limited | wait for the time given in the Retry-After header |
| 429 | too_many_active_simulations | 50 simulations are already active: wait for one to end |
| 429 | quota_exceeded | the monthly quota is reached |
| 500 to 504 | internal_error, bad_gateway, trace_unavailable, gateway_timeout | try again later |
Limits
The table below gives the limits of the Evaluation API.
| Limit | Value |
|---|---|
| Token requests | 10 per minute per client ID and secret |
| Calls per token | 20 reads and 5 writes per second (429 rate_limited) |
| Text of a message | 2,000 characters; a longer text is not processed and the bot asks for a shorter one |
| Active simulations per environment | 50, runs and manual simulations together. In a run, the extra scenarios wait; a manual simulation beyond that answers 429 too_many_active_simulations |
| Simulations per month per environment | 20,000 |
| Messages per month per environment | 160,000 |
| Duration of a turn | 60 seconds, then timeout |
| Manual simulation without a message | 15 minutes, then expired |
| Retention of simulations and runs | 90 days after they were created |
Lists and pages
GET /v1/evaluation/simulations, /datasets and /runs return the newest items first; /datasets/{id}/scenarios returns the scenarios in their order. All are paged.
limit: 1 to 100 items, 20 by default. Next page:cursorset to thenext_cursorof the answer,nullon the last page.start_date(included) andend_date(excluded), on simulations, datasets and runs: the creation date, as an ISO 8601 date or time in UTC, for example2026-11-24or2026-11-24T09:00:00Z.statuson simulations and runs,dataset_idon runs.qon datasets and scenarios: a text contained in the name, case insensitive, 200 characters at most.
Next steps
- Test in batch in your CI: run your scenarios in your pipeline.
- Applications: manage the accesses and their scopes.
Updated about 1 hour ago

