Skip to content
Get started

Initiate a dataset upload

datasets.upload.initiate(UploadInitiateParams**kwargs) -> UploadInitiateResponse
POST/api/v1/datasets/upload/initiate

Initiate a dataset upload

ParametersExpand Collapse
file_format: Literal["csv", "json", "jsonl", "parquet"]

Format of the file being uploaded

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

Human-readable name for the dataset

ReturnsExpand Collapse
class UploadInitiateResponse:
upload_url: str

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

Initiate a dataset upload

import os
from adaption import Adaption

client = Adaption(
    api_key=os.environ.get("ADAPTION_API_KEY"),  # This is the default and can be omitted
)
response = client.datasets.upload.initiate(
    file_format="csv",
    name="my-training-data",
)
print(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=..."
}