# Approvals API

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

The approvals 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 the actions you can ask approval for

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

Scope: `workspace.approvals:read`.

Lists the actions a credential can’t take itself but can ask a person to approve.

* TypeScript

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

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

* Python

  ```python
  from reminix import Reminix

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

* CLI

  ```bash
  reminix workspace approval-actions list
  ```

* curl

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

**Returns:**

```json
{
  "items": [
    {
      "id": "workspace.apiKey.create",
      "title": "Create a workspace API key",
      "approverRoles": [
        "owner"
      ],
      "createsSecret": true,
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      }
    }
  ],
  "nextCursor": null
}
```

More about this endpoint

Each action comes with its input as a JSON Schema (`inputSchema`), who can approve it and whether it creates a secret. Every action fits on one page, so `nextCursor` is null.

## Ask a person to approve an action

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

Scope: `workspace.approvals:write`.

Creates a request for an action you can’t take yourself and notifies everyone who can approve it.

This takes a [personal access token](/docs/authentication/), not an API key. In the SDKs, pass it as `token`, with `workspace`.

* TypeScript

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

  const reminix = createClient({ token: process.env.REMINIX_TOKEN, workspace: "<workspace>" });
  const approvalRequest = await reminix.workspace.approvalRequests.create({
    action: "workspace.apiKey.create",
    input: {
      name: "acme-web",
      scopes: [
        "workspace:read",
      ],
    },
    reason: "A key for the deploy pipeline.",
  });
  console.log(approvalRequest);
  ```

* Python

  ```python
  import os

  from reminix import Reminix

  reminix = Reminix(token=os.environ["REMINIX_TOKEN"], workspace="<workspace>")
  approval_request = reminix.workspace.approval_requests.create(
      action="workspace.apiKey.create",
      input={
          "name": "acme-web",
          "scopes": ["workspace:read"],
      },
      reason="A key for the deploy pipeline.",
  )
  print(approval_request)
  ```

* CLI

  ```bash
  reminix workspace approval-requests create \
    --action workspace.apiKey.create \
    --input '{"name":"acme-web","scopes":["workspace:read"]}' \
    --reason 'A key for the deploy pipeline.'
  ```

* curl

  ```bash
  curl -X POST "https://api.reminix.com/v1/workspace/approval-requests" \
    -H "Authorization: Bearer $REMINIX_TOKEN" \
    -H "X-Workspace: <workspace>" \
    -H "Content-Type: application/json" \
    -d '{"action":"workspace.apiKey.create","input":{"name":"acme-web","scopes":["workspace:read"]},"reason":"A key for the deploy pipeline."}'
  ```

**Returns:**

```json
{
  "id": "apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d",
  "action": "workspace.apiKey.create",
  "title": "Create a workspace API key",
  "summary": "Create the API key “acme-web” with workspace:read",
  "input": {
    "name": "acme-web",
    "scopes": [
      "workspace:read"
    ]
  },
  "reason": "I'm connecting acme-web and need an API key that can read the workspace.",
  "status": "pending",
  "requestedBy": "Claude",
  "expiresAt": "2026-08-20T12:00:00.000Z",
  "createdAt": "2026-08-19T12:00:00.000Z",
  "decidedAt": null,
  "result": null,
  "secret": {
    "name": "API key",
    "envVar": "REMINIX_API_KEY"
  },
  "approveUrl": "https://app.reminix.com/approvals/apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d"
}
```

| Field                     | Description                                                   |
| ------------------------- | ------------------------------------------------------------- |
| `action` string, required | An action id from approval-actions.                           |
| `input` object, required  | The action's input. It must match the action's JSON Schema.   |
| `reason` string, required | Why you need the action. The person reads it before deciding. |

More about this endpoint

The actions you can ask for are in approval-actions. Show the person `approveUrl` and why you need the action. Then check the request until a person decides. A request expires after 24 hours. A personal access token or an app a person connected can ask. A workspace API key can’t.

## Check an approval request

