Upload input files to a Space
Stores one or more input files in a Space, where every Agent in that Space can read them at Run time by file name. Use the Agent endpoint instead to keep a file private to a single Agent.
The request is multipart/form-data with one or more parts named files.
Supported formats
.csv, .tsv, .txt, .json, .xml, .xls, .xlsx, .parquet, .zip. A file may
be up to 100 MiB, and the request as a whole - every files part, the lastModified part
and the multipart framing - has to stay under 2 GB. A request over that ceiling is rejected
while the body is still being read, before the endpoint runs, so it does not come back with
the usual error body.
Re-uploading
Uploading a file whose name already exists overwrites its content in place, keeping the
same id, so a Run always reads the file most recently uploaded under that name. This is
what makes a two-stage workflow work: the first Agent’s output can be pushed under a fixed
name that the second Agent reads.
Zip files
A .zip produced by exporting a Run is expanded into one input file per text file inside
it, matching what the Control Center UI does; the response reports each extracted file
with expandedFrom set to the zip’s name. Entries whose extension is not in the supported
list are skipped. Any other .zip is stored as a single file.
An expanded zip may contain at most 500 input files totalling 500 MiB uncompressed, and each entry name must be a plain file name — an entry carrying a directory path, or a zip whose contents cannot be read, is rejected.
Last Modified
By default, the file’s Last Modified time shown in the Space’s file list is the time of
this upload. Send lastModified to record the file’s own modification time instead - one
value applies to every file, or send one value per files part to give each file its own
time.
The Control Center UI always sends this value automatically: the browser reads it from the
file you pick, with nothing for you to do. A script or HTTP client calling this endpoint has
no such value available on its own - no common client (curl, Postman, requests, httpx)
attaches a file’s modification time to an upload by default. If you want this endpoint to
match the UI’s behavior, read the file’s own mtime yourself and send lastModified, the way
every code sample on this page does.
What this endpoint will not do
The Space file store imports a text file whose first token is agent: or @template: as
an Agent or Template definition. This endpoint refuses such a file rather than creating or
replacing an Agent — upload Agent content with POST /api/v1/agent/{agentId}/content
instead. A file whose name is already taken by an Agent or Template in the Space is
likewise refused.
Every file is checked before any of them is stored — its name, extension and size, and for a
.zip, that its contents can be read. The batch is then written in a single database
transaction. So a rejected request stores nothing at all, and a request that fails while
being written registers none of its files against the Space.
Requires write access to the Space.
# Omitting lastModified records the upload time instead of the file's own mtime.
curl -X POST https://dashboard.sequentum.com/api/v1/input-files/space/7 \
-H "Authorization: ApiKey $SEQUENTUM_API_KEY" \
-F "files=@seeds.csv" \
-F "lastModified=$(date -r seeds.csv +%s)"import { readFile, stat } from "node:fs/promises";
const form = new FormData();
// A zip exported from a Run is expanded into one input file per text file inside it; each
// one comes back with expandedFrom set to the zip's name.
form.append("files", new Blob([await readFile("export_run812.zip")]), "export_run812.zip");
// lastModified is a Unix epoch in seconds or milliseconds - mtimeMs is already the unit the
// API accepts, rounded because it carries a fractional part. Omitting it records the upload
// time instead of the file's own mtime.
form.append("lastModified", String(Math.round((await stat("export_run812.zip")).mtimeMs)));
const res = await fetch("https://dashboard.sequentum.com/api/v1/input-files/space/7", {
method: "POST",
headers: { "Authorization": `ApiKey ${process.env.SEQUENTUM_API_KEY}` },
body: form,
});
const result = await res.json();
for (const file of result.files) {
console.log(`Stored ${file.name} (id ${file.id})`);
}import os
import requests
# A zip exported from a Run is expanded into one input file per text file inside it; each
# one comes back with expandedFrom set to the zip's name.
# lastModified is a Unix epoch in seconds or milliseconds - getmtime() is already the unit the
# API accepts. Omitting it records the upload time instead of the file's own mtime.
with open("export_run812.zip", "rb") as handle:
response = requests.post(
"https://dashboard.sequentum.com/api/v1/input-files/space/7",
headers={"Authorization": f"ApiKey {os.environ['SEQUENTUM_API_KEY']}"},
files=[("files", ("export_run812.zip", handle, "application/zip"))],
data={"lastModified": int(os.path.getmtime("export_run812.zip"))},
)
response.raise_for_status()
for file in response.json()["files"]:
print(f"Stored {file['name']} (id {file['id']})"){
"files": [
{
"name": "<string>",
"id": 123,
"version": 123,
"size": 123,
"expandedFrom": "<string>"
}
]
}{
"statusCode": 123,
"statusDescription": "<string>",
"message": "<string>",
"severity": 0,
"errorCode": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"statusCode": 123,
"statusDescription": "<string>",
"message": "<string>",
"severity": 0,
"errorCode": "<string>"
}Authorizations
Body
Optional last-modified time(s) for the files, as a Unix epoch between 315532800 (1980-01-01) and 4102444800 (2100-01-01) in seconds, or the equivalent in milliseconds. Send one value to apply it to every file in the batch, or one value per files part, in the same order, to give each file its own time. 0 or omitting the part entirely means the time of the upload, and a value ahead of the upload time is recorded as the upload time.