bulkPatch

Overview

This endpoint is used for updating metadata on multiple variables within a dataset, workflow, or table.

HTTP Request

PATCH /api/v1/tables/:tableReference/variables
PATCH /api/v1/datasets/:datasetReference/variables
PATCH /api/v1/datasets/:workflowReference/variables

Path parameters

Parameter

tableReference

A qualified reference to a table. See referencing resources for more information.

datasetReference

A qualified reference to a dataset. See referencing resources for more information. When bulk updating variables on a dataset, variables across all tables in the dataset will be updated, if their names match the update payload.

workflowReference

A qualified reference to a workflow. See referencing resources for more information. When bulk updating variables on a workflow, variables across all tables in the workflow will be updated, if their names match the update payload.

circle-info

This endpoint extends the general API structure

Request body

Provide a JSON object with a variables array, where each entity in the array is an object corresponding to a variable whose properties you would like to update. All fields are optional. To unset a value, specify null for the given property.

Property name
Type
Description

variables

array[object]

An array of the variables that you'd like to update.

Each entry in the array is an object with with a name property (corresponding to the variable name) and any other metadata properties that you want to update.

variables[].name

string

Required. The name (case-insensitive) of the variable to update. If the variable does not exist in the table, an error will be thrown.

variables[].label

string

A human-readable label for the variable. Must be less than or equal to 256 characters.

variables[].description

string

A longer description of the variable. Must be less than or equal to 5,000 characters.

variables[].valueLabels

array[object]

A mapping between values in the data and human readable labels. Passed as an array of objects, each with "value" and "label" properties. E.g., [{ "value": "1", "label": "Yes" },{ "value": "2" "label": "No" }]. The total length of all values + labels cannot exceed 1 million characters.

Authorization

Edit access to the corresponding dataset is required. Your access token must have the following scope:

  • data.edit (if updating dataset tables)

  • workflow.write (if updating workflow tables)

Learn more about authorization.

Response body

No body is returned in the bulkPatch response. You may call variable.list to re-fetch any updated variables.

Last updated

Was this helpful?