Save a secret. The value is sealed and never returned.

POST/o/{org}/secrets
View .md

kind: env sets the environment variable name on every session that uses it; name follows environment-variable rules and may not be one Rush sets itself. kind: header never reaches the session's environment: E2B's egress proxy adds header_name: header_format(value) to the session's HTTPS requests to each host in targets, outside the sandbox. Basic {value} takes username:password and encodes it. A header secret's name is a label (letters, digits, ., -, _). Rush's own API hosts (api.phoenix.so, api.prix.dev) are never a target: the session signs in to Rush there, so such a secret is refused with SECRET_TARGET_INVALID; give the agent a Rush API key as a kind: env secret instead. kind: login takes one https origin in targets plus username, password and an optional base32 totp_secret. Its value is never in the session's environment or conversation: the agent runs rush-sign-in <name> and Rush types it into the session's browser on that origin only. The agent shares that browser, so this keeps the value out of the transcript, not out of the sandbox. source: onepassword (header and login only; an environment variable is readable by the agent, so it stays in Rush) stores no value: value is an op:// reference, read with the creator's connected 1Password service account when a session starts or signs in. A header takes one field (op://Vault/Item/field), a login takes the item (op://Vault/Item, read as its username, password and, with totp: true, its one-time code). The reference must be readable when it is saved, or the request is refused with a SECRET_ONEPASSWORD_* code. project_id is required: the secret reaches every session in that Project. copy_of copies a secret of this org into project_id instead: send only project_id, copy_of and an optional new name; everything else, the value included, comes from the source, which keeps working. Only the person who added the source, signed in as themselves, may copy it (FORBIDDEN otherwise, an API key included), because the copy puts its value in front of another Project's sessions. A body that is not a JSON object is 400 INVALID_BODY.

Authenticate with a signed-in session token (an API key cannot call this route).

Path parameters

orgstringrequired

The org's slug or id. A caller with no role in the org gets 404.

Request body

project_idstringrequired

A Project of this org; every session in it gets the secret.

Format uuid
copy_ofstringoptional

Copy this secret into project_id. Without it, name and the value are required.

Format uuid
namestringoptional
at most 128 characters
kindstringoptional
One ofenvheaderloginDefault "env"
valuestringoptional

The value; with source: onepassword, its op:// reference.

at most 32768 characters
sourcestringoptional

Where the value lives. onepassword is for header and login.

One ofrushonepasswordDefault "rush"
totpbooleanoptional

login with source: onepassword only: also read the item's one-time password.

descriptionstringoptional
at most 500 characters
targetsarray of stringoptional

header only: bare lowercase hostnames, such as api.stripe.com (no scheme, port, path, wildcard or IP).

header_namestringoptional

header only: the header to set; Host, Content-Length and hop-by-hop headers are refused.

header_formatstringoptional

header only.

One of{value}Bearer {value}Basic {value}
usernamestringoptional

login only.

at most 1024 characters
passwordstringoptional

login only.

at most 1024 characters
totp_secretstringoptional

login only: the base32 two-factor setup key.

Responses

201Saved.
dataSecretrequired

A secret without its value.

14 fields
idstringrequired
Format uuid
namestringrequired
kindstringrequired
One ofenvheaderlogin
sourcestringrequired

Where the value lives; a 1Password secret holds only its reference.

One ofrushonepassword
descriptionstringrequired
project_idstringrequired
Format uuid
targetsarray of stringrequired

Hosts (header) or one origin (login); empty for env.

header_namestring | nulloptional
header_formatstring | nulloptional
has_totpbooleanrequired
created_bystring | nullrequired

Null once the member who added it has deleted their account; the secret stays with the Project.

Format uuid
created_atstringrequired
Format date-time
value_updated_atstringrequired
Format date-time
last_used_atstring | nulloptional
Format date-time
400A body that is not a JSON object (INVALID_BODY).
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
401No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
403FORBIDDEN: copy_of names a secret the caller did not add, or the caller is an API key.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
404SECRET_NOT_FOUND: copy_of names no secret the caller can see.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
409SECRET_NAME_TAKEN: a secret with this name already exists in the same scope.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
422SECRET_FIELD_IMMUTABLE (a field beside copy_of other than project_id and name), SECRET_PROJECT_REQUIRED, SECRET_PROJECT_NOT_IN_ORG, SECRET_NAME_INVALID, SECRET_VALUE_INVALID, SECRET_KIND_INVALID, SECRET_SOURCE_INVALID, SECRET_TARGET_INVALID, SECRET_DESCRIPTION_INVALID, or for a 1Password reference SECRET_ONEPASSWORD_NOT_CONNECTED, SECRET_ONEPASSWORD_TOKEN_REJECTED or SECRET_ONEPASSWORD_NOT_FOUND (SECRET_ONEPASSWORD_RATE_LIMITED is 429 and SECRET_ONEPASSWORD_UNAVAILABLE 502).
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
429The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (RATE_LIMITED).

The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (RATE_LIMITED). The error names the limit. Wait Retry-After seconds.

errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, TOKEN_LIMIT_REACHED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional