Variables
Create a variable
A workspace variable, or a secret (is_secret: its value is encrypted and never answered again). Send an Idempotency-Key to retry safely.
Authorization
AuthorizationstringheaderrequiredBearer <key>, where <key> is a workspace API key or a user API key. See Authentication.
workspace_id*integerThe workspace. List the ones your key can reach with GET /v1/workspaces.
region*RegionsRegion of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them
"besg""usnv"Idempotency-Key?|Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.
nullapplication/json- body
variable_name*Variable Name1 <= length <= 255value?ValueThe value as text; for object, array and json the JSON text
""value_type?WorkflowVariableDataValueType"string""string""number""boolean""object""array""json"is_secret?Is SecretA secret's value is encrypted and never answered; cannot be undone
falsedescription?|nullvariable_resource_id?|The id workflow steps read the variable by; generated from the name when absent
nullparent_folder_id?|The folder to create the variable in, the root when absent
nullvalidate_only?Validate OnlyRun every check of the write and answer 204 without writing: a refused write answers the error the write would
falseCreated
application/json- response
variable_id*Variable Idvariable_name*Variable Namevariable_resource_id*Variable Resource Iddescription*string|nullis_secret*Is SecretA secret's value is encrypted and never answered
value*|The value as text (JSON text for object, array and json); null for a secret
value_type*|How workflow steps read the value; for a secret, answered by GET /variables/ (stored encrypted with its value, not read by the list)
reference*ReferenceWhat a workflow step writes to read the variable
parent_folder_id*string|nullcreated_time*Created Timedate-timelast_modified_time*Last Modified Timedate-timeregion*Regions"besg""usnv"curl -X POST 'https://api.stacksync.com/v1/workspaces/0/variables?region=besg' \ -H 'Content-Type: application/json' \ -d '{ "variable_name": "<variable_name>"}'{ "variable_id": "<variable_id>", "variable_name": "<variable_name>", "variable_resource_id": "<variable_resource_id>", "description": "<description>", "is_secret": false, "value": "<value>", "value_type": "string", "reference": "<reference>", "parent_folder_id": "<parent_folder_id>", "created_time": "2027-01-15T09:00:00Z", "last_modified_time": "2027-01-15T09:00:00Z", "region": "besg"}GETGet a variable
A variable or secret: its value (never a secret's), type, description and reference.
PATCHUpdate a variable
Change a variable's name, description, value or value type, or turn it into a secret (for good). Only the fields sent change. A secret's value is never read back: to change its type, send its value too.