Approvals
Set up
Section titled “Set up”npm install @reminix/sdkimport { createClient } from "@reminix/sdk";
const reminix = createClient(); // reads REMINIX_API_KEYpip install reminixfrom reminix import Reminix
reminix = Reminix() # reads REMINIX_API_KEYnpm install -g @reminix/clireminix loginexport REMINIX_API_KEY="<your API key>"List the actions you can ask approval for
Section titled “List the actions you can ask approval for”GET /v1/workspace/approval-actions
Actions a credential may not take itself but may ASK a person to approve: each one’s input (JSON Schema), who can approve it, and whether it creates a secret.
await reminix.workspace.approvalActions.list();reminix.workspace.approval_actions.list()reminix workspace approval-actions listcurl -X GET "https://api.reminix.com/v1/workspace/approval-actions" \ -H "Authorization: Bearer $REMINIX_API_KEY"Ask a person to approve an action
Section titled “Ask a person to approve an action”POST /v1/workspace/approval-requests
Files a request for an action you may not take yourself (see approval-actions) and notifies everyone who can approve it.
await reminix.workspace.approvalRequests.create({ action: "workspace.apiKey.create", input: { name: "acme-web", scopes: [ "workspace:read", ], }, reason: "<reason>",});reminix.workspace.approval_requests.create( action="workspace.apiKey.create", input={ "name": "acme-web", "scopes": ["workspace:read"], }, reason="<reason>",)reminix workspace approval-requests create \ --action workspace.apiKey.create \ --input '{"name":"acme-web","scopes":["workspace:read"]}' \ --reason '<reason>'curl -X POST "https://api.reminix.com/v1/workspace/approval-requests" \ -H "Authorization: Bearer $REMINIX_API_KEY" \ -H "Content-Type: application/json" \ -d '{"action":"workspace.apiKey.create","input":{"name":"acme-web","scopes":["workspace:read"]},"reason":"<reason>"}'| Field | Description |
|---|---|
action | An action id from approval-actions. |
input | The action's input, per its JSON Schema. |
reason | Why — the person reads it before deciding. |
More about this endpoint
Show the person approveUrl and why you need it; then check the request until it is decided (it expires after 24 hours). A personal access token or an app a person connected may ask — not a workspace API key.
Check an approval request
Section titled “Check an approval request”GET /v1/workspace/approval-requests/{requestId}
The request you filed: pending, denied, completed (the action ran — see result), approved (waiting for the CLI to redeem it), failed or expired.
await reminix.workspace.approvalRequests.get("<request-id>");reminix.workspace.approval_requests.get("<request-id>")reminix workspace approval-requests get '<request-id>'curl -X GET "https://api.reminix.com/v1/workspace/approval-requests/<request-id>" \ -H "Authorization: Bearer $REMINIX_API_KEY"| Field | Description |
|---|---|
requestId | The request's id. |
Redeem an approved request
Section titled “Redeem an approved request”POST /v1/workspace/approval-requests/{requestId}/redeem
Runs an approved, secret-producing action ONCE and returns its secret — to the personal access token that asked, only.
await reminix.workspace.approvalRequests.redeem("<request-id>");reminix.workspace.approval_requests.redeem("<request-id>")reminix workspace approval-requests redeem '<request-id>'curl -X POST "https://api.reminix.com/v1/workspace/approval-requests/<request-id>/redeem" \ -H "Authorization: Bearer $REMINIX_API_KEY"| Field | Description |
|---|---|
requestId | The request's id. |
More about this endpoint
The CLI writes it to a file without printing it.