Skip to content
Get started

Complete a dataset upload and trigger processing

client.datasets.upload.complete(UploadCompleteParams { file_format, file_size_bytes, name, s3_key } body, RequestOptionsoptions?): UploadCompleteResponse { dataset_id }
POST/api/v1/datasets/upload/complete

Complete a dataset upload and trigger processing

ParametersExpand Collapse
body: UploadCompleteParams { file_format, file_size_bytes, name, s3_key }
file_format: "csv" | "json" | "jsonl" | "parquet"

Format of the uploaded file

One of the following:
"csv"
"json"
"jsonl"
"parquet"
file_size_bytes: number

Size of the uploaded file in bytes

minimum0
maximum2147483648
name: string

Human-readable name for the dataset

s3_key: string

S3 object key returned in the pre-signed URL response from /upload/initiate

ReturnsExpand Collapse
UploadCompleteResponse { dataset_id }
dataset_id: string

ID of the newly created dataset

Complete a dataset upload and trigger processing

import Adaption from 'adaption';

const client = new Adaption({
  apiKey: process.env['ADAPTION_API_KEY'], // This is the default and can be omitted
});

const response = await client.datasets.upload.complete({
  file_format: 'csv',
  file_size_bytes: 1048576,
  name: 'my-training-data',
  s3_key: 'uploads/550e8400-e29b-41d4-a716-446655440000/my-training-data.csv',
});

console.log(response.dataset_id);
{
  "dataset_id": "550e8400-e29b-41d4-a716-446655440000"
}
Returns Examples
{
  "dataset_id": "550e8400-e29b-41d4-a716-446655440000"
}