Skip to main content
POST
cURL
Create one or more test cases for a prompt. Test cases can be used to validate prompt performance and ensure consistent output across different scenarios.

Create a Test Case

Create Multiple Test Cases

Request Body

The request body can be either a single test case object or an array of test case objects.

Test Case Object

Message Object

File Object

Response

The response will contain the created test case(s) with all fields including the generated IDs and timestamps.

Body

application/json
variablesRichContent
object
required

Key-value pairs of rich content variables

promptId
string<uuid>
required

UUID of the prompt to create test cases for

messages
object[]
required

Array of message objects with role and content

title
string

Title of the test case

expectedOutput
string | null

Expected output for evaluation purposes

promptApplicationId
string<uuid> | null

UUID of the prompt application if applicable

variables
object | null

Key-value pairs of variables used in the test case

files
object[] | null

Array of file objects to attach to the test case

metadata
object

Metadata about the test case

Response

200

Test case(s) created successfully