Skip to main content
PATCH
Update a secret
Edits a workspace secret in place, for example to rotate a key. Organization secrets are updated through Organization secrets instead. See How it works. Updates one or more fields on a workspace secret. At least one field must be provided. Organization secrets are updated through PATCH /org/secrets/{secretId}.
Availability: Cloud · Community (self-hosted) · Enterprise (self-hosted)

Authorizations

Authorization
string
header
required

A workspace API key (oc_…) or organization API key (oc_org_…). Workspace-scoped endpoints called with an organization key also need X-Workspace-Id.

Path Parameters

secretId
string
required

Body

application/json

At least one field must be provided. Set valueSource to onepassword (with opRef) to switch to a 1Password-resolved value, or provide value to store an inline value.

name
string
Required string length: 1 - 255
valueSource
enum<string>
Available options:
inline,
onepassword
value
string
Required string length: 1 - 10000
opRef
string
opDisplay
object
hostPattern
string
pathPattern
string | null
Maximum string length: 1000
injectionConfig
Header injection · object

How the gateway injects this secret into matching outbound requests (generic secrets only). Exactly one variant:

  • Header — { "headerName": "Authorization", "valueFormat": "Bearer {value}" }
  • Query parameter — { "paramName": "key", "paramFormat": "{value}" }
  • URL path template — { "pathTemplate": "/bot{value}" } (must start with / and contain {value} exactly once)
  • URL path regex — { "pathRegex": "^/bot([^/]+)", "pathReplacement": "/bot{value}" } (replacement must contain {value})

Unknown or mixed keys are rejected.

Response

Updated

success
boolean