Upload Dataset from File
Create a new dataset by uploading a local file.
POST
https://api.futureagi.com/model-hub/develops/create-dataset-from-local-file/ Authentication
Request Body
This endpoint accepts multipart/form-data.
file
The file to upload. Supported formats: .csv, .xls, .xlsx, .json, .jsonl.
new_dataset_name
Name for the dataset. Must be unique within your organization.
Response
Returns the created dataset details. The file is processed asynchronously in the background.
message
Confirmation message.
dataset_id
UUID of the newly created dataset.
dataset_name
Name of the created dataset.
processing_status
Current processing status.
estimated_rows
Estimated number of rows detected in the file.
estimated_columns
Estimated number of columns detected in the file.
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"