# Scripts API

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

The scripts 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.

## List scripts

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

Scope: `scripts:read`.

Lists the workspace’s scripts that you can see, newest first, with the version each one runs, its tags and its 30-day stats.

* TypeScript

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

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

* Python

  ```python
  from reminix import Reminix

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

* CLI

  ```bash
  reminix scripts list
  ```

* curl

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

**Returns:**

```json
{
  "items": [
    {
      "id": "scr_6a7e78ca-5ef5-4c68-80cb-09aec047f7a3",
      "slug": "unlock-account",
      "name": "Unlock an account",
      "description": "Unlocks a customer's account after too many failed sign-ins.",
      "status": "published",
      "ownerUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
      "publishedVersion": 3,
      "access": "workspace",
      "teamIds": [],
      "approvalPolicy": "agents",
      "inputSchema": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string"
          }
        }
      },
      "tags": [
        "support",
        "accounts"
      ],
      "setInFile": [
        "name",
        "tags"
      ],
      "stats": {
        "runsLast30Days": 42,
        "successRate": 0.95,
        "lastRunAt": "2026-10-02T14:05:00.000Z",
        "peopleLast30Days": 6,
        "via": {
          "app": 20,
          "api": 12,
          "agent": 10
        }
      },
      "createdAt": "2026-08-19T12:00:00.000Z",
      "updatedAt": "2026-09-30T10:02:00.000Z"
    }
  ],
  "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.                                                                                                                |
| `q` string, query         | Words to search for in the name, slug, description and tags. Each word matches the start of a word. Results come best match first, on one page with no cursor. |
| `tag` string, query       | Only scripts with this tag.                                                                                                                                    |
| `owner` string, query     | Only scripts this person owns, by their user id.                                                                                                               |
| `published` string, query | With `true`, only scripts that have a published version.                                                                                                       |
| `archived` string, query  | With `true`, only archived scripts. The list leaves them out otherwise.                                                                                        |

More about this endpoint

Search with `q` to get the best match first. Filter with `tag`, `owner` or `published`. Check here for an existing script before writing a new one. Paginate with the opaque `nextCursor` token.

## Create a script

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

Scope: `scripts:write`.

Creates an empty script.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const script = await reminix.scripts.create({
    slug: "unlock-account",
    name: "Unlock an account",
    description: "Unlocks a customer's account after too many failed sign-ins.",
  });
  console.log(script);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  script = reminix.scripts.create(
      slug="unlock-account",
      name="Unlock an account",
      description="Unlocks a customer's account after too many failed sign-ins.",
  )
  print(script)
  ```

* CLI

  ```bash
  reminix scripts create \
    --slug unlock-account \
    --name 'Unlock an account' \
    --description 'Unlocks a customer'\''s account after too many failed sign-ins.'
  ```

* curl

  ```bash
  curl -X POST "https://api.reminix.com/v1/scripts" \
    -H "Authorization: Bearer $REMINIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"slug":"unlock-account","name":"Unlock an account","description":"Unlocks a customer'\''s account after too many failed sign-ins."}'
  ```

**Returns:**

```json
{
  "id": "scr_6a7e78ca-5ef5-4c68-80cb-09aec047f7a3",
  "slug": "unlock-account",
  "name": "Unlock an account",
  "description": "Unlocks a customer's account after too many failed sign-ins.",
  "status": "published",
  "ownerUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
  "publishedVersion": 3,
  "access": "workspace",
  "teamIds": [],
  "approvalPolicy": "agents",
  "inputSchema": {
    "type": "object",
    "required": [
      "email"
    ],
    "properties": {
      "email": {
        "type": "string"
      }
    }
  },
  "tags": [
    "support",
    "accounts"
  ],
  "setInFile": [
    "name",
    "tags"
  ],
  "stats": {
    "runsLast30Days": 42,
    "successRate": 0.95,
    "lastRunAt": "2026-10-02T14:05:00.000Z",
    "peopleLast30Days": 6,
    "via": {
      "app": 20,
      "api": 12,
      "agent": 10
    }
  },
  "createdAt": "2026-08-19T12:00:00.000Z",
  "updatedAt": "2026-09-30T10:02:00.000Z"
}
```

| Field                   | Description                                                                                                                                    |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `slug` string, required | The script's id in URLs and commands. It's 2 to 64 lowercase letters, digits and dashes, starts with a letter, and is unique in the workspace. |
| `name` string, required | The name people see in the app.                                                                                                                |
| `description` string    | What the script does, in a sentence or two.                                                                                                    |

More about this endpoint

Upload a version next, then publish it. The `slug` names the script everywhere: in the API path, in the agent’s tool name and in the CLI. Each slug is unique in the workspace.

## Get a script

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

Scope: `scripts:read`.

Returns one script by its slug, with its name, owner, status, published version and README.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const script = await reminix.scripts.get("unlock-account");
  console.log(script);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  script = reminix.scripts.get("unlock-account")
  print(script)
  ```

