REST variables
Use REST variables to reuse values across multiple queries in the same connection.
Variable types
- Static variables: manually defined constant values
- Dynamic variables: values extracted from response headers or body data
Static variables
Use static variables for shared constants:
- API version
- Host or tenant identifiers
- Shared language or region codes
- Reused query fragments
Create static variables
- Open Settings > Connections > APIs
- Open the connection
- Go to Credentials
- Add entries under Static Variables
- Save the connection
Dynamic variables
Use dynamic variables to chain queries.
Common patterns:
- Auth query returns a token used by later queries
- Lookup query returns an ID used by an update or delete query
- Cursor response field reused for pagination calls
Create dynamic variables
- Open the connection in API Editor
- Run a source query
- Create a dynamic variable from a response header or schema field
- Name the variable clearly
- Save the query changes
Edit dynamic variables
- Open the connection in Settings > Connections > APIs
- Go to Credentials
- Open Dynamic Variables
- Update the expression or path
- Save and retest downstream queries
Expression examples
Header-derived value:
{{ info.headers.[set-cookie] }}Body-derived value:
{{ data.0.[id] }}Nested body path example:
{{ data.0.[user._id] }}Variables vs bindings
Use variables when values should be shared across queries.
Use bindings when values are supplied per execution.
Common issues
- Variable resolves empty: the source query response shape changed
- Variable points to an object instead of a scalar: the expression path is too broad
- Query retries or fails with variable errors: the source variable query is not returning the expected value
Related guides
Updated 5 months ago
Did this page help you?