Files
Set up
Section titled “Set up”npm install @reminix/sdkimport { createClient } from "@reminix/sdk";
const reminix = createClient(); // reads REMINIX_API_KEYpip install reminixfrom reminix import Reminix
reminix = Reminix() # reads REMINIX_API_KEYnpm install -g @reminix/clireminix loginexport REMINIX_API_KEY="<your API key>"Upload a file
Section titled “Upload a file”POST /v1/files
Uploads a file to give a run: send its bytes as the body with its Content-Type and Content-Length, and its name as ?name=.
import { readFile } from "node:fs/promises";
await reminix.files.upload(await readFile("report.csv"), { name: "adjustments.csv",});from pathlib import Path
reminix.files.upload( Path("report.csv").read_bytes(), name="adjustments.csv",)reminix files upload --name adjustments.csv --file report.csvcurl -X POST "https://api.reminix.com/v1/files?name=adjustments.csv" \ -H "Authorization: Bearer $REMINIX_API_KEY" \ -H "Content-Type: application/octet-stream" \ --data-binary @report.csv| Field | Description |
|---|---|
name | The file's name. |
More about this endpoint
Then pass the returned id as a file input ({ "<input>": "file_…" }). An upload no run uses within a day is deleted; one run uses it.
List files
Section titled “List files”GET /v1/files
Files runs wrote, newest first, across the scripts you can see — until they expire.
await reminix.files.list();reminix.files.list()reminix files listcurl -X GET "https://api.reminix.com/v1/files" \ -H "Authorization: Bearer $REMINIX_API_KEY"| Field | Description |
|---|---|
limit | Items per page, 1–100 (default 25). |
cursor | Opaque token from a previous page's nextCursor. |
script | Only files from this script's runs (its slug). |
direction | out (default): written by runs; in: given to them. |
q | Only files whose name contains this. |
More about this endpoint
?script=<slug> narrows to one script, ?direction=in lists the files runs were given (all for both), and ?q= matches names. Each comes with a download link valid for an hour. Paginate with the opaque nextCursor token.
Get a file
Section titled “Get a file”GET /v1/files/{fileId}
A file’s name, type, size and the run that took or wrote it, with a download link valid for an hour.
await reminix.files.get("<file-id>");reminix.files.get("<file-id>")reminix files get '<file-id>'curl -X GET "https://api.reminix.com/v1/files/<file-id>" \ -H "Authorization: Bearer $REMINIX_API_KEY"| Field | Description |
|---|---|
fileId |
More about this endpoint
A run’s files are readable by whoever can see the run; an upload not yet used, by whoever uploaded it.
Download a file
Section titled “Download a file”GET /v1/files/{fileId}/content
The file’s bytes, always as an attachment (Content-Disposition: attachment) — never shown as a page.
import { writeFile } from "node:fs/promises";
const file = await reminix.files.download("<file-id>");await writeFile("report.csv", Buffer.from(await file.arrayBuffer()));from pathlib import Path
Path("report.csv").write_bytes(reminix.files.download("<file-id>"))reminix files download '<file-id>' --out report.csvcurl -X GET "https://api.reminix.com/v1/files/<file-id>/content" \ -H "Authorization: Bearer $REMINIX_API_KEY" \ -o report.csv| Field | Description |
|---|---|
fileId |