Variables
Astraio supports environment variables for dynamic request configuration.
Variable Types
| Type | Description |
|---|---|
| Environment | Set per environment (dev, staging, prod) |
| Global | Available across all environments |
| Collection | Scoped to a specific collection |
Creating Variables
- Open the Variables panel in the sidebar
- Click + New Variable
- Enter a name and value
- Select the scope (environment/global/collection)
Using Variables
Reference variables in requests using the {{variable}} syntax:
{{base_url}}/api/v1/usersExample
| Variable | Value |
|---|---|
base_url | https://api.example.com |
api_key | Bearer abc123 |
Request URL:
{{base_url}}/usersAuthorization Header:
{{api_key}}Secret Variables
For sensitive data like API keys:
- Create a variable
- Toggle Secret to hide the value
- The value will be masked in the UI
Environments
Switch between environments to change all variables at once:
- Click the environment selector in the top bar
- Choose your environment (e.g.,
Development,Production) - All variables update automatically
Last updated on