Skip to main content
POST
/
api
/
v1
/
dataset
/
upload
Upload New Dataset
curl --request POST \
  --url https://api.collinear.ai/api/v1/dataset/upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'dataset_name=<string>' \
  --form space_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
  --form file=@example-file
"<any>"
Use this endpoint to create or append datasets that appear under Datasets in the platform. It accepts JSON/CSV files and is the standard ingestion method outside the Assess pipeline.

Parameters

  • file: The file should be in JSON/CSV Format
  • space_id: The unique identifier for your space.
  • dataset_name: The name of your dataset
If you are creating a new dataset your file must be a JSON array. Each row supports the following keys:
  • conv_prefix: conversation turns in OpenAI chat format.
  • response: the assistant turn you want to store.
  • ground_truth: integer labels only (for example 1 for correct, 0 for incorrect). Sending strings will raise 400 Bad Request with the message invalid input for query argument.
  • context: optional metadata string.
Example payload:
[
  {
    "conv_prefix": [{"role": "user", "content": "Hey how are you?"}],
    "response": {"role": "assistant", "content": "I'm good, how are you?"},
    "ground_truth": 1,
    "context": "greeting"
  },
  {
    "conv_prefix": [{"role": "user", "content": "Hey how are you?"}],
    "response": {"role": "assistant", "content": "I'm bad, how are you?"},
    "ground_truth": 0,
    "context": "follow_up"
  }
]

Response shape

The current deployment streams the uploaded rows back in the body instead of the { "dataset_id": ..., "message": ... } object documented in the OpenAPI schema. Each array element will include an auto-generated id that you can use with the judge endpoints.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
file
file
required
dataset_name
string
required
space_id
string<uuid>
required

Response

Successful Response

The response is of type any.

I