# Secrets API

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

The secrets 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 secrets

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

Scope: `secrets:read`.

Lists the workspace’s secrets by name, with the environments that have a value and the hosts each value may go to.

* TypeScript

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

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

* Python

  ```python
  from reminix import Reminix

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

* CLI

  ```bash
  reminix secrets list
  ```

* curl

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

**Returns:**

```json
{
  "items": [
    {
      "name": "ADMIN_KEY",
      "allowEnvVar": false,
      "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
      "createdAt": "2026-08-20T09:05:00.000Z",
      "updatedAt": "2026-08-20T09:06:00.000Z",
      "values": [
        {
          "environment": "production",
          "hosts": [
            "api.yourapp.com"
          ],
          "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
          "updatedAt": "2026-08-20T09:05:00.000Z",
          "lastUsedAt": "2026-10-02T14:05:01.000Z"
        },
        {
          "environment": "staging",
          "hosts": [
            "api.staging.yourapp.com"
          ],
          "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
          "updatedAt": "2026-08-20T09:06:00.000Z",
          "lastUsedAt": null
        }
      ]
    }
  ],
  "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. |

More about this endpoint

The list never includes the values themselves.

## Get a secret

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

Scope: `secrets:read`.

Returns one secret by its name, with the environments that have a value and the hosts each value may go to.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const secret = await reminix.secrets.get("ADMIN_KEY");
  console.log(secret);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  secret = reminix.secrets.get("ADMIN_KEY")
  print(secret)
  ```

* CLI

  ```bash
  reminix secrets get ADMIN_KEY
  ```

* curl

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

**Returns:**

```json
{
  "name": "ADMIN_KEY",
  "allowEnvVar": false,
  "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
  "createdAt": "2026-08-20T09:05:00.000Z",
  "updatedAt": "2026-08-20T09:06:00.000Z",
  "values": [
    {
      "environment": "production",
      "hosts": [
        "api.yourapp.com"
      ],
      "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
      "updatedAt": "2026-08-20T09:05:00.000Z",
      "lastUsedAt": "2026-10-02T14:05:01.000Z"
    },
    {
      "environment": "staging",
      "hosts": [
        "api.staging.yourapp.com"
      ],
      "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
      "updatedAt": "2026-08-20T09:06:00.000Z",
      "lastUsedAt": null
    }
  ]
}
```

| Field                         | Description                                                                                      |
| ----------------------------- | ------------------------------------------------------------------------------------------------ |
| `name` string, path, required | The secret's name, in UPPER\_SNAKE\_CASE. It starts with a letter and has at most 64 characters. |

More about this endpoint

It never includes the values themselves.

## Update a secret

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

Scope: `secrets:write`.

Changes what applies to a secret in every environment.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const secret = await reminix.secrets.update("ADMIN_KEY");
  console.log(secret);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  secret = reminix.secrets.update("ADMIN_KEY")
  print(secret)
  ```

* CLI

  ```bash
  reminix secrets update ADMIN_KEY
  ```

* curl

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

**Returns:**

```json
{
  "name": "ADMIN_KEY",
  "allowEnvVar": false,
  "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
  "createdAt": "2026-08-20T09:05:00.000Z",
  "updatedAt": "2026-08-20T09:06:00.000Z",
  "values": [
    {
      "environment": "production",
      "hosts": [
        "api.yourapp.com"
      ],
      "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
      "updatedAt": "2026-08-20T09:05:00.000Z",
      "lastUsedAt": "2026-10-02T14:05:01.000Z"
    },
    {
      "environment": "staging",
      "hosts": [
        "api.staging.yourapp.com"
      ],
      "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
      "updatedAt": "2026-08-20T09:06:00.000Z",
      "lastUsedAt": null
    }
  ]
}
```

| Field                         | Description                                                                                                                              |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `name` string, path, required | The secret's name, in UPPER\_SNAKE\_CASE. It starts with a letter and has at most 64 characters.                                         |
| `allowEnvVar` boolean         | Whether scripts can read the secret as an environment variable. A new secret starts with false, so Reminix only attaches it to requests. |

More about this endpoint

Its values are saved one environment at a time, with Save a secret’s value. Workspace owners, admins and API keys can change a secret.

## Delete a secret

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

Scope: `secrets:write`.

Deletes a secret and its value in every environment.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  await reminix.secrets.delete("ADMIN_KEY");
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  reminix.secrets.delete("ADMIN_KEY")
  ```

* CLI

  ```bash
  reminix secrets delete ADMIN_KEY --yes
  ```

* curl

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

**Returns** nothing (`204`).

| Field                         | Description                                                                                      |
| ----------------------------- | ------------------------------------------------------------------------------------------------ |
| `name` string, path, required | The secret's name, in UPPER\_SNAKE\_CASE. It starts with a letter and has at most 64 characters. |

More about this endpoint

Runs of scripts that use it fail until someone saves it again. Workspace owners, admins and API keys can delete a secret.

## Save a secret’s value

`PUT /v1/secrets/{name}/values/{environment}`[ Try it in the API playground (opens in a new tab)](https://api.reminix.com/v1/docs#tag/secrets/PUT/secrets/{name}/values/{environment})

Scope: `secrets:write`.

Saves a secret’s value in one environment.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const result = await reminix.secretValues.set("ADMIN_KEY", "production", {
    value: "ak_live_…",
    hosts: [
      "api.yourapp.com",
    ],
  });
  console.log(result);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  result = reminix.secret_values.set(
      "ADMIN_KEY",
      "production",
      value="ak_live_…",
      hosts=["api.yourapp.com"],
  )
  print(result)
  ```

* CLI

  ```bash
  printf %s "$ADMIN_KEY" | \
    reminix secrets set ADMIN_KEY \
    --hosts api.yourapp.com
  ```

* curl

  ```bash
  curl -X PUT "https://api.reminix.com/v1/secrets/ADMIN_KEY/values/production" \
    -H "Authorization: Bearer $REMINIX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"value":"ak_live_…","hosts":["api.yourapp.com"]}'
  ```

**Returns:**

```json
{
  "name": "ADMIN_KEY",
  "allowEnvVar": false,
  "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
  "createdAt": "2026-08-20T09:05:00.000Z",
  "updatedAt": "2026-08-20T09:06:00.000Z",
  "values": [
    {
      "environment": "production",
      "hosts": [
        "api.yourapp.com"
      ],
      "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
      "updatedAt": "2026-08-20T09:05:00.000Z",
      "lastUsedAt": "2026-10-02T14:05:01.000Z"
    },
    {
      "environment": "staging",
      "hosts": [
        "api.staging.yourapp.com"
      ],
      "createdByUserId": "usr_1e21afeb-a999-46d6-8874-ae1c97c88418",
      "updatedAt": "2026-08-20T09:06:00.000Z",
      "lastUsedAt": null
    }
  ]
}
```

| Field                                | Description                                                                                      |
| ------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `name` string, path, required        | The secret's name, in UPPER\_SNAKE\_CASE. It starts with a letter and has at most 64 characters. |
| `environment` string, path, required | The environment's name.                                                                          |
| `value` string, required             | The secret itself, at most 16,384 bytes.                                                         |
| `hosts` array, required              | The only hosts Reminix sends this value to, such as `api.stripe.com`.                            |

More about this endpoint

Saving creates the secret if it’s new, or replaces the value and its hosts to rotate it. Reminix encrypts the value, and no call ever returns it. Reminix sends the value only to the hosts in `hosts`. Workspace owners, admins and API keys can save a secret.

## Remove a secret’s value from an environment

`DELETE /v1/secrets/{name}/values/{environment}`[ Try it in the API playground (opens in a new tab)](https://api.reminix.com/v1/docs#tag/secrets/DELETE/secrets/{name}/values/{environment})

Scope: `secrets:write`.

Removes a secret’s value from one environment.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  await reminix.secretValues.delete("ADMIN_KEY", "production");
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  reminix.secret_values.delete("ADMIN_KEY", "production")
  ```

* CLI

  ```bash
  reminix secret-values delete ADMIN_KEY production --yes
  ```

* curl

  ```bash
  curl -X DELETE "https://api.reminix.com/v1/secrets/ADMIN_KEY/values/production" \
    -H "Authorization: Bearer $REMINIX_API_KEY"
  ```

**Returns** nothing (`204`).

| Field                                | Description                                                                                      |
| ------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `name` string, path, required        | The secret's name, in UPPER\_SNAKE\_CASE. It starts with a letter and has at most 64 characters. |
| `environment` string, path, required | The environment's name.                                                                          |

More about this endpoint

The secret and its values in other environments stay. Runs in that environment that use the secret fail until someone saves a value there again. Workspace owners, admins and API keys can remove a value.
