# Script settings API

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

The script settings 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.

## Get the workspace’s script settings

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

Scope: `scripts:read`.

Returns how the workspace governs scripts, such as whether publishing needs a second person.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const scriptSetting = await reminix.scriptSettings.get();
  console.log(scriptSetting);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  script_setting = reminix.script_settings.get()
  print(script_setting)
  ```

* CLI

  ```bash
  reminix script-settings get
  ```

* curl

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

**Returns:**

```json
{
  "publishNeedsSecondPerson": false
}
```

## Change the workspace’s script settings

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

Scope: `scripts:write`.

Changes how the workspace governs scripts.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const scriptSetting = await reminix.scriptSettings.update({
    publishNeedsSecondPerson: false,
  });
  console.log(scriptSetting);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  script_setting = reminix.script_settings.update(publish_needs_second_person=False)
  print(script_setting)
  ```

* CLI

  ```bash
  reminix script-settings update --no-publish-needs-second-person
  ```

* curl

  ```bash
  curl -X PATCH "https://api.reminix.com/v1/script-settings" \
    -H "Authorization: Bearer $REMINIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"publishNeedsSecondPerson":false}'
  ```

**Returns:**

```json
{
  "publishNeedsSecondPerson": false
}
```

| Field                              | Description                                                                                                                                            |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `publishNeedsSecondPerson` boolean | Whether publishing needs a second person. When it's on, each publish becomes a request. Another owner or admin, not the person who asked, approves it. |

More about this endpoint

Workspace owners and admins can change these settings, and so can a workspace API key. Turning on second-person publishing needs the Business plan.
