---
title: "Create Test Case"
method: POST
path: "/v1/test-cases"
tags: ["Test Cases"]
---

# Create Test Case

`POST /v1/test-cases`

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.

## Request body

- CreateTestCaseRequest
  - `label` string — A human-readable name or label for the test case, used to identify it in reports and dashboards.
  - `agentId` string, 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').
  - `mockData` MockDataRequest[] — A list of mock variables that substitute for real external data sources during the simulation. Each entry defines a variable name and its simulated value.
    - `variableName` string — The name of the variable to be substituted with mock data during the simulation. Must match the variable name defined in the Agent's configuration.
    - `value` string — The simulated value assigned to the variable for the duration of the test run.
  - `userPrompt` string, required — A prompt that defines the persona and intent of the simulated user. This drives the user-side messages throughout the conversation.
  - `attempt` integer — The number of times this test case should be executed. Each run is an independent simulation. Defaults to 1.
  - `successCriteria` string, required — A plain-language description of what a successful agent response looks like. Used to evaluate the agent's performance after each simulation run.

## Response `201`

Created

- TestCaseResponse
  - `testCaseId` string — The unique identifier of the test case.
  - `label` string — A human-readable name or label for the test case, used to identify it in reports and dashboards.
  - `agent` AgentResponse — Agent assigned to handle all calls in this campaign. Contains the agent's ID, name, and current status. All contacts in the campaign's contact list will be called using this agent.
    - `name` string — The display name of the assigned agent.
    - `agentId` string — The unique identifier of the agent within the system.
    - `status` 'Live' | 'Testing' | 'Disabled' — The current operational status of the agent.
  - `workspaceId` string — The unique identifier of the workspace under which this test case was created.
  - `llmModel` string — The LLM model used to generate Agent responses during the simulation.
  - `mockData` MockDataResponse[] — The list of mock variables and their simulated values that were used to substitute for real external data sources during the simulation.
    - `variableName` string — The name of the variable that was substituted with mock data during the simulation.
    - `value` string — The simulated value that was assigned to the variable for the duration of the test run.
  - `userPrompt` string — The prompt that defined the persona and intent of the simulated user, driving the user-side messages throughout the conversation.
  - `attempt` integer — The number of times this test case was configured to run as independent simulation attempts.
  - `successCriteria` string — The plain-language description of what a successful agent response looks like, used to evaluate the agent's performance after each simulation run.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/sigmamind/apis/sigmamind-apis.md) · [All operations](https://skmtc.net/sigmamind/apis/sigmamind-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sigmamind/sigmamind-apis/versions/d00f52b5123f/schema)