* CLI

  ```bash
  reminix scripts get unlock-account
  ```

* curl

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

**Returns:**

```json
{
  "id": "scr_6a7e78ca-5ef5-4c68-80cb-09aec047f7a3",
  "slug": "unlock-account",
  "name": "Unlock an account",
  "description": "Unlocks a customer's account after too many failed sign-ins.",
  "status": "published",
  "ownerUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
  "publishedVersion": 3,
  "access": "workspace",
  "teamIds": [],
  "approvalPolicy": "agents",
  "inputSchema": {
    "type": "object",
    "required": [
      "email"
    ],
    "properties": {
      "email": {
        "type": "string"
      }
    }
  },
  "tags": [
    "support",
    "accounts"
  ],
  "setInFile": [
    "name",
    "tags"
  ],
  "stats": {
    "runsLast30Days": 42,
    "successRate": 0.95,
    "lastRunAt": "2026-10-02T14:05:00.000Z",
    "peopleLast30Days": 6,
    "via": {
      "app": 20,
      "api": 12,
      "agent": 10
    }
  },
  "createdAt": "2026-08-19T12:00:00.000Z",
  "updatedAt": "2026-09-30T10:02:00.000Z",
  "readme": "# Unlock an account\n\nUnlocks a customer's account after too many failed sign-ins.",
  "usedBy": {
    "people": [
      {
        "userId": "usr_276b6c46-92e7-4d47-89c1-2ada515bc3e4",
        "name": "Ana Lopez",
        "runs": 18
      },
      {
        "userId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
        "name": "Casey Customer",
        "runs": 9
      }
    ],
    "schedules": [],
    "triggers": [],
    "startsScripts": []
  }
}
```

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

More about this endpoint

The response also lists what uses the script: the people who run it, its schedules and triggers, and the scripts its runs start.

## Change a script

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

Scope: `scripts:write`.

Changes a script’s name, description or tags, who can see and run it, and which runs need a person’s approval.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const script = await reminix.scripts.update("unlock-account", {
    tags: [
      "support",
      "accounts",
    ],
  });
  console.log(script);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  script = reminix.scripts.update("unlock-account", tags=["support", "accounts"])
  print(script)
  ```

* CLI

  ```bash
  reminix scripts update unlock-account --tag support --tag accounts
  ```

* curl

  ```bash
  curl -X PATCH "https://api.reminix.com/v1/scripts/unlock-account" \
    -H "Authorization: Bearer $REMINIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"tags":["support","accounts"]}'
  ```

**Returns:**

```json
{
  "id": "scr_6a7e78ca-5ef5-4c68-80cb-09aec047f7a3",
  "slug": "unlock-account",
  "name": "Unlock an account",
  "description": "Unlocks a customer's account after too many failed sign-ins.",
  "status": "published",
  "ownerUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
  "publishedVersion": 3,
  "access": "workspace",
  "teamIds": [],
  "approvalPolicy": "agents",
  "inputSchema": {
    "type": "object",
    "required": [
      "email"
    ],
    "properties": {
      "email": {
        "type": "string"
      }
    }
  },
  "tags": [
    "support",
    "accounts"
  ],
  "setInFile": [
    "name",
    "tags"
  ],
  "stats": {
    "runsLast30Days": 42,
    "successRate": 0.95,
    "lastRunAt": "2026-10-02T14:05:00.000Z",
    "peopleLast30Days": 6,
    "via": {
      "app": 20,
      "api": 12,
      "agent": 10
    }
  },
  "createdAt": "2026-08-19T12:00:00.000Z",
  "updatedAt": "2026-09-30T10:02:00.000Z"
}
```

| Field                         | Description                                                                                                                                                                                                    |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `slug` string, path, required | The slug's ID.                                                                                                                                                                                                 |
| `name` string                 | The name people see in the app.                                                                                                                                                                                |
| `description` string          | What the script does, in a sentence or two.                                                                                                                                                                    |
| `access` string               | Who can see and run the script. With `workspace`, every member can. With `teams`, only members of `teamIds` and workspace owners and admins can.                                                               |
| `teamIds` array               | With `access: teams`, the teams whose members can see and run the script.                                                                                                                                      |
| `tags` array                  | Up to 10 tags, each 1 to 30 lowercase letters, digits and dashes.                                                                                                                                              |
| `approvalPolicy` string       | Which runs wait for a person's approval: `none`, `agents` for runs started with an agent's token, or `always` for every run. A token issued for the MCP server can't change this field, `access` or `teamIds`. |

More about this endpoint

The script owner, a workspace owner or admin, or a workspace API key can change a script. An agent can’t change `access`, `teamIds` or `approvalPolicy`. A name, description or tags that the script’s reminix.json sets (listed in `setInFile`) can’t change here, and the request returns 409.

## Archive a script

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

Scope: `scripts:write`.

Archives a script, which stops it.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const result = await reminix.scripts.archive("unlock-account");
  console.log(result);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  result = reminix.scripts.archive("unlock-account")
  print(result)
  ```

