Skip to content

Files API

The files endpoints, each in TypeScript, Python, the CLI and curl.

Terminal window
npm install @reminix/sdk
export REMINIX_API_KEY="<your API key>"

To pass the key yourself, use createClient({ apiKey: key }) in TypeScript or Reminix(api_key=key) in Python.

Scope: runs:write.

Uploads a file that a run can take as a file input.

import { readFile } from "node:fs/promises";
import { createClient } from "@reminix/sdk";
// Uses the REMINIX_API_KEY environment variable.
const reminix = createClient();
const file = await reminix.files.upload(await readFile("adjustments.csv"), {
name: "adjustments.csv",
});
console.log(file);

Returns:

{
"id": "file_36d59242-1144-4fcb-851f-20f4c444d538",
"name": "adjustments.csv",
"mediaType": "text/csv",
"sizeBytes": 18432,
"origin": "input",
"runId": null,
"input": null,
"sha256": null,
"createdAt": "2026-10-01T09:14:12.000Z",
"expiresAt": "2026-10-02T09:14:12.000Z",
"downloadUrl": "https://3c5a….r2.cloudflarestorage.com/files/…?X-Amz-Expires=3600&X-Amz-Signature=…"
}
Field Description
name string, query, required The file's name.
More about this endpoint

Send the file’s bytes as the request body, with Content-Type and Content-Length headers, and its name as ?name=. Then pass the returned id as the file input’s value ({ "adjustments": "file_36d59242-1144-4fcb-851f-20f4c444d538" }). You can give each upload to only one run. If no run uses an upload within a day, Reminix deletes it. Your plan sets the largest file you can upload. Reminix refuses a file over 1,000 MB on every plan.

Scope: runs:read.

Lists the files that runs saved, newest first, across the scripts you can see.

import { createClient } from "@reminix/sdk";
// Uses the REMINIX_API_KEY environment variable.
const reminix = createClient();
const files = await reminix.files.list();
console.log(files);

Returns:

{
"items": [
{
"id": "file_ab689098-cd54-4061-8322-c3eec1f29745",
"name": "revenue-2026-09.csv",
"mediaType": "text/csv",
"sizeBytes": 52480,
"origin": "saved",
"runId": "run_d3c0553c-fa27-400f-8525-7b2985b36444",
"input": null,
"sha256": "9f2c4e1a7b3d5f60c8e2a4b6d8f0a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5",
"createdAt": "2026-10-01T09:14:20.000Z",
"expiresAt": "2026-10-08T09:14:20.000Z",
"downloadUrl": "https://3c5a….r2.cloudflarestorage.com/files/…?X-Amz-Expires=3600&X-Amz-Signature=…",
"script": {
"slug": "monthly-report",
"name": "Monthly report"
},
"run": {
"id": "run_d3c0553c-fa27-400f-8525-7b2985b36444",
"startedAt": "2026-10-01T09:14:15.000Z"
},
"startedBy": {
"userId": "usr_276b6c46-92e7-4d47-89c1-2ada515bc3e4",
"name": "Ana Lopez",
"credential": {
"type": "pat",
"name": "ci"
}
}
}
],
"nextCursor": null
}
Field Description
limit number, query Items per page, 1–100 (default 25).
cursor string, query Opaque token from a previous page's nextCursor.
before string, query Start from this moment: items older than it, newest first. Ignored with cursor, which already says where to go on.
script string, query Only files from this script's runs, by its slug.
origin string, query Which files to list: saved for files runs saved (the default), input for files runs took as inputs, or all for both.
name string, query Only files whose name contains this text.
More about this endpoint

A file stays in the list until it expires. Pass ?script=<slug> for one script’s files. Pass ?origin=input for the files runs took as inputs, or ?origin=all for both. Pass ?name= to match file names. Each file comes with a download link that works for an hour. Pass ?before= to start from a moment. Paginate with the opaque nextCursor token.

Scope: runs:read.

Returns a file’s name, media type and size, the run that took or saved it, and a download link that works for an hour.

import { createClient } from "@reminix/sdk";
// Uses the REMINIX_API_KEY environment variable.
const reminix = createClient();
const file = await reminix.files.get("file_36d59242-1144-4fcb-851f-20f4c444d538");
console.log(file);

Returns:

{
"id": "file_36d59242-1144-4fcb-851f-20f4c444d538",
"name": "adjustments.csv",
"mediaType": "text/csv",
"sizeBytes": 18432,
"origin": "input",
"runId": null,
"input": null,
"sha256": null,
"createdAt": "2026-10-01T09:14:12.000Z",
"expiresAt": "2026-10-02T09:14:12.000Z",
"downloadUrl": "https://3c5a….r2.cloudflarestorage.com/files/…?X-Amz-Expires=3600&X-Amz-Signature=…"
}
Field Description
fileId string, path, required The file's ID.
More about this endpoint

Anyone who can see a run can read its files. Until a run uses an upload, only the person who uploaded it, a workspace owner or admin, or a workspace API key can read it.

Scope: runs:read.

Returns the file’s bytes as a download.

import { writeFile } from "node:fs/promises";
import { createClient } from "@reminix/sdk";
// Uses the REMINIX_API_KEY environment variable.
const reminix = createClient();
const file = await reminix.files.content("file_36d59242-1144-4fcb-851f-20f4c444d538");
await writeFile("report.csv", Buffer.from(await file.arrayBuffer()));

Returns the file itself (application/octet-stream), which the example saves to disk.

Field Description
fileId string, path, required The file's ID.
More about this endpoint

The response always has Content-Disposition: attachment, so a browser saves the file instead of showing it as a page.