Edit Variables
- PATCH
- /workspaces
- /:workspace
- /variables
- /:variable_id
Edits an environment variable
Request
REQUIRED SCOPES
VARIABLE_WRITE
URL PARAMETERS
workspacerequiredstring
The human-readable ID of the workspaceExample: "my-company"
variable_idrequiredinteger
The ID of the variableExample: 123
BODY PARAMETERS
keyrequiredstring
The name of the variablevaluestring
The value of the variablesettableboolean
If set to true the variable value can be set by Buddy actionsrun_only_settableboolean
Available only if type=VAR. Requires settable=true. If set to true the variable value can be set by Buddy actions only for execution timeencryptedboolean
If set to true the variable value will be encrypted and hiddeninit_pathstring
Initial path for the variabledefaultsstring
Default value for the variablefile_pathstring
Specifies where to copy the file on each run. Required if file_place is CONTAINER, and must start with / or ~file_chmodstring
File permission set on copy to a container on each run. Required if file_place is CONTAINERfile_placestring enum
Required if type is FILE, SSH_KEY, SSH_PUBLIC_KEY, IOS_KEYCHAIN, or IOS_PROVISION_PROFILES, unless the variable is sandbox-scoped. 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 and both file_path and file_chmod are requiredAllowed enum:
NONE,CONTAINERpasswordstring
Password for certificatespassphrasestring
Passphrase for encrypted SSH keyskey_identifierstring
Key identifier for iOS certificates, provisioning profiles, or GPG keysdisabledboolean
Set to true to disable the variable. Disabled variables are not injected anywherepipelines_access_levelstring enum
Default access level for pipelines when no rule in allowedPipelines matches. Default: USE_ONLY. Only valid for workspace- and project-scoped variables.Allowed enum:
DENIED,READ_ONLY,USE_ONLY,BLIND,RUN_ONLY,READ_WRITE,MANAGE,DEFAULT,ALLOWED,STAGE,COMMITsandboxes_access_levelstring enum
Default access level for sandboxes when no rule in allowedSandboxes matches. Default: DENIED. Only valid for workspace- and project-scoped variables.Allowed enum:
DENIED,READ_ONLY,USE_ONLY,BLIND,RUN_ONLY,READ_WRITE,MANAGE,DEFAULT,ALLOWED,STAGE,COMMITallowed_pipelinesAllowedPipelineView[]
Rules that allow or deny access to this variable from specific pipelines or actions. Send an empty array to clear all rules.allowed_sandboxesAllowedSandboxView[]
Rules that allow or deny access to this variable from specific sandboxes. Send an empty array to clear all rules.notestring
Note for this resourceagent_notestring
YAML note for AI agents operating on this resourceResponse
RESPONSE BODY
typestring enum
The type of the added variable. Defaults to VAR when not setAllowed enum:
VAR,FILE,SSH_KEY,IOS_KEYCHAIN,IOS_PROVISION_PROFILES,SSH_PUBLIC_KEY,GPG_KEYurlread-onlystring
API endpoint to GET this objecthtml_urlread-onlystring
Web URL to view this object in Buddy.worksidinteger
The ID of the variablekeyrequiredstring
The name of the variablevaluestring
The value of the variableencryptedboolean
If set to true the variable value will be encrypted and hiddensettableboolean
If set to true the variable value can be set by Buddy actionsprojectProjectView
pipelineShortPipelineView
Short representation of a pipelineactionActionIdView
Action referencesandboxSandboxIdView
Sandbox referenceenvironmentEnvironmentIdView
Environment referencerun_only_settableboolean
Available only if type=VAR. Requires settable=true. If set to true the variable value can be set by Buddy actions only for execution timeinit_pathstring
Initial path for the variabledefaultsstring
Default value for the variablefile_pathstring
Specifies where to copy the file on each run. Required if file_place is CONTAINER, and must start with / or ~file_chmodstring
File permission set on copy to a container on each run. Required if file_place is CONTAINERfile_placestring enum
Required if type is FILE, SSH_KEY, SSH_PUBLIC_KEY, IOS_KEYCHAIN, or IOS_PROVISION_PROFILES, unless the variable is sandbox-scoped. 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 and both file_path and file_chmod are requiredAllowed enum:
NONE,CONTAINERbinaryboolean
Whether the file is binarypublic_valuestring
Public value for SSH key type variableskey_fingerprintstring
Fingerprint of SSH keychecksumstring
Checksum of the variable valuepasswordstring
Password for certificatespassphrasestring
Passphrase for encrypted SSH keyskey_identifierstring
Key identifier for iOS certificates, provisioning profiles, or GPG keysdisabledboolean
Set to true to disable the variable. Disabled variables are not injected anywherepipelines_access_levelstring enum
Default access level for pipelines when no rule in allowedPipelines matches. Default: USE_ONLY. Only valid for workspace- and project-scoped variables.Allowed enum:
DENIED,READ_ONLY,USE_ONLY,BLIND,RUN_ONLY,READ_WRITE,MANAGE,DEFAULT,ALLOWED,STAGE,COMMITsandboxes_access_levelstring enum
Default access level for sandboxes when no rule in allowedSandboxes matches. Default: DENIED. Only valid for workspace- and project-scoped variables.Allowed enum:
DENIED,READ_ONLY,USE_ONLY,BLIND,RUN_ONLY,READ_WRITE,MANAGE,DEFAULT,ALLOWED,STAGE,COMMITallowed_pipelinesAllowedPipelineView[]
Rules that allow or deny access to this variable from specific pipelines or actions. Send an empty array to clear all rules.allowed_sandboxesAllowedSandboxView[]
Rules that allow or deny access to this variable from specific sandboxes. Send an empty array to clear all rules.notestring
Note for this resourceagent_notestring
YAML note for AI agents operating on this resourceLast modified on Apr 22, 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,
"settable": true,
"disabled": true,
"note": "Updated API token for external service",
"agent_note": "my_custom_field: note for agent"
}'