Variables in Requestly’s API Client let you store and reuse dynamic values—like API keys, base URLs, and user IDs—across your API requests. They help you avoid hardcoding, make your collections more modular, and simplify switching between different environments like development, staging, and production.
A variable is a named placeholder you define once and reference anywhere in your API collections using the {{variable_name}}
syntax.
When you run a request, Requestly replaces each {{variable}}
with its actual value based on its scope.
Example: https://{{base_url}}/users/{{user_id}}
If you've defined base_url = api.example.com
and user_id = 123
, the request resolves to - https://api.example.com/users/123
+TIP: Hover over any {{variable}}
in your request to preview its resolved value instantly.
Explore Variable Types and Features
Use values that apply across all requests and collections.
Define values based on your working environment (e.g., dev, staging, prod).
Collection & SubCollection Variables
Scope variables to specific collections or groups of requests.
Understand how Requestly resolves variable conflicts when the same name exists in multiple scopes.
Using Variables in API Requests
Learn where and how to use variables in your API request URLs, headers, bodies, and scripts.