`GET /v1/workspace/approval-requests/{approvalRequestId}`[ Try it in the API playground (opens in a new tab)](https://api.reminix.com/v1/docs#tag/approvals/GET/workspace/approval-requests/{approvalRequestId})

Scope: `workspace.approvals:read`.

Returns an approval request you created, with its status.

* TypeScript

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

  // Uses the REMINIX_API_KEY environment variable.
  const reminix = createClient();
  const approvalRequest = await reminix.workspace.approvalRequests.get("apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d");
  console.log(approvalRequest);
  ```

* Python

  ```python
  from reminix import Reminix

  # Uses the REMINIX_API_KEY environment variable.
  reminix = Reminix()
  approval_request = reminix.workspace.approval_requests.get(
      "apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d",
  )
  print(approval_request)
  ```

* CLI

  ```bash
  reminix workspace approval-requests get \
    apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d
  ```

* curl

  ```bash
  curl -X GET "https://api.reminix.com/v1/workspace/approval-requests/apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d" \
    -H "Authorization: Bearer $REMINIX_API_KEY"
  ```

**Returns:**

```json
{
  "id": "apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d",
  "action": "workspace.apiKey.create",
  "title": "Create a workspace API key",
  "summary": "Create the API key “acme-web” with workspace:read",
  "input": {
    "name": "acme-web",
    "scopes": [
      "workspace:read"
    ]
  },
  "reason": "I'm connecting acme-web and need an API key that can read the workspace.",
  "status": "pending",
  "requestedBy": "Claude",
  "expiresAt": "2026-08-20T12:00:00.000Z",
  "createdAt": "2026-08-19T12:00:00.000Z",
  "decidedAt": null,
  "result": null,
  "secret": {
    "name": "API key",
    "envVar": "REMINIX_API_KEY"
  },
  "approveUrl": "https://app.reminix.com/approvals/apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d"
}
```

| Field                                      | Description                |
| ------------------------------------------ | -------------------------- |
| `approvalRequestId` string, path, required | The approval request's id. |

More about this endpoint

A `pending` request is waiting for a person to decide. A `completed` request’s action ran, and `result` holds the outcome. An `approved` request is waiting for the CLI to redeem it. A request can also be `denied`, `failed` or `expired`.

## Redeem an approved request

`POST /v1/workspace/approval-requests/{approvalRequestId}/redeem`[ Try it in the API playground (opens in a new tab)](https://api.reminix.com/v1/docs#tag/approvals/POST/workspace/approval-requests/{approvalRequestId}/redeem)

Scope: `workspace.approvals:write`.

Runs an approved action that creates a secret, and returns the secret.

This takes a [personal access token](/docs/authentication/), not an API key. In the SDKs, pass it as `token`, with `workspace`.

* TypeScript

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

  const reminix = createClient({ token: process.env.REMINIX_TOKEN, workspace: "<workspace>" });
  const secret = await reminix.workspace.approvalRequests.redeem("apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d");
  console.log(secret);
  ```

* Python

  ```python
  import os

  from reminix import Reminix

  reminix = Reminix(token=os.environ["REMINIX_TOKEN"], workspace="<workspace>")
  secret = reminix.workspace.approval_requests.redeem(
      "apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d",
  )
  print(secret)
  ```

* CLI

  ```bash
  reminix workspace approval-requests redeem \
    apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d
  ```

* curl

  ```bash
  curl -X POST "https://api.reminix.com/v1/workspace/approval-requests/apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d/redeem" \
    -H "Authorization: Bearer $REMINIX_TOKEN" \
    -H "X-Workspace: <workspace>"
  ```

**Returns:**

```json
{
  "request": {
    "id": "apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d",
    "action": "workspace.apiKey.create",
    "title": "Create a workspace API key",
    "summary": "Create the API key “acme-web” with workspace:read",
    "input": {
      "name": "acme-web",
      "scopes": [
        "workspace:read"
      ]
    },
    "reason": "I'm connecting acme-web and need an API key that can read the workspace.",
    "status": "pending",
    "requestedBy": "Claude",
    "expiresAt": "2026-08-20T12:00:00.000Z",
    "createdAt": "2026-08-19T12:00:00.000Z",
    "decidedAt": null,
    "result": null,
    "secret": {
      "name": "API key",
      "envVar": "REMINIX_API_KEY"
    },
    "approveUrl": "https://app.reminix.com/approvals/apr_7c2e9b4d-1f3a-4e5b-8c6d-7e8f9a0b1c2d"
  },
  "secret": "sk_reminix_Xk2mP9qR4tV7wY1zB3cD5fG8hJ0kL6nQXk2mP9qR4tV7wY1zB3cD5fG8hJ0kL6nQ",
  "envVar": "REMINIX_API_KEY"
}
```

| Field                                      | Description                |
| ------------------------------------------ | -------------------------- |
| `approvalRequestId` string, path, required | The approval request's id. |

More about this endpoint

The action runs only once. Only the personal access token that asked can redeem it. The CLI writes the secret to a file without printing it.
