Skip to content
Get started

Initiate a dataset upload

client.datasets.upload.initiate(UploadInitiateParams { file_format, name } body, RequestOptionsoptions?): UploadInitiateResponse { upload_url }
POST/api/v1/datasets/upload/initiate

Initiate a dataset upload

ParametersExpand Collapse
body: UploadInitiateParams { file_format, name }
file_format: "csv" | "json" | "jsonl" | "parquet"

Format of the file being uploaded

One of the following:
"csv"
"json"
"jsonl"
"parquet"
name: string

Human-readable name for the dataset

ReturnsExpand Collapse
UploadInitiateResponse { upload_url }
upload_url: string

Pre-signed S3 URL — upload the file directly to this URL via HTTP PUT

Initiate a dataset upload

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.initiate({
  file_format: 'csv',
  name: 'my-training-data',
});

console.log(response.upload_url);
{
  "upload_url": "https://s3.amazonaws.com/bucket/key?X-Amz-Signature=..."
}
Returns Examples
{
  "upload_url": "https://s3.amazonaws.com/bucket/key?X-Amz-Signature=..."
}