Skip to content

Files

Terminal window
npm install @reminix/sdk
import { createClient } from "@reminix/sdk";
const reminix = createClient(); // reads REMINIX_API_KEY

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",
});
FieldDescription
namestring, query, requiredThe 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.

GET /v1/files

Files runs wrote, newest first, across the scripts you can see — until they expire.

await reminix.files.list();
FieldDescription
limitnumber, queryItems per page, 1–100 (default 25).
cursorstring, queryOpaque token from a previous page's nextCursor.
scriptstring, queryOnly files from this script's runs (its slug).
directionstring, queryout (default): written by runs; in: given to them.
qstring, queryOnly 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 /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>");
FieldDescription
fileIdstring, path, required
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.

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()));
FieldDescription
fileIdstring, path, required