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
Example:

"Example Testset"

description
string | null

A description for the testset.

Example:

"A testset to finally confirm if the moon is made of cheese."

using_retrieval
boolean | null

Whether or not the testset uses retrieval.

Example:

true

custom_schema
object | null

Custom schema model with an ordered list of custom variables.

Example:
{
  "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
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.

Example:

123

ingestion_method
enum<string> | null
default:logging

The method of ingestion for the testset.

Available options:
csv,
logging
Example:

"csv"

published
boolean | null
default:false

Whether or not the testset is published.

Example:

true

created_by_playground
boolean | null
default:false

Whether or not the testset was created by the playground.

Example:

true

Response

200
application/json
Successful Response
id
integer | null

The ID of the testset.

Example:

1

created_at
string | null

The creation date and time of the testset.

Example:

"2025-02-06T00:05:50.224015"

name
string | null

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

Example:

"Example Testset"

description
string | null

A description for the testset.

Example:

"A testset to finally confirm if the moon is made of cheese."

using_retrieval
boolean | null

Whether or not the testset uses retrieval.

Example:

true

ingestion_method
string | null

The method used to ingest the testset.

Example:

"manual"

num_testcases
integer | null
default:0

The number of testcases in the testset.

Example:

10

published
boolean | null

Whether or not the testset is published.

Example:

true

updated_at
string | null

The last time the testset was updated.

Example:

"2025-02-07T00:05:50.224392"

is_archived
boolean | null
default:false

Whether or not the testset is archived.

Example:

true

project_id
integer | null

The ID of the project the testset belongs to.

Example:

1

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.

Example:

true