Skip to main content
POST
Create test case

Authorizations

X-API-Key
string
header
required

Organization API key for authentication

Headers

X-Coval-Workspace-Id
string

Workspace that scopes this operation. When omitted, the organization's active default workspace is used when one can be resolved.

Required string length: 1 - 26

Body

application/json

Request body for creating a test case

input_str
string
required

Input for the test case

Minimum string length: 1
Example:

"What is the weather today?"

test_set_id
string
required

Test set ID (REQUIRED in body, not URL)

Required string length: 8
Example:

"abc12345"

input_type
enum<string> | null
default:SCENARIO

Type of input for the test case. SCRIPT requires non-empty script_turns. Changing input_type from SCRIPT to another value clears script_turns. IVR_CRAWL is crawler-managed and cannot be selected through this API.

Available options:
SCENARIO,
TRANSCRIPT,
IVR,
AUDIO,
MANUAL,
SCRIPT
Example:

"SCENARIO"

simulation_metadata_input
object

Legacy simulation metadata. For SCRIPT cases, use the top-level script_turns field. A nested script_turns input remains accepted for backward compatibility but is deprecated.

expected_behaviors
string[] | null

Expected behaviors (list of strings). This is the preferred field.

Example:
expected_output_str
string | null

DEPRECATED: Use expected_behaviors instead. If provided and expected_behaviors is not, this value will be wrapped in a list and used as expected_behaviors.

Example:

"The weather is sunny."

expected_output_json
object

Expected output as JSON object

description
string | null

Human-readable description

Example:

"Test case for weather query"

script_turns
string · object · object · object[] | null

Ordered persona turns. For new integrations, provide a non-empty top-level array when input_type is SCRIPT and omit it otherwise. Changing input_type away from SCRIPT clears this field. Each entry is either a bare string (spoken text), {"type": "text", "text": ...} (spoken text, explicit form), {"type": "dtmf", "digits": ...} (keypad presses; digits 0-9, *, #, and phone punctuation), or {"type": "skip"} (the persona stays silent for one turn).

Spoken text (legacy bare-string form)

Minimum string length: 1
metric_input
object

Input for metrics

user_notes
string | null

User notes

Example:

"Created for regression testing"

Response

Test case created successfully

test_case
object

Test case resource.