# Runs API

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

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

## Set up

* TypeScript

  ```bash
  npm install @reminix/sdk
  export REMINIX_API_KEY="<your API key>"
  ```

* Python

  ```bash
  pip install reminix
  export REMINIX_API_KEY="<your API key>"
  ```

* CLI

  ```bash
  npm install -g @reminix/cli
  reminix login
  ```

* curl

  ```bash
  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.

## Run a script

`POST /v1/scripts/{slug}/runs`[ Try it in the API playground (opens in a new tab)](https://api.reminix.com/v1/docs#tag/runs/POST/scripts/{slug}/runs)

Scope: `runs:write`.

Runs the script’s published version with these inputs, and returns the run when it finishes (201), with its output or error.

* TypeScript

  ```ts
  import { createClient } from "@reminix/sdk";

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const run = await reminix.runs.create("unlock-account", {
    inputs: {
      email: "jane@example.com",
    },
  });
  console.log(run);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  run = reminix.runs.create(
      "unlock-account",
      inputs={"email": "jane@example.com"},
  )
  print(run)
  ```

* CLI

  Day to day: `reminix run <slug>`. This endpoint’s own command:

  ```bash
  reminix runs create \
    unlock-account \
    --inputs '{"email":"jane@example.com"}'
  ```

* curl

  ```bash
  curl -X POST "https://api.reminix.com/v1/scripts/unlock-account/runs" \
    -H "Authorization: Bearer $REMINIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"inputs":{"email":"jane@example.com"}}'
  ```

**Returns:**

```json
{
  "id": "run_620f14ad-32e8-4f5e-89fd-1c80de7e9124",
  "script": {
    "id": "scr_6a7e78ca-5ef5-4c68-80cb-09aec047f7a3",
    "slug": "unlock-account"
  },
  "version": 3,
  "environment": "production",
  "status": "succeeded",
  "inputs": {
    "email": "jane@example.com"
  },
  "output": {
    "unlocked": true
  },
  "error": null,
  "startedBy": {
    "userId": "usr_276b6c46-92e7-4d47-89c1-2ada515bc3e4",
    "name": "Ana Lopez",
    "credential": {
      "type": "pat",
      "name": "ci"
    }
  },
  "via": "api",
  "automationName": null,
  "approvalRequestId": null,
  "scheduleId": null,
  "triggerId": null,
  "progress": null,
  "progressMessage": null,
  "test": false,
  "logLines": 3,
  "startedAt": "2026-10-02T14:05:00.000Z",
  "finishedAt": "2026-10-02T14:05:02.400Z",
  "durationMs": 1850,
  "files": []
}
```

| Field                         | Description                                                                                                                    |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `slug` string, path, required | The slug's ID.                                                                                                                 |
| `inputs` object               | The script's inputs, by name. The default is no inputs.                                                                        |
| `via` string                  | Where the run came from, for the history. The default is `api`. Reminix records an agent's runs as `agent` whatever this says. |

More about this endpoint

Reminix first checks the inputs against the version’s input schema. If they don’t match, the request returns 400 with one `details` entry per field. For a file input, pass a file id or an https link that Reminix fetches. The id can be a file you uploaded with files.upload, or a file another run saved. The script runs on its own fresh machine and can reach only the hosts its version declares. A run can last up to its version’s `timeoutSeconds`, at most 30, counted from when its code starts. Getting a machine can take up to 2 minutes first. If the run is still in progress after 60 seconds, the request returns 202 with status `running`, and you follow the run with runs.get. If the version’s `timeoutSeconds` is over 30, the run is a long run. A long run runs durably, and the request returns 202 at once. Every run counts toward the workspace’s `runs` usage.

## List runs

`GET /v1/runs`[ Try it in the API playground (opens in a new tab)](https://api.reminix.com/v1/docs#tag/runs/GET/runs)

Scope: `runs:read`.

Lists the workspace’s runs, newest first.

* TypeScript

  ```ts
  import { createClient } from "@reminix/sdk";

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const runs = await reminix.runs.list();
  console.log(runs);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  runs = reminix.runs.list()
  print(runs)
  ```

* CLI

  ```bash
  reminix runs list
  ```

* curl

  ```bash
  curl -X GET "https://api.reminix.com/v1/runs" \
    -H "Authorization: Bearer $REMINIX_API_KEY"
  ```

**Returns:**

```json
{
  "items": [
    {
      "id": "run_620f14ad-32e8-4f5e-89fd-1c80de7e9124",
      "script": {
        "id": "scr_6a7e78ca-5ef5-4c68-80cb-09aec047f7a3",
        "slug": "unlock-account"
      },
      "version": 3,
      "environment": "production",
      "status": "succeeded",
      "inputs": {
        "email": "jane@example.com"
      },
      "output": {
        "unlocked": true
      },
      "error": null,
      "startedBy": {
        "userId": "usr_276b6c46-92e7-4d47-89c1-2ada515bc3e4",
        "name": "Ana Lopez",
        "credential": {
          "type": "pat",
          "name": "ci"
        }
      },
      "via": "api",
      "automationName": null,
      "approvalRequestId": null,
      "scheduleId": null,
      "triggerId": null,
      "progress": null,
      "progressMessage": null,
      "test": false,
      "logLines": 3,
      "startedAt": "2026-10-02T14:05:00.000Z",
      "finishedAt": "2026-10-02T14:05:02.400Z",
      "durationMs": 1850,
      "files": []
    }
  ],
  "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 this script's runs, by its slug.                                                                                |
| `status` string, query | Only runs in this state.                                                                                             |

More about this endpoint

Pass `?script=<slug>` for one script’s runs and `?status=` for runs in one state. Pass `?before=` to start from a moment. Paginate with the opaque `nextCursor` token.

## Get a run

`GET /v1/runs/{runId}`[ Try it in the API playground (opens in a new tab)](https://api.reminix.com/v1/docs#tag/runs/GET/runs/{runId})

Scope: `runs:read`.

Returns one run, with its inputs, status, output or error, and who started it and how.

* TypeScript

  ```ts
  import { createClient } from "@reminix/sdk";

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const run = await reminix.runs.get("run_620f14ad-32e8-4f5e-89fd-1c80de7e9124");
  console.log(run);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  run = reminix.runs.get("run_620f14ad-32e8-4f5e-89fd-1c80de7e9124")
  print(run)
  ```

* CLI

  ```bash
  reminix runs get run_620f14ad-32e8-4f5e-89fd-1c80de7e9124
  ```

* curl

  ```bash
  curl -X GET "https://api.reminix.com/v1/runs/run_620f14ad-32e8-4f5e-89fd-1c80de7e9124" \
    -H "Authorization: Bearer $REMINIX_API_KEY"
  ```

**Returns:**

```json
{
  "id": "run_620f14ad-32e8-4f5e-89fd-1c80de7e9124",
  "script": {
    "id": "scr_6a7e78ca-5ef5-4c68-80cb-09aec047f7a3",
    "slug": "unlock-account"
  },
  "version": 3,
  "environment": "production",
  "status": "succeeded",
  "inputs": {
    "email": "jane@example.com"
  },
  "output": {
    "unlocked": true
  },
  "error": null,
  "startedBy": {
    "userId": "usr_276b6c46-92e7-4d47-89c1-2ada515bc3e4",
    "name": "Ana Lopez",
    "credential": {
      "type": "pat",
      "name": "ci"
    }
  },
  "via": "api",
  "automationName": null,
  "approvalRequestId": null,
  "scheduleId": null,
  "triggerId": null,
  "progress": null,
  "progressMessage": null,
  "test": false,
  "logLines": 3,
  "startedAt": "2026-10-02T14:05:00.000Z",
  "finishedAt": "2026-10-02T14:05:02.400Z",
  "durationMs": 1850,
  "files": []
}
```

| Field                          | Description   |
| ------------------------------ | ------------- |
| `runId` string, path, required | The run's ID. |

More about this endpoint

The response also has the run’s files, both given and saved, each with a download link.

## Cancel a run

`POST /v1/runs/{runId}/cancel`[ Try it in the API playground (opens in a new tab)](https://api.reminix.com/v1/docs#tag/runs/POST/runs/{runId}/cancel)

Scope: `runs:write`.

Cancels a long run that is still running.

* TypeScript

  ```ts
  import { createClient } from "@reminix/sdk";

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const result = await reminix.runs.cancel("run_620f14ad-32e8-4f5e-89fd-1c80de7e9124");
  console.log(result);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  result = reminix.runs.cancel("run_620f14ad-32e8-4f5e-89fd-1c80de7e9124")
  print(result)
  ```

* CLI

  ```bash
  reminix runs cancel run_620f14ad-32e8-4f5e-89fd-1c80de7e9124
  ```

* curl

  ```bash
  curl -X POST "https://api.reminix.com/v1/runs/run_620f14ad-32e8-4f5e-89fd-1c80de7e9124/cancel" \
    -H "Authorization: Bearer $REMINIX_API_KEY"
  ```

**Returns:**

```json
{
  "id": "run_620f14ad-32e8-4f5e-89fd-1c80de7e9124",
  "script": {
    "id": "scr_6a7e78ca-5ef5-4c68-80cb-09aec047f7a3",
    "slug": "unlock-account"
  },
  "version": 3,
  "environment": "production",
  "status": "succeeded",
  "inputs": {
    "email": "jane@example.com"
  },
  "output": {
    "unlocked": true
  },
  "error": null,
  "startedBy": {
    "userId": "usr_276b6c46-92e7-4d47-89c1-2ada515bc3e4",
    "name": "Ana Lopez",
    "credential": {
      "type": "pat",
      "name": "ci"
    }
  },
  "via": "api",
  "automationName": null,
  "approvalRequestId": null,
  "scheduleId": null,
  "triggerId": null,
  "progress": null,
  "progressMessage": null,
  "test": false,
  "logLines": 3,
  "startedAt": "2026-10-02T14:05:00.000Z",
  "finishedAt": "2026-10-02T14:05:02.400Z",
  "durationMs": 1850,
  "files": []
}
```

| Field                          | Description   |
| ------------------------------ | ------------- |
| `runId` string, path, required | The run's ID. |

More about this endpoint

The run’s code stops, the run ends `cancelled`, and Reminix sends a `run.cancelled` event. The person who started the run, the script owner, a workspace owner or admin, or a workspace API key can cancel it.

## Get a run’s log

`GET /v1/runs/{runId}/log`[ Try it in the API playground (opens in a new tab)](https://api.reminix.com/v1/docs#tag/runs/GET/runs/{runId}/log)

Scope: `runs:read`.

Returns the run’s log: what the script wrote to standard error, line by line.

* TypeScript

  ```ts
  import { createClient } from "@reminix/sdk";

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const result = await reminix.runs.log("run_620f14ad-32e8-4f5e-89fd-1c80de7e9124");
  console.log(result);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  result = reminix.runs.log("run_620f14ad-32e8-4f5e-89fd-1c80de7e9124")
  print(result)
  ```

* CLI

  ```bash
  reminix runs log run_620f14ad-32e8-4f5e-89fd-1c80de7e9124
  ```

* curl

  ```bash
  curl -X GET "https://api.reminix.com/v1/runs/run_620f14ad-32e8-4f5e-89fd-1c80de7e9124/log" \
    -H "Authorization: Bearer $REMINIX_API_KEY"
  ```

**Returns:**

```json
{
  "lines": [
    "Unlocking jane@example.com",
    "→ POST api.yourapp.com/v1/users/unlock 200 (182 ms)",
    "Unlocked jane@example.com"
  ]
}
```

| Field                          | Description   |
| ------------------------------ | ------------- |
| `runId` string, path, required | The run's ID. |

More about this endpoint

The log also has a line for each request the script made.
