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.

post/v1/workspaces/{workspace_id}/variables

Request

  • Base URL
    https://api.stacksync.com
  • URL
    https://api.stacksync.com/v1/workspaces/{workspace_id}/variables
  • Auth
    HTTP bearer

Path parameters

workspace_idinteger required

The workspace. List the ones your key can reach with GET /v1/workspaces.

Query parameters

region'besg' | 'usnv' required

Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them

Headers

Idempotency-Keystring nullable

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.

Request body

variable_namestring required
valuestring

The value as text; for object, array and json the JSON text

value_type'string' | 'number' | 'boolean' | 'object' | 'array' | 'json'
is_secretboolean

A secret's value is encrypted and never answered; cannot be undone

descriptionstring nullable
variable_resource_idstring nullable

The id workflow steps read the variable by; generated from the name when absent

parent_folder_idstring nullable

The folder to create the variable in, the root when absent

validate_onlyboolean

Run every check of the write and answer 204 without writing: a refused write answers the error the write would

Response

Created

variable_idstring required
variable_namestring required
variable_resource_idstring required
descriptionstring nullable required
is_secretboolean required

A secret's value is encrypted and never answered

valuestring nullable required

The value as text (JSON text for object, array and json); null for a secret

value_type'string' | 'number' | 'boolean' | 'object' | 'array' | 'json' required
referencestring required

What a workflow step writes to read the variable

parent_folder_idstring nullable required
created_timestring date-time required
last_modified_timestring date-time required
region'besg' | 'usnv' required

Changes

No recorded changes to this operation across all 1 revision of this API.