Uploading large files into Multi FileFeeds
This guide walks you through uploading files to a Multi FileFeed (MFF) import using direct uploads. Direct uploads let your client send files straight to cloud storage via presigned URLs, avoiding the need to proxy large files through the API server.
Step 1 — Create a Multi FileFeed Import
Create a new import on the target Multi FileFeed. This returns an import object whose id you will use in all subsequent calls.
POST /v0/workflows/{multi_file_feed_id}/imports
curl -X POST "https://api.oneschema.co/v0/workflows/42/imports" \
-H "X-API-KEY: YOUR_API_KEY"Response
{
"id": 101,
"multi_file_feed_id": 42,
"status": "initialized",
"created_at": "2026-03-02T12:00:00Z"
}Save the returned id — this is your multi_file_feed_import_id used in all following steps.
API reference: Create a Multi FileFeed import
Step 2 — Upload Files
Repeat steps 2a–2c for every file you need to add to the import.
Step 2a — Create a Direct Upload
Request a presigned URL for the file you want to upload. Pass the filename in the request body — it must be unique within the import.
POST /v0/workflows/{multi_file_feed_id}/imports/{multi_file_feed_import_id}/direct-uploads
curl -X POST "https://api.oneschema.co/v0/workflows/42/imports/101/direct-uploads" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filename": "orders.csv"}'Response
{
"upload_id": 555,
"presigned_url": "https://storage.example.com/bucket/path?signature=abc123",
"content_type": "text/csv"
}Hold on to all three values — you need them in the next steps.
API reference: Create a direct file upload for a Multi FileFeed import
Step 2b — Upload the File to the Presigned URL
Upload the file directly to cloud storage using the presigned_url from Step 2a. You must set the Content-Type header to the exact content_type value returned in Step 2a — the file store will reject the upload otherwise.
curl -X PUT "https://storage.example.com/bucket/path?signature=abc123" \
-H "Content-Type: text/csv" \
--data-binary @orders.csvThe presigned URL expires after 1 hour. Complete the upload before it expires.
Step 2c — Submit the Direct Upload
After the file has been successfully uploaded, call the submit endpoint to finalize it. OneSchema verifies the upload and links the file to the import.
POST /v0/workflows/{multi_file_feed_id}/imports/{multi_file_feed_import_id}/direct-uploads/{upload_id}/submit
curl -X POST "https://api.oneschema.co/v0/workflows/42/imports/101/direct-uploads/555/submit" \
-H "X-API-KEY: YOUR_API_KEY"A successful response confirms the file has been attached to the import. Proceed to upload the next file (repeat from Step 2a) or, if all files are uploaded, move on to Step 3.
API reference: Submit a direct file upload for a Multi FileFeed import
Step 3 — Submit the Multi FileFeed Import
Once all files have been uploaded and finalized, submit the import to begin processing.
POST /v0/workflows/{multi_file_feed_id}/imports/{multi_file_feed_import_id}/submit
curl -X POST "https://api.oneschema.co/v0/workflows/42/imports/101/submit" \
-H "X-API-KEY: YOUR_API_KEY"Response
{
"id": 101,
"multi_file_feed_id": 42,
"status": "submitted",
"created_at": "2026-03-02T12:00:00Z"
}The import is now queued for execution.
API reference: Submit a Multi FileFeed import
Full Example (Python)
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.oneschema.co"
MFF_ID = 42
HEADERS = {"X-API-KEY": API_KEY}
files_to_upload = [
{"filename": "orders.csv", "path": "./orders.csv"},
{"filename": "customers.csv", "path": "./customers.csv"},
]
# Step 1: Create the MFF import
resp = requests.post(f"{BASE_URL}/v0/workflows/{MFF_ID}/imports", headers=HEADERS)
resp.raise_for_status()
import_id = resp.json()["id"]
print(f"Created import {import_id}")
for file_info in files_to_upload:
# Step 2a: Create a direct upload
resp = requests.post(
f"{BASE_URL}/v0/workflows/{MFF_ID}/imports/{import_id}/direct-uploads",
headers=HEADERS,
json={"filename": file_info["filename"]},
)
resp.raise_for_status()
upload = resp.json()
upload_id = upload["upload_id"]
presigned_url = upload["presigned_url"]
content_type = upload["content_type"]
# Step 2b: Upload the file to the presigned URL
with open(file_info["path"], "rb") as f:
put_resp = requests.put(
presigned_url,
headers={"Content-Type": content_type},
data=f,
)
put_resp.raise_for_status()
# Step 2c: Submit (finalize) the direct upload
resp = requests.post(
f"{BASE_URL}/v0/workflows/{MFF_ID}/imports/{import_id}/direct-uploads/{upload_id}/submit",
headers=HEADERS,
)
resp.raise_for_status()
print(f"Uploaded and finalized {file_info['filename']}")
# Step 3: Submit the MFF import for processing
resp = requests.post(
f"{BASE_URL}/v0/workflows/{MFF_ID}/imports/{import_id}/submit",
headers=HEADERS,
)
resp.raise_for_status()
print(f"Import {import_id} submitted for processing")Quick Reference
Step | Endpoint | Method |
|---|---|---|
| https://docs.oneschema.co/reference/create-multi-file-feed-import |
|
2a. Create direct upload | https://docs.oneschema.co/reference/create-direct-upload-multi-file-feed-import-file |
|
2b. Upload file | (presigned URL from 2a) |
|
2c. Submit direct upload | https://docs.oneschema.co/reference/submit-multi-file-feed-import |
|
| https://docs.oneschema.co/reference/submit-multi-file-feed-import |
|
Updated about 7 hours ago
