POST
/
v1
/
testset
curl --request POST \
  --url https://api.getscorecard.ai/v1/testset \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "name": "Example Testset",
  "description": "A testset to finally confirm if the moon is made of cheese.",
  "using_retrieval": true,
  "custom_schema": {
    "variables": [
      {
        "data_type": "file_url",
        "description": "example file url",
        "name": "example_file_url",
        "role": "input"
      },
      {
        "data_type": "json_object",
        "description": "example json object",
        "name": "example_json_object",
        "role": "output"
      },
      {
        "data_type": "text",
        "description": "example text",
        "name": "example_text",
        "role": "label"
      }
    ]
  },
  "project_id": 123,
  "ingestion_method": "csv",
  "published": true,
  "created_by_playground": true
}'
{
  "id": 1,
  "created_at": "2025-02-06T00:05:50.224015",
  "name": "Example Testset",
  "description": "A testset to finally confirm if the moon is made of cheese.",
  "using_retrieval": true,
  "ingestion_method": "manual",
  "num_testcases": 10,
  "published": true,
  "updated_at": "2025-02-07T00:05:50.224392",
  "is_archived": true,
  "project_id": 1,
  "custom_schema": {
    "variables": [
      {
        "data_type": "file_url",
        "description": "example file url",
        "name": "example_file_url",
        "role": "input"
      },
      {
        "data_type": "json_object",
        "description": "example json object",
        "name": "example_json_object",
        "role": "output"
      },
      {
        "data_type": "text",
        "description": "example text",
        "name": "example_text",
        "role": "label"
      }
    ]
  },
  "created_by_playground": true
}

Authorizations

X-API-Key
string
header
required

Body

application/json
name
string
required
description
string | null

A description for the testset.

using_retrieval
boolean | null

Whether or not the testset uses retrieval.

custom_schema
object | null

Custom schema model with an ordered list of custom variables.

project_id
integer | null

The ID of the project to create the testset in. Omitting this optional argument will create the testset inside your Organization's default project.

ingestion_method
enum<string> | null
default:
logging

The method of ingestion for the testset.

Available options:
csv,
logging
published
boolean | null
default:
false

Whether or not the testset is published.

created_by_playground
boolean | null
default:
false

Whether or not the testset was created by the playground.

Response

200
application/json
Successful Response
id
integer | null

The ID of the testset.

created_at
string | null

The creation date and time of the testset.

name
string | null

A human-readable name for the testset. This will be displayed in the UI.

description
string | null

A description for the testset.

using_retrieval
boolean | null

Whether or not the testset uses retrieval.

ingestion_method
string | null

The method used to ingest the testset.

num_testcases
integer | null
default:
0

The number of testcases in the testset.

published
boolean | null

Whether or not the testset is published.

updated_at
string | null

The last time the testset was updated.

is_archived
boolean | null
default:
false

Whether or not the testset is archived.

project_id
integer | null

The ID of the project the testset belongs to.

custom_schema
object | null

Custom schema model with an ordered list of custom variables.

created_by_playground
boolean | null
default:
false

Whether or not the testset was created by the playground.