* CLI

  ```bash
  reminix scripts archive unlock-account
  ```

* curl

  ```bash
  curl -X POST "https://api.reminix.com/v1/scripts/unlock-account/archive" \
    -H "Authorization: Bearer $REMINIX_API_KEY"
  ```

**Returns:**

```json
{
  "id": "scr_6a7e78ca-5ef5-4c68-80cb-09aec047f7a3",
  "slug": "unlock-account",
  "name": "Unlock an account",
  "description": "Unlocks a customer's account after too many failed sign-ins.",
  "status": "published",
  "ownerUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
  "publishedVersion": 3,
  "access": "workspace",
  "teamIds": [],
  "approvalPolicy": "agents",
  "inputSchema": {
    "type": "object",
    "required": [
      "email"
    ],
    "properties": {
      "email": {
        "type": "string"
      }
    }
  },
  "tags": [
    "support",
    "accounts"
  ],
  "setInFile": [
    "name",
    "tags"
  ],
  "stats": {
    "runsLast30Days": 42,
    "successRate": 0.95,
    "lastRunAt": "2026-10-02T14:05:00.000Z",
    "peopleLast30Days": 6,
    "via": {
      "app": 20,
      "api": 12,
      "agent": 10
    }
  },
  "createdAt": "2026-08-19T12:00:00.000Z",
  "updatedAt": "2026-09-30T10:02:00.000Z"
}
```

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

More about this endpoint

An archived script leaves the scripts list, nobody can run it, and its schedules and triggers skip it. Reminix never deletes a script, so its runs and versions stay. You can’t archive a script while one of its runs is in progress or waiting for approval. The script owner, a workspace owner or admin, or a workspace API key can archive a script.

## Restore an archived script

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

Scope: `scripts:write`.

Restores an archived script.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const result = await reminix.scripts.restore("unlock-account");
  console.log(result);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  result = reminix.scripts.restore("unlock-account")
  print(result)
  ```

* CLI

  ```bash
  reminix scripts restore unlock-account
  ```

* curl

  ```bash
  curl -X POST "https://api.reminix.com/v1/scripts/unlock-account/restore" \
    -H "Authorization: Bearer $REMINIX_API_KEY"
  ```

**Returns:**

```json
{
  "id": "scr_6a7e78ca-5ef5-4c68-80cb-09aec047f7a3",
  "slug": "unlock-account",
  "name": "Unlock an account",
  "description": "Unlocks a customer's account after too many failed sign-ins.",
  "status": "published",
  "ownerUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
  "publishedVersion": 3,
  "access": "workspace",
  "teamIds": [],
  "approvalPolicy": "agents",
  "inputSchema": {
    "type": "object",
    "required": [
      "email"
    ],
    "properties": {
      "email": {
        "type": "string"
      }
    }
  },
  "tags": [
    "support",
    "accounts"
  ],
  "setInFile": [
    "name",
    "tags"
  ],
  "stats": {
    "runsLast30Days": 42,
    "successRate": 0.95,
    "lastRunAt": "2026-10-02T14:05:00.000Z",
    "peopleLast30Days": 6,
    "via": {
      "app": 20,
      "api": 12,
      "agent": 10
    }
  },
  "createdAt": "2026-08-19T12:00:00.000Z",
  "updatedAt": "2026-09-30T10:02:00.000Z"
}
```

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

More about this endpoint

The script comes back to the scripts list, people can run it again, and its schedules and triggers resume. The script owner, a workspace owner or admin, or a workspace API key can restore a script.
