v1

latestOpenAPI 3.0.12026-07-226992320.0 KB
Test Cases

Create Test Case

Creates a simulation test case for the specified agent. Define the scenario using user persona, goals, and evaluation criteria. Returns the created test case, including its testCaseId for subsequent get, update, delete, and batch-run calls.

post/v1/test-cases

Request body

labelstring

A human-readable name or label for the test case, used to identify it in reports and dashboards.

agentIdstring required

The unique identifier of the Agent that will respond during the chat simulation.

llmModel'gpt-5.2' | 'gpt-5.2-fast-tier' | 'gpt-5.1' | 'gpt-5.1-fast-tier' | 'gpt-5' | 'gpt-5-fast-tier' | 'gpt-5-mini' | 'gpt-5-mini-fast-tier' | 'gpt-5-nano' | 'gpt-4.1' | 'gpt-4.1-fast-tier' | 'gpt-4.1-mini' | 'gpt-4.1-mini-fast-tier' | 'gpt-4.1-nano' | 'gpt-4.1-nano-fast-tier' | 'gpt-4o' | 'gpt-4o-fast-tier' | 'gpt-4o-mini' | 'gpt-4o-mini-fast-tier' | 'claude-haiku-4-5-20251001' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-20250514' | 'gemini-3.1-flash-lite-preview' | 'gemini-3-flash-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash'

The LLM model used to generate Agent responses during the simulation. To use OpenAI priority tier models, append '-fast-tier' to the model name (e.g., 'gpt-4o-mini-fast-tier').

userPromptstring required

A prompt that defines the persona and intent of the simulated user. This drives the user-side messages throughout the conversation.

attemptinteger

The number of times this test case should be executed. Each run is an independent simulation. Defaults to 1.

successCriteriastring required

A plain-language description of what a successful agent response looks like. Used to evaluate the agent's performance after each simulation run.

Example request

{
  "label": "Angry Customer - Cancellation Flow",
  "agentId": "D5D0p7TUs66TTAEAx",
  "llmModel": "gpt-4o-mini",
  "mockData": [
    {
      "variableName": "customer_name",
      "value": "John Doe"
    },
    {
      "variableName": "account_status",
      "value": "active"
    }
  ],
  "userPrompt": "You are an angry customer who wants to cancel their subscription.",
  "attempt": 5,
  "successCriteria": "The agent should acknowledge the cancellation request, present retention alternatives, and confirm the cancellation if the customer insists."
}

Response

Created

testCaseIdstring

The unique identifier of the test case.

labelstring

A human-readable name or label for the test case, used to identify it in reports and dashboards.

workspaceIdstring

The unique identifier of the workspace under which this test case was created.

llmModelstring

The LLM model used to generate Agent responses during the simulation.

userPromptstring

The prompt that defined the persona and intent of the simulated user, driving the user-side messages throughout the conversation.

attemptinteger

The number of times this test case was configured to run as independent simulation attempts.

successCriteriastring

The plain-language description of what a successful agent response looks like, used to evaluate the agent's performance after each simulation run.

Example response

{
  "testCaseId": "tc_d17T6uReChpyfFeP",
  "label": "Angry Customer - Cancellation Flow",
  "agent": {
    "name": "New AI Agent",
    "agentId": "agent_D5D0p7TUs66TTAEAx",
    "status": "Live"
  },
  "workspaceId": "org_V6eZ2zg8ziDx5pft",
  "llmModel": "gpt-4o-mini",
  "mockData": [
    {
      "variableName": "customer_name",
      "value": "John Doe"
    },
    {
      "variableName": "account_status",
      "value": "active"
    }
  ],
  "userPrompt": "You are an angry customer who wants to cancel your subscription.",
  "attempt": 5,
  "successCriteria": "The agent should acknowledge the cancellation request, present retention alternatives, and confirm the cancellation if the customer insists."
}