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.

ScopeAllows
evaluation:readreading simulations, turns, traces, datasets, scenarios and runs
evaluation:writeopening, feeding and closing simulations, creating, replacing and archiving datasets, starting and cancelling runs
evaluation:secured_variableswith 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.

CallScopeUse
POST /oauth/tokennoneget a token, valid for 1 hour, with the client ID and the secret in an Authorization: Basic header
GET /v1/evaluation/meanycheck a token: application name, scopes, seconds left
POST /v1/evaluation/simulationswriteopen a simulation
GET /v1/evaluation/simulationsreadlist your manual simulations, without their turns
GET /v1/evaluation/simulations/{id}readread a simulation with all its turns
POST /v1/evaluation/simulations/{id}/messageswritesend a message
GET /v1/evaluation/simulations/{id}/turns/{n}readread one turn, with its trace
DELETE /v1/evaluation/simulations/{id}writeclose a simulation
GET /v1/evaluation/trace/{trace_id}readread the trace of a turn later
POST /v1/evaluation/datasetswritecreate a dataset
GET /v1/evaluation/datasetsreadlist the datasets that are not archived
GET /v1/evaluation/datasets/{id}readread a dataset, without its scenarios
GET /v1/evaluation/datasets/{id}/scenariosreadread the scenarios of a dataset, with their scenario_id
PUT /v1/evaluation/datasets/{id}writereplace a dataset, with the same body as the creation
DELETE /v1/evaluation/datasets/{id}writearchive a dataset
POST /v1/evaluation/runswritestart a run
GET /v1/evaluation/runsreadlist the runs
GET /v1/evaluation/runs/{id}readread a run with the result of each scenario
POST /v1/evaluation/runs/{id}/cancelwritecancel 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.

targetThe 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_case target, 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 the bot target with a first message that triggers it.

The second table describes the versions.

versionWhat is played
draftthe last saved version of the use cases, published or not
livethe 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.

MessageEffect
{"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.expects is select) only accepts a click or a postback: 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_event or /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.

CategoryContent
systemsystem 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_channelthe variables your website sends to the widget, by their name
customthe custom variables of the bot, by their name. An unknown name is ignored (warning unknown_variable)
  • bot_language and user_channel_type are set when the simulation opens. Changing them later is ignored (warning variable_not_updatable). Another system variable 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 (warning secured_variable_ignored).

Fields of a turn

GET /v1/evaluation/simulations/{id}/turns/{n} returns the fields below.

FieldContent
turn0 for the opening of a use case, then 1, 2… for each of your messages
statuspending (read again later), completed, timeout (no answer in 60 s) or error
sent_ashow your message was sent: text, click, postback or file; null for turn 0
statewhere 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_bywho 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_forwhen 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_writtenthe variables the bot wrote during the turn, with their values
handoverthe 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_mstiming of the turn
trace_id, trace_status, tracethe 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.

statusWhen
queuedin a run, waiting for its turn
runningin progress
completedin a run, all its messages were played; by hand, closed with DELETE while no turn was pending
handed_overa handover step was reached and not executed
faileda turn failed: failure_reason is turn_timeout, turn_error or quick_reply_not_found
cancelledthe run was cancelled, or the simulation was closed while a turn was pending
expireda manual simulation without a message for 15 minutes

Result of a run

GET /v1/evaluation/runs/{id} returns the fields below.

FieldContent
statusqueued, running, then completed or cancelled. A run ends completed even when some scenarios failed
progressthe number of scenarios per status: total, queued, running, completed, handed_over, failed, cancelled, expired
labelsthe 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 target is checked when you save (422 unknown_use_case).
  • PUT replaces the whole dataset. An unchanged scenario keeps its scenario_id, a changed one gets a new one. A scenario whose last simulation in a run ended completed cannot be changed or removed (409 scenario_completed).
  • DELETE archives 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 a dataset_id.

Warnings

A warning does not fail the turn, except quick_reply_not_found on a click without text. The table below lists them.

CodeMeaning
handover_not_executeda handover to an agent was reported, not executed
ticket_not_createda ticket was reported, not created
external_api_callan 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_simulateda file message: no real file was sent
quick_reply_not_foundthe click label is not in the previous turn
invalid_postbackthe postback could not be read: the bot showed its error message
unknown_variablean unknown custom variable, ignored
secured_variable_ignoreda secured variable without the evaluation:secured_variables scope, removed
variable_not_updatablebot_language or user_channel_type changed after the opening, ignored
legacy_flowthe 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.

HTTPCodeWhat to do
400invalid_requestfix the request: message says what is wrong
401invalid_tokenget a new token
403insufficient_scopeask a Manager to add the scope to the application
404simulation_not_found, turn_not_found, dataset_not_found, run_not_foundunknown identifier, or one of another environment
404trace_not_foundunknown trace, not saved yet, or expired
409turn_in_progresswait for the end of the previous turn
409simulation_handed_over, simulation_closedopen a new simulation
409scenario_completedkeep this scenario as it is in the PUT, and add a new one
410simulation_expiredopen a new simulation
422unknown_use_case, use_case_not_publishedcheck the use case and the version
422unsupported_language, no_bot_channelno bot is set up in this bot_language, or the environment has no bot channel
429rate_limitedwait for the time given in the Retry-After header
429too_many_active_simulations50 simulations are already active: wait for one to end
429quota_exceededthe monthly quota is reached
500 to 504internal_error, bad_gateway, trace_unavailable, gateway_timeouttry again later

Limits

The table below gives the limits of the Evaluation API.

LimitValue
Token requests10 per minute per client ID and secret
Calls per token20 reads and 5 writes per second (429 rate_limited)
Text of a message2,000 characters; a longer text is not processed and the bot asks for a shorter one
Active simulations per environment50, 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 environment20,000
Messages per month per environment160,000
Duration of a turn60 seconds, then timeout
Manual simulation without a message15 minutes, then expired
Retention of simulations and runs90 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: cursor set to the next_cursor of the answer, null on the last page.
  • start_date (included) and end_date (excluded), on simulations, datasets and runs: the creation date, as an ISO 8601 date or time in UTC, for example 2026-11-24 or 2026-11-24T09:00:00Z.
  • status on simulations and runs, dataset_id on runs.
  • q on datasets and scenarios: a text contained in the name, case insensitive, 200 characters at most.

Next steps


Did this page help you?