Edit

  • PATCH
  • /workspaces
  • /:workspace
  • /variables
  • /:variable_id

Edits an environment variable

Request

REQUIRED SCOPES
VARIABLE_MANAGE
URL PARAMETERS
workspacerequiredstring
The human-readable ID of the workspace

Example: "my-company"

variable_idrequiredinteger
The ID of the variable

Example: 123

POST PARAMETERS
urlread-onlystring
API endpoint to GET this object
html_urlread-onlystring
Web URL to view this object in Buddy.works
keyrequiredstring
The name of the variable
valuestring
The value of the variable
settableboolean
If set to true the variable value can be set by Buddy actions
run_only_settableboolean
Available only if type=VAR. If set to true the variable value can be set by Buddy actions only for execution time
encryptedboolean
If set to true the variable value will be encrypted and hidden
descriptionstring
The optional description of the variable
init_pathstring
Initial path for the variable
defaultsstring
Default value for the variable
file_pathstring
Specifies where to copy the file on each run. Set if type is SSH_KEY
file_chmodstring
File permission set on copy to a container on each run. Set if type is SSH_KEY
file_placestring enum
Set if type is SSH_KEY. If it's NONE, the variable can be used as a parameter in an action. For CONTAINER, the given key is additionally copied to an action container on each run
Allowed enum:
NONE,
CONTAINER
passwordstring
Password for certificates
passphrasestring
Passphrase for encrypted SSH keys
key_identifierstring
GPG key identifier

Response

RESPONSE BODY
typestring enum
The type of the added variable
Allowed enum:
VAR,
FILE,
SSH_KEY,
IOS_KEYCHAIN,
IOS_PROVISION_PROFILES,
SSH_PUBLIC_KEY,
GPG_KEY
urlread-onlystring
API endpoint to GET this object
html_urlread-onlystring
Web URL to view this object in Buddy.works
idinteger
The ID of the variable
keyrequiredstring
The name of the variable
valuestring
The value of the variable
encryptedboolean
If set to true the variable value will be encrypted and hidden
descriptionstring
The optional description of the variable
settableboolean
If set to true the variable value can be set by Buddy actions
projectProjectView
pipelineShortPipelineView
Short representation of a pipeline
actionActionIdView
Action reference
sandboxSandboxIdView
Sandbox reference
environmentEnvironmentIdView
Environment reference
run_only_settableboolean
Available only if type=VAR. If set to true the variable value can be set by Buddy actions only for execution time
init_pathstring
Initial path for the variable
defaultsstring
Default value for the variable
file_pathstring
Specifies where to copy the file on each run. Set if type is SSH_KEY
file_chmodstring
File permission set on copy to a container on each run. Set if type is SSH_KEY
file_placestring enum
Set if type is SSH_KEY. If it's NONE, the variable can be used as a parameter in an action. For CONTAINER, the given key is additionally copied to an action container on each run
Allowed enum:
NONE,
CONTAINER
binaryboolean
Whether the file is binary
public_valuestring
Public value for SSH key type variables
key_fingerprintstring
Fingerprint of SSH key
checksumstring
Checksum of the variable value
passwordstring
Password for certificates
passphrasestring
Passphrase for encrypted SSH keys
key_identifierstring
GPG key identifier

Last modified on Jan 26, 2026

Request example

curl -X PATCH "https://api.buddy.works/workspaces/:workspace/variables/:variable_id" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "key": "API_TOKEN_UPDATED", "value": "new-secret-token-value", "encrypted": true, "description": "Updated API token for external service", "settable": true }'