Connect API Resources for Testing API

The Connect API endpoints for Testing API execute test cases, poll for results, and programmatically retrieve detailed test results.

Start a test asynchronously based on the provided AiEvaluationDefinition name or ID. This endpoint schedules the test and returns an identifier to track its progress. OAuth 2.0 with a connected app is required. See the Connect REST API Quick Start.

POST

The API enforces that exactly one of the two parameters is provided. If no parameters or multiple parameters are provided, the API returns a 400 Bad Request response code with an empty error message.

Parameter NameTypeDescription
aiEvaluationDefinitionNamestringRequired. The name (DeveloperName) of the test definition to start.

HTTP response code: 200

Parameter NameTypeDescription
runIdstringThe unique ID of the test that started.

Retrieves the operational status of a specified test. We designed this endpoint to poll to monitor the progress of a test.

GET

Parameter NameTypeDescription
runIdstringRequired. The unique identifier for the test.
Parameter NameTypeDescription
statusenum
  • NEW: The test was created but not yet started.
  • IN_PROGRESS: The test is currently executing.
  • COMPLETED: The test finished successfully.
  • ERROR: At least one test case encountered an operational error.
startTimeISO 8601 timestampThe timestamp indicating when the test started.
endTimeISO 8601 timestampThe timestamp indicating when the test ended. endTime is null if the test hasn't ended yet.
errorMessagestringThe details of the error if the status is ERROR. errorMessage is empty if no error occurred.

Retrieve a detailed report of a test, including information on each test case and the results of all predetermined expectations.

GET

Parameter NameTypeDescription
runIdstringRequired. The unique identifier of the test.
Parameter NameTypeDescription
statusenum
  • NEW: The test was created but not yet started.
  • IN_PROGRESS: The test is currently executing.
  • COMPLETED: The test finished successfully.
  • ERROR: At least one test case encountered an operational error.
startTimeISO 8601 timestampThe timestamp indicating when the test started.
endTimeISO 8601 timestampThe timestamp indicating when the test ended. endTime is null if the test hasn't ended yet.
errorMessagestringThe details of the error if the status is ERROR. errorMessage is empty if no error occurred.
testCasesTestCaseObjectRepresents the test cases being evaluated.
Parameter NameTypeDescription
statusenum
  • NEW: The test has been created but not yet started.
  • IN_PROGRESS: The test is currently executing.
  • COMPLETED: The test finished successfully.
  • ERROR: At least one test case encountered an operational error.
testNumberintegerThe number of the test case.
subjectNamestringA unique identifier for the subject. This should be the DeveloperName of the AiEvalDefinition entity.
startTimeISO 8601 timestampThe timestamp indicating when the test started.
endTimeISO 8601 timestampThe timestamp indicating when the test ended. endTime is null if the test hasn't ended yet.
errorMessagestringDetails of the error if the status is ERROR. errorMessage is empty if no error occurred.
inputsInputsObjectRepresents the inputs sent to the agent.
generatedDataGeneratedDataObjectRepresents the data that was generated by the subject during the test and was used to evaluate the expectations.
testResultsarray[TestResultObject]Includes the results of each test.
Parameter NameTypeDescription
utterancestringThe utterance sent to the agent.
Parameter NameTypeDescription
actionsSequencearray[string]A sequence of actions performed during the test.
outcomestringThe result response of the subject under test.
topicstringThe topic used by the subject during testing.
Parameter NameTypeDescription
namestringThe name of the test metric.
actualValuestringThe actual value obtained during the test.
expectedValuestringThe expected value for the metric.
scorefloatReserved for internal use.
resultstringThe result of the test. Supported values are:
  • PASS
  • FAILED
metricLabelstringA label describing the metric.
metricExplainabilitystringA detailed explanation of the metric's purpose and test criteria.
statusstring
  • NEW: The test has been created but not yet started
  • IN_PROGRESS: The test is currently executing
  • COMPLETED: The test finished successfully
  • ERROR: At least one test case encountered an operational error
startTimeISO 8601 timestampThe timestamp when the test of this metric started.
endTimeISO 8601 timestampThe timestamp when the test of this metric ended.
errorCodestring or nullThe error code if an error occurred during the test; otherwise, null.
errorMessagestring or nullA detailed error message if an error occurred during the test; otherwise, null.