Skip to main content
PUT
/
variables
/
{variable_id}
Update a variable
curl --request PUT \
  --url https://api.questra.ai/variables/{variable_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Org-Id: <x-org-id>' \
  --data '
{
  "name": "<string>",
  "expression": "<string>"
}
'
{
  "id": "<string>",
  "name": "<string>",
  "survey_id": "<string>",
  "expression": "<string>",
  "attention_required": {
    "reason": "<string>",
    "dismissed": false
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Org-Id
string
required

The ID of the organization to make requests against. Found on your Settings page.

Path Parameters

variable_id
string
required

Unique ID of the variable to update

Body

application/json
name
string

Unique name for the variable

expression
string | null

Expression that evaluates to the value to be associated with the variable. A null value will unset this expression while neglecting this parameter will keep the value as-is.

Response

id
string
required

Unique ID of the variable

name
string
required

Unique name of the variable within the survey

Pattern: ^[a-zA-Z][a-zA-Z0-9_]*[a-zA-Z0-9]$
Examples:

"isTeenager"

"wants_to_be_contacted"

survey_id
string
required

Unique ID of the survey the variable is from

expression
string
required

Expression that evaluates to a value that can be used for data analysis or routing logic

attention_required
object

Present when the AI flagged this variable as needing human review before export