Secret Manager

REST API for the New Instance Secret Manager product. Fetch encrypted secrets at runtime without hardcoding them in your application.

Scope required: full-access or secret-read

All requests use: x-api-key: {{apiKey}}

How it works:

  1. Store secrets in the merchant dashboard at /dashboard/org/[orgId]/secret-manager
  2. Your app fetches the encrypted master key (MEK) at startup
  3. Decrypt the MEK using your App Secret (stored securely server-side)
  4. Fetch encrypted variables; decrypt them locally with the MEK

Secrets are never returned in plaintext — everything is encrypted in transit and at rest.

App Secret vs API key

  • The App Secret is a per-app value shown once in the dashboard. It is used to decrypt the MEK client-side.
  • The API key (x-api-key) is the central key that authorises the fetch. Both are required.

Rate limit: 50 requests/hour for GET master-key

GET/api/v1/secret-manager/apps/master-key

Get encrypted master key

Fetch the encrypted Master Encryption Key (MEK) for an app.

Scope: full-access or secret-read

Path param: appId — the App ID from the secret manager dashboard (set as {{appId}} in your environment)

Success — 200 OK

{
  "encryptedMek": "<base64-encoded-encrypted-key>",
  "algorithm": "AES-256-GCM",
  "kdfAlgorithm": "HKDF-SHA256"
}

Decrypt the MEK using your App Secret:

const mek = await crypto.subtle.decrypt(
  { name: 'AES-GCM', iv: decodeBase64(iv) },
  await deriveKey(appSecret),  // HKDF-SHA256
  decodeBase64(encryptedMek)
);

Common errors

  • 401 — invalid API key
  • 403 — key lacks secret-read scope
  • 404 — app not found
  • 429 — rate limited (50 req/hour)

Headers

x-api-key

Responses

200 – Encrypted MEK

{
  "encryptedMek": "base64encodedEncryptedKeyHere==",
  "algorithm": "AES-256-GCM",
  "kdfAlgorithm": "HKDF-SHA256"
}
boltTry it
env
GEThttps://api.newinstance.cloud/api/v1/secret-manager/apps/master-key

Headers

x-api-key

Code samples

curl -X GET 'https://api.newinstance.cloud/api/v1/secret-manager/apps/master-key'
GET/api/v1/secret-manager/apps/variables

Get encrypted variables

Fetch encrypted environment variables for an app.

Scope: full-access or secret-read

Path param: appId — App ID from dashboard Query param: environment (optional) — development | staging | production (default: development)

Success — 200 OK

{
  "environment": "production",
  "variables": [
    { "key": "DATABASE_URL", "encryptedValue": "<base64>", "iv": "<base64>" },
    { "key": "STRIPE_SECRET_KEY", "encryptedValue": "<base64>", "iv": "<base64>" }
  ]
}

Decrypt each variable using the MEK from GET master-key:

const plaintext = await crypto.subtle.decrypt(
  { name: 'AES-GCM', iv: decodeBase64(variable.iv) },
  mek,
  decodeBase64(variable.encryptedValue)
);

Common errors

  • 401 — invalid API key
  • 403 — key lacks secret-read scope
  • 404 — app not found or no variables for this environment

The published CLI/SDK nismsdk wraps the fetch + local-decrypt flow — secrets are decrypted on your machine with the App Secret; plaintext never transits the platform:

npm install -g nismsdk        # provides the `nism` and `nismsdk` binaries

nism setup                    # store appId / orgId / apiKey / appSecret in ~/.nism
nism verify                   # check the App Secret against the server key-check
nism env --environment production --create-env   # write decrypted vars to .env
nism load -- node server.js   # inject decrypted vars into a child process

Point it at the live platform with NISM_GRAPHQL_URL=https://service.newinstance.cloud/service (or --graphqlUrl). Auth uses the same x-api-key central key plus your appId/orgId; the App Secret is never sent — it only decrypts locally.

Headers

x-api-key

Parameters

environmentquerystringdefault: development | staging | production (default: development)

Responses

200 – Encrypted variables

{
  "environment": "production",
  "variables": [
    {
      "key": "DATABASE_URL",
      "encryptedValue": "base64ciphertext==",
      "iv": "base64iv=="
    },
    {
      "key": "STRIPE_SECRET_KEY",
      "encryptedValue": "base64ciphertext2==",
      "iv": "base64iv2=="
    }
  ]
}
boltTry it
env
GEThttps://api.newinstance.cloud/api/v1/secret-manager/apps/variables

Query parameters

environment

Headers

x-api-key

Code samples

curl -X GET 'https://api.newinstance.cloud/api/v1/secret-manager/apps/variables'