POST
/
v1
/
testset
/
{testset_id}
/
testcase
curl --request POST \
  --url https://api.getscorecard.ai/v1/testset/{testset_id}/testcase \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "user_query": "What is the moon made of?",
  "context": "After the Apollo missions, we know the moon is made of cheese.",
  "ideal": "The moon is made of rock.",
  "custom_inputs": {},
  "custom_labels": {}
}'
{
  "id": 100,
  "created_at": "2025-02-07T00:05:50.184396",
  "testset_id": 123,
  "user_query": "What is the moon made of?",
  "context": "After the Apollo missions, we know the moon is made of cheese.",
  "ideal": "The moon is made of rock.",
  "custom_inputs": {},
  "custom_labels": {}
}

Authorizations

X-API-Key
string
header
required

Path Parameters

testset_id
integer
required

The ID of the Testset to create the Testcase in.

Body

application/json
user_query
string

The user query to be executed.

context
string | null

The context to be used while generating the testcase.

ideal
string | null

The ideal response to the user query.

custom_inputs
object | null
custom_labels
object | null

Response

200
application/json
Successful Response
testset_id
integer
required

The ID of the testset the testcase belongs to.

user_query
string
required

The user query for the testcase.

id
integer | null

The ID of the testcase.

created_at
string | null

The creation date and time of the testcase.

context
string | null

The context for the testcase.

ideal
string | null

The ideal response for the testcase.

custom_inputs
object | null
custom_labels
object | null