## Create a dataset from file upload, HuggingFace, or Kaggle `client.datasets.create(DatasetCreateParamsbody, RequestOptionsoptions?): DatasetCreateResponse` **post** `/api/v1/datasets` Unified ingest endpoint. Discriminated by source.type: "file" returns upload instructions for a presigned S3 PUT, "huggingface" and "kaggle" start an async import. ### Parameters - `body: DatasetCreateParams` - `source: FileSourceDto | HuggingfaceSourceDto | KaggleSourceDto` Dataset source configuration. Discriminated by `type`: file, huggingface, or kaggle. - `FileSourceDto` - `file_format: "csv" | "json" | "jsonl" | "parquet"` Format of the file being uploaded - `"csv"` - `"json"` - `"jsonl"` - `"parquet"` - `name: string` Human-readable name for the dataset - `type: "file"` Source type - `"file"` - `HuggingfaceSourceDto` - `files: Array` File paths to download from the repository - `type: "huggingface"` Source type - `"huggingface"` - `url: string` HuggingFace dataset repository URL - `KaggleSourceDto` - `files: Array` File paths to download from the dataset - `type: "kaggle"` Source type - `"kaggle"` - `url: string` Kaggle dataset URL ### Returns - `DatasetCreateResponse` - `dataset_id: string` ID of the newly created dataset - `status: string` Current dataset status - `upload_instructions?: UploadInstructions` Upload instructions for file sources. PUT your file to the provided URL. - `method: string` HTTP method to use - `s3_key: string` S3 object key — pass this back in the complete request if needed for verification - `url: string` Pre-signed URL for uploading the file ### Example ```typescript import Adaption from 'adaption'; const client = new Adaption({ apiKey: process.env['ADAPTION_API_KEY'], // This is the default and can be omitted }); const dataset = await client.datasets.create({ source: { file_format: 'csv', name: 'my-training-data', type: 'file', }, }); console.log(dataset.dataset_id); ``` #### Response ```json { "dataset_id": "dataset_id", "status": "status", "upload_instructions": { "method": "PUT", "s3_key": "s3_key", "url": "https://s3.amazonaws.com/bucket/key?X-Amz-Signature=..." } } ```