Upload Dataset from File
Create a new dataset by uploading a local CSV or JSONL file as multipart form data. Returns the new dataset ID and row count.
https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/ Authentication
Request Body
This endpoint accepts multipart/form-data.
The file to upload. Supported formats: .csv, .xls, .xlsx, .json, .jsonl.
Response
Returns the created dataset details. The file is processed asynchronously in the background.
Example Response
{
"message": "Dataset creation started successfully. Processing in background.",
"dataset_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"dataset_name": "My Uploaded Dataset",
"processing_status": "queued",
"estimated_rows": 150,
"estimated_columns": 5
}
Responses
200
Dataset creation started successfully. The file has been uploaded and is being processed in the background.
400
Bad request. Possible reasons:
- No file uploaded - The
filefield is required. - File too large - File size exceeds the 10 MB limit.
- Unsupported file format - Only
.csv,.xls,.xlsx,.json, and.jsonlfiles are supported. - Duplicate name - A dataset with this name already exists in your organization.
- File processing error - The file could not be parsed.
401
Invalid or missing API credentials.
429
Resource limit reached. Your organization has exceeded the dataset creation or row addition quota.
500
Internal server error. Failed to create the dataset from the uploaded file.
Code Examples
import requests
url = "https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"X-Secret-Key": "YOUR_SECRET_KEY"
}
files = {
"file": ("data.csv", open("data.csv", "rb"), "text/csv")
}
data = {
"new_dataset_name": "My Uploaded Dataset"
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())const formData = new FormData();
formData.append("file", fileInput.files[0]);
formData.append("new_dataset_name", "My Uploaded Dataset");
const response = await fetch(
"https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/",
{
method: "POST",
headers: {
"X-Api-Key": "YOUR_API_KEY",
"X-Secret-Key": "YOUR_SECRET_KEY"
},
body: formData
}
);
const data = await response.json();
console.log(data);curl -X POST "https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Secret-Key: YOUR_SECRET_KEY" \
-F "file=@data.csv" \
-F "new_dataset_name=My Uploaded Dataset"