POST
/
dataset
/
{id}
curl --request POST \
--url "https://api.coval.dev/dataset/{id}" \
--header "x-api-key: $COVAL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "body": {
    "action": "append",
    "input_strs": [
      {"role": "assistant", "content": "Welcome to X Restaurant. How may I assist you today?"},
      {"role": "user", "content": "I would like to order some pizza."}
    ],
    "output_strs": [{"role": "assistant", "content": "Welcome to X Restaurant. How may I assist you today?"},
      {"role": "user", "content": "I would like to order some pizza."}]
  }
}'
{
  "message": "2 Rows added successfully",
  "dataset_id": 123
}
curl --request POST \
--url "https://api.coval.dev/dataset/{id}" \
--header "x-api-key: $COVAL_API_KEY" \
--header "Content-Type: application/json" \
--data '{
  "body": {
    "action": "append",
    "input_strs": [
      {"role": "assistant", "content": "Welcome to X Restaurant. How may I assist you today?"},
      {"role": "user", "content": "I would like to order some pizza."}
    ],
    "output_strs": [{"role": "assistant", "content": "Welcome to X Restaurant. How may I assist you today?"},
      {"role": "user", "content": "I would like to order some pizza."}]
  }
}'

Path Parameters

id
string
required

Body

application/json
Dataset details to create
action
enum<string>
required

Action to perform on the dataset.

Available options:
replace,
append
input_strs
string[]
required

List of input strings to be added for testing.

output_strs
string[]
required

List of expected output strings corresponding to the input strings.

Response

200 - application/json
Dataset created/identified successfully
message
string
dataset_id
integer

ID of the created/identified dataset