Secrets

Create or update a secret

Upserts a secret by name. Default user scope is personal; organization scope requires owner/admin authority. Legacy repo scope aliases organization scope: repo/provider fields do not isolate secrets to repositories, and the response scope is the scope the secret was stored in. result says whether the name was created or an existing value was updated. Omitting note keeps the stored note; an empty string clears it. A refused name returns invalid_secret_name with a reason (format, reserved, too_long) and a message. Empty, whitespace-only and NUL-containing values are refused. warning is present when the name replaces access Reason itself provides in Sessions (GH_TOKEN, GITHUB_TOKEN). Values are encrypted and never returned. Shared changes reach live sessions. Missing encryption returns 503 secret_store_unavailable.

<sub>Scope: secrets:write</sub>

post/v3/organizations/{orgId}/secrets

Request

  • Base URL: https://api.reasonmachines.com
  • URL: https://api.reasonmachines.com/v3/organizations/{orgId}/secrets
  • Auth: HTTP bearer

Request body

namestring required

Environment variable name, e.g. NPM_TOKEN: letters, digits and underscores, starting with a letter, at most 128 characters. Upper and lower case are both accepted, but a new name may not differ only by case from one already stored in the same scope. Names Reason's runtime or the Session's shell own (PATH, HOME, USER, ...) are refused.

valuestring required

The secret value: not empty, not only whitespace, no NUL byte. Stored encrypted and never returned.

notestring

Optional usage guidance for agents and workspace members. Include the repository name when the secret is intended for one codebase. Omit to keep the stored note; send an empty string to clear it. Personal (user) secrets hold no note.

scope'organization' | 'user' | 'repo'
repostring

Deprecated context field for the repo compatibility scope. The value is stored workspace-wide.

provider'github'

Deprecated provider context for the repo compatibility scope.

Response

Secret stored.

Changes

No recorded changes to this operation across all 1 revision of this API.