POST /v1/files/{file_key}/variables

This API is available to full members of Enterprise orgs with Editor seats.

The POST /v1/files/:file_key/variables endpoint lets you bulk create, update, and delete variables and variable collections.

The request body supports the following 4 top-level arrays. Changes from these arrays will be applied in the below order, and within each array, by array order.

Temporary ids can be used to reference an object later in the same POST request body. They can be used at create time in the id property of variable collections, modes, variables, and in the initialModeId property of variable collections. They are scoped to a single request body, and must be unique within the body. The mapping of temporary ids to real ids is returned in the response.

This endpoint has the following key behaviors:

Servers

Path parameters

Name Type Required Description
file_key String Yes

File to modify variables in. This can be a file key or branch key. Use GET /v1/files/:key with the branch_data query param to get the branch key.

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
variableModes[] Array No

For creating, updating, and deleting modes within variable collections.

variableModeValues[] Array No

For setting a specific value, given a variable and a mode.

variableModeValues[].variableId String Yes

The target variable. You can use the temporary id of a variable.

variableModeValues[].modeId String Yes

Must correspond to a mode in the variable collection that contains the target variable.

variableModeValues[].value Yes

The value for the variable. The value must match the variable's type. If setting to a variable alias, the alias must resolve to this type. If overriding a value, the value type must match the variable's type. If removing an overridden value, the value must be null.

variableCollections[] Array No

For creating, updating, and deleting variable collections.

variables[] Array No

For creating, updating, and deleting variables.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.