Learn how to use variables and environments in Requestly to manage dynamic values like API keys, base URLs, and tokens across your API requests.
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.
Global VariablesUse values that apply across all requests and collections.Environment VariablesDefine values based on your working environment (e.g., dev, staging, prod).Runtime VariablesTemporary values that last only for the current session, ideal for tokens or session IDs. They aren’t synced and can auto-clear after use.Collection & SubCollection VariablesScope variables to specific collections or groups of requests.Variable PrecedenceUnderstand how Requestly resolves variable conflicts when the same name exists in multiple scopes.Using Variables in API RequestsLearn where and how to use variables in your API request URLs, headers, bodies, and scripts.Set a Response Value as a VariableCapture a value out of a response body into a variable by right-clicking the selection, with no script to write.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Requestly","description":"Design, build and test APIs in one place. Docs for the Requestly API Client: collections, environments, scripting, and Git-native sync.","colors":{"primary":"#2563eb","light":"#3b82f6","dark":"#1d4ed8"},"logo":{"light":"https://mintcdn.com/requestly/1os8lH_VUE6QydeH/images/logo-light.webp?fit=max\u0026auto=format\u0026n=1os8lH_VUE6QydeH\u0026q=85\u0026s=f4d79e60313d7b955f46e0ad446bc80d","dark":"https://mintcdn.com/requestly/1os8lH_VUE6QydeH/images/logo-dark.webp?fit=max\u0026auto=format\u0026n=1os8lH_VUE6QydeH\u0026q=85\u0026s=a20b66ddb959d92b66960804d0615fd7","href":"https://docs.requestly.com"},"favicon":"https://mintcdn.com/requestly/Z9psaKI2OUaqbNe1/images/favicon.webp?fit=max\u0026auto=format\u0026n=Z9psaKI2OUaqbNe1\u0026q=85\u0026s=7814a541aed21e1e617f27baa7b601eb","navbar":{"primary":{"type":"button","label":"Download","href":"https://requestly.com/downloads"}},"footer":{"socials":{"x":"https://x.com/requestlyio","linkedin":"https://linkedin.com/company/requestly","github":"https://github.com/requestly/requestly","youtube":"https://youtube.com/@requestly"},"links":[{"header":"Product","items":[{"label":"Features","href":"https://requestly.com"},{"label":"Pricing","href":"https://app.requestly.io/pricing"},{"label":"Chrome Extension","href":"https://rqst.ly/chrome-store"},{"label":"Desktop App","href":"https://requestly.com/desktop"}]},{"header":"Resources","items":[{"label":"Blog","href":"https://requestly.com/blog"},{"label":"Support","href":"https://requestly.com/contact-us"}]},{"header":"Company","items":[{"label":"About","href":"https://www.browserstack.com/company"},{"label":"Privacy Policy","href":"https://requestly.com/privacy"},{"label":"Terms of Service","href":"https://requestly.com/terms"}]}]},"search":{"prompt":"Search Requestly docs..."},"seo":{"metatags":{"og:type":"documentation","og:site_name":"Requestly Documentation","twitter:card":"summary_large_image","twitter:site":"@requestlyio"},"indexing":"navigable"},"integrations":{"telemetry":{"enabled":true},"cookies":{"key":"rq_consent_tracking","value":"granted"}},"errors":{"404":{"redirect":true,"title":"Page Not Found","description":"The page you're looking for doesn't exist. Try searching or browse our documentation sections."}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"requestly","hasAudioNarration":false,"actualSubdomain":"requestly","customDomains":["docs.requestly.com"],"gitSource":{"type":"github","owner":"requestly","repo":"requestly-api-client","deployBranch":"staging","contentDirectory":"documentation","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae0ade0b64cd9c8a5d3ce3c","collectionId":"76729408-569b-4351-88a4-5cd7f27c2511","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae0ade0b64cd9c8a5d3ce3c"},"feedback":{"thumbs":true,"edits":false,"issues":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae0ade0b64cd9c8a5d3ce3c","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"API Client","count":114},{"language":"default","tag":"Getting Started","count":84},{"language":"default","tag":"Sending Requests","count":23},{"language":"default","tag":"Requestly Scripts Reference","count":15},{"language":"default","tag":"Variables \u0026 Environments","count":12},{"language":"default","tag":"Git","count":10},{"language":"default","tag":"Account \u0026 Administration","count":9},{"language":"default","tag":"Import \u0026 Export","count":9},{"language":"default","tag":"Mock Server","count":8},{"language":"default","tag":"Authorization","count":8}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"changelog-layout.css","content":":has(>#content-container):has(#content[data-page-title=Changelogs]){max-width:1376px!important;margin-left:auto!important;margin-right:auto!important;padding-left:0!important;padding-right:0!important}@media (max-width:1471px){:has(>#content-container):has(#content[data-page-title=Changelogs]){margin-left:5%!important;margin-right:5%!important}}"}],"page":{"pagePath":"api-client/environments-and-variables","slug":"/api-client/environments-and-variables","pageMetadata":{"title":"Variables and Environment","label":"Variables and Environment","slug":"environments-and-variables","description":"Learn how to use variables and environments in Requestly to manage dynamic values like API keys, base URLs, and tokens across your API requests.","visibility":"PUBLIC","href":"/api-client/environments-and-variables"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn how to use variables and environments in Requestly to manage dynamic values like API keys, base URLs, and tokens across your API requests.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,strong:`strong`,..._provideComponents(),...props.components},{Heading,Tip}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`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.`}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.strong,{children:`variable`}),` is a named placeholder you define once and reference anywhere in your API collections using the `,_jsx(_components.code,{children:`{{variable_name}}`}),` syntax.`]}),`\n`,_jsxs(_components.p,{children:[`When you run a request, Requestly replaces each `,_jsx(_components.code,{children:`{{variable}}`}),` with its actual value based on its scope.`]}),`\n`,_jsxs(_components.p,{children:[`Example: `,_jsx(_components.code,{children:`https://{{base_url}}/users/{{user_id}}`})]}),`\n`,_jsxs(_components.p,{children:[`If you’ve defined `,_jsx(_components.code,{children:`base_url = api.example.com`}),` and `,_jsx(_components.code,{children:`user_id = 123`}),`, the request resolves to - `,_jsx(_components.code,{children:`https://api.example.com/users/123`})]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`+TIP: Hover over any `,_jsx(_components.code,{children:`{{variable}}`}),` in your request to preview its resolved value instantly.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`explore-variable-types-and-features`,children:`Explore Variable Types and Features`}),`\n`,_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-client/environments-and-variables/global-variables`,children:`Global Variables`})}),`\n`,_jsx(_components.p,{children:`Use values that apply across all requests and collections.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-client/environments-and-variables/environment-variables`,children:`Environment Variables`})}),`\n`,_jsx(_components.p,{children:`Define values based on your working environment (e.g., dev, staging, prod).`}),`\n`,_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-client/environments-and-variables/runtime-variables`,children:`Runtime Variables`})}),`\n`,_jsx(_components.p,{children:`Temporary values that last only for the current session, ideal for tokens or session IDs. They aren’t synced and can auto-clear after use.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-client/environments-and-variables/collection-and-subcollection-variables`,children:`Collection \u0026 SubCollection Variables`})}),`\n`,_jsx(_components.p,{children:`Scope variables to specific collections or groups of requests.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-client/environments-and-variables/variable-precedence`,children:`Variable Precedence`})}),`\n`,_jsx(_components.p,{children:`Understand how Requestly resolves variable conflicts when the same name exists in multiple scopes.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-client/environments-and-variables/using-variables-in-api-requests`,children:`Using Variables in API Requests`})}),`\n`,_jsx(_components.p,{children:`Learn where and how to use variables in your API request URLs, headers, bodies, and scripts.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-client/environments-and-variables/set-response-value-as-variable`,children:`Set a Response Value as a Variable`})}),`\n`,_jsx(_components.p,{children:`Capture a value out of a response body into a variable by right-clicking the selection, with no script to write.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Variables and Environment","label":"Variables and Environment","slug":"environments-and-variables","description":"Learn how to use variables and environments in Requestly to manage dynamic values like API keys, base URLs, and tokens across your API requests.","visibility":"PUBLIC","href":"/api-client/environments-and-variables"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Explore Variable Types and Features","slug":"explore-variable-types-and-features","depth":3,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/requestly/2cf99d119986eba4/js/botsonic.js","/_mintlify/custom/requestly/5c5995a0f8a825f2/js/download-popup.js","/_mintlify/custom/requestly/9e92f7b5c9350811/js/analytics.js","/_mintlify/custom/requestly/63b7c64ab43d10df/js/consent-bootstrap.js"],"subdomain":"requestly","siteName":"Requestly","title":"Variables and Environment - Requestly","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-04T07:56:59.349Z","originalFileLocation":"api-client/environments-and-variables.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn how to use variables and environments in Requestly to manage dynamic values like API keys, base URLs, and tokens across your API requests.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Requestly\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/requestly/7Syc77EEQZldZCdP/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/requestly/7Syc77EEQZldZCdP/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/requestly/7Syc77EEQZldZCdP/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/requestly/7Syc77EEQZldZCdP/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/requestly/7Syc77EEQZldZCdP/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/requestly/7Syc77EEQZldZCdP/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/requestly/7Syc77EEQZldZCdP/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/requestly/7Syc77EEQZldZCdP/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/requestly/7Syc77EEQZldZCdP/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Variables and Environment - Requestly\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn how to use variables and environments in Requestly to manage dynamic values like API keys, base URLs, and tokens across your API requests.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Requestly Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.requestly.com/api-client/environments-and-variables\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://requestly.mintlify.app/_mintlify/api/og/v2?division=Variables+%26+Environments\u0026amp;title=Variables+and+Environment\u0026amp;description=Learn+how+to+use+variables+and+environments+in+Requestly+to+manage+dynamic+values+like+API+keys%2C+base+URLs%2C+and+tokens+across+your+API+requests.\u0026amp;theme=f0a4e6c7d308f6656aeac52d\u0026amp;signature=125b5258cbf958a81f304c3b7b3f02eb33c14259e170b69386b8b3080381d853\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Variables and Environment - Requestly\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn how to use variables and environments in Requestly to manage dynamic values like API keys, base URLs, and tokens across your API requests.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://requestly.mintlify.app/_mintlify/api/og/v2?division=Variables+%26+Environments\u0026amp;title=Variables+and+Environment\u0026amp;description=Learn+how+to+use+variables+and+environments+in+Requestly+to+manage+dynamic+values+like+API+keys%2C+base+URLs%2C+and+tokens+across+your+API+requests.\u0026amp;theme=f0a4e6c7d308f6656aeac52d\u0026amp;signature=125b5258cbf958a81f304c3b7b3f02eb33c14259e170b69386b8b3080381d853\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/requestly/7Syc77EEQZldZCdP/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Requestly\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563eb\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.requestly.com/api-client/environments-and-variables\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-client/environments-and-variables.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.requestly.com/#organization\",\"name\":\"Requestly\",\"url\":\"https://docs.requestly.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/requestly/1os8lH_VUE6QydeH/images/logo-light.webp?fit=max\u0026auto=format\u0026n=1os8lH_VUE6QydeH\u0026q=85\u0026s=f4d79e60313d7b955f46e0ad446bc80d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.requestly.com#website\",\"name\":\"Requestly\",\"url\":\"https://docs.requestly.com\",\"publisher\":{\"@id\":\"https://docs.requestly.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.requestly.com/api-client/environments-and-variables#webpage\",\"url\":\"https://docs.requestly.com/api-client/environments-and-variables\",\"name\":\"Variables and Environment\",\"description\":\"Learn how to use variables and environments in Requestly to manage dynamic values like API keys, base URLs, and tokens across your API requests.\",\"dateModified\":\"2026-09-04T07:56:59.349Z\",\"isPartOf\":{\"@id\":\"https://docs.requestly.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.requestly.com/api-client/environments-and-variables#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.requestly.com/api-client/environments-and-variables#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Getting Started\",\"item\":\"https://docs.requestly.com/api-client/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Variables and Environment\",\"item\":\"https://docs.requestly.com/api-client/environments-and-variables\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.requestly.com/api-client/environments-and-variables#article\",\"headline\":\"Variables and Environment\",\"name\":\"Variables and Environment\",\"description\":\"Learn how to use variables and environments in Requestly to manage dynamic values like API keys, base URLs, and tokens across your API requests.\",\"url\":\"https://docs.requestly.com/api-client/environments-and-variables\",\"mainEntityOfPage\":{\"@id\":\"https://docs.requestly.com/api-client/environments-and-variables#webpage\"},\"dateModified\":\"2026-09-04T07:56:59.349Z\",\"publisher\":{\"@id\":\"https://docs.requestly.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.requestly.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Requestly\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Requestly","nav":{"global":null,"tabs":[{"tab":"API Client","icon":"house","groups":[{"group":"Getting Started","pages":[{"title":"Getting Started","href":"/api-client/overview"},{"title":"Verify Your Linux Download","icon":"shield-check","href":"/api-client/verify-linux-download"},{"group":"Sending Requests","pages":[{"group":"Create Requests","pages":[{"title":"Overview","href":"/api-client/send-api-request/create-requests/overview"},{"title":"Configure Request","href":"/api-client/send-api-request/create-requests/configure-request"},{"title":"Parameters and Body Data","href":"/api-client/send-api-request/create-requests/parameters-and-body"},{"title":"Request Headers","href":"/api-client/send-api-request/create-requests/request-headers"},{"title":"Generate Client Code","href":"/api-client/send-api-request/create-requests/generate-client-code"}]},{"title":"GraphQL Request","href":"/api-client/send-api-request/graphql-request"},{"title":"gRPC Request","href":"/api-client/send-api-request/grpc-request"},{"title":"SOAP Requests","href":"/api-client/send-api-request/send-soap"},{"group":"Realtime","pages":[{"title":"WebSocket Request","href":"/api-client/send-api-request/websocket-request"},{"title":"Socket.IO Request","href":"/api-client/send-api-request/socketio-request"},{"title":"MQTT Request","href":"/api-client/send-api-request/mqtt-request"}]},{"group":"Authorization","pages":[{"title":"Authorization","href":"/api-client/send-api-request/authorization"},{"title":"Digest Auth","href":"/api-client/send-api-request/authorization/digest"},{"title":"JWT Bearer","href":"/api-client/send-api-request/authorization/jwt-bearer"},{"title":"NTLM","href":"/api-client/send-api-request/authorization/ntlm"},{"title":"OAuth 1.0","href":"/api-client/send-api-request/authorization/oauth1"},{"title":"OAuth 2.0","href":"/api-client/send-api-request/authorization/oauth2"},{"title":"Hawk","href":"/api-client/send-api-request/authorization/hawk"},{"title":"AWS Signature v4","href":"/api-client/send-api-request/authorization/aws-signature-v4"}]},{"title":"SSL Certificates","href":"/api-client/send-api-request/ssl-certificates"},{"title":"Cookies","href":"/api-client/send-api-request/cookies"},{"title":"Filter a JSON Response","href":"/api-client/send-api-request/filter-json-response"},{"title":"API Call History","href":"/api-client/send-api-request/replay-request-from-history"}]},{"group":"Organizing APIs","pages":[{"title":"API Collections","href":"/api-client/api-collections"},{"title":"Create Request \u0026 Response Examples","href":"/api-client/examples"}]},{"group":"Import \u0026 Export","pages":[{"title":"Overview","href":"/api-client/import-export"},{"title":"Import from cURL","href":"/api-client/import-export/import-from-curl"},{"title":"Import from postman","href":"/api-client/import-export/import-from-postman"},{"title":"Import from Bruno","href":"/api-client/import-export/import-from-bruno"},{"title":"Import SOAP requests from WSDL","href":"/api-client/import-export/import-from-wsdl"},{"title":"Import / Export OpenAPI Spec","href":"/api-client/import-export/import-openapi-spec"},{"title":"Import / Export Collections","href":"/api-client/import-export/import-export-api-collections"},{"title":"Import / Export Environments","href":"/api-client/import-export/import-export-api-environment"},{"title":"Import from HAR","description":"Turn a HAR file captured from your browser's DevTools or a proxy tool into an editable Requestly collection.","href":"/api-client/import-export/import-from-har"}]},{"group":"Variables \u0026 Environments","pages":[{"title":"Variables and Environment","href":"/api-client/environments-and-variables"},{"title":"Environment Variables","description":null,"href":"/api-client/environments-and-variables/environment-variables"},{"title":"Collection \u0026 SubCollection Variables","href":"/api-client/environments-and-variables/collection-and-subcollection-variables"},{"title":"Global Variables","href":"/api-client/environments-and-variables/global-variables"},{"title":"Runtime Variables","href":"/api-client/environments-and-variables/runtime-variables"},{"title":"Dynamic Variables","href":"/api-client/environments-and-variables/dynamic-variables"},{"title":"Variable Precedence","href":"/api-client/environments-and-variables/variable-precedence"},{"title":"Using Variables in API Requests","href":"/api-client/environments-and-variables/using-variables-in-api-requests"},{"title":"Set a Response Value as a Variable","href":"/api-client/environments-and-variables/set-response-value-as-variable"},{"group":"Vault","pages":[{"title":"Overview","href":"/api-client/vault/vault"},{"title":"AWS Secrets Manager","href":"/api-client/vault/aws-secrets-manager"},{"title":"Azure Key Vault","href":"/api-client/vault/azure-key-vault"}]}]},{"group":"API Testing","pages":[{"title":"Generate API Test Cases using the Test Authoring Agent","href":"/api-client/ai-test-generator"},{"title":"Pre-request \u0026 Post-response Scripts","href":"/api-client/scripts"},{"title":"Code Snippets in Scripts","href":"/api-client/script-snippets"},{"title":"Writing Tests","href":"/api-client/tests"},{"title":"DevTools","href":"/api-client/devtools"},{"title":"Import packages into your scripts","href":"/api-client/import-packages-into-your-scripts"}]},{"group":"Automation","pages":[{"title":"Collection Runner","href":"/api-client/collection-runner"},{"title":"Run Collections with Custom Data","href":"/api-client/collection-runner-data-file"},{"title":"Scheduled Runs","href":"/api-client/scheduled-runs"},{"group":"Command Line","pages":[{"title":"CLI","href":"/api-client/cli"},{"title":"Run on CI/CD","href":"/api-client/run-on-cicd"}]}]},{"group":"Git","pages":[{"title":"Overview","href":"/api-client/git/overview"},{"title":"Connect a project to Git","href":"/api-client/git/connect-a-project"},{"title":"Stage and commit changes","href":"/api-client/git/commit-changes"},{"title":"Push and pull","href":"/api-client/git/push-and-pull"},{"title":"Providers and authentication","href":"/api-client/git/providers-and-authentication"},{"title":"Switch and create branches","href":"/api-client/git/branches"},{"title":"Browse history and diffs","href":"/api-client/git/history-and-diffs"},{"title":"Stash changes","href":"/api-client/git/stashes"},{"title":"Resolve merge conflicts","href":"/api-client/git/resolve-conflicts"},{"title":"Manage remotes","href":"/api-client/git/remotes"}]},{"group":"Requestly Scripts Reference","pages":[{"title":"Overview","href":"/api-client/rq-api-reference/overview"},{"title":"rq.collectionVariables (Collection variables)","href":"/api-client/rq-api-reference/rq-collection-variables"},{"title":"rq.environment (Environment variables)","href":"/api-client/rq-api-reference/rq-environment"},{"title":"rq.execution (Execution control)","href":"/api-client/rq-api-reference/rq-execution"},{"title":"rq.expect (Expect object)","href":"/api-client/rq-api-reference/rq-expect"},{"title":"rq.globals (Global variables)","href":"/api-client/rq-api-reference/rq-globals"},{"title":"rq.info (Execution info)","href":"/api-client/rq-api-reference/rq-info"},{"title":"rq.iterationData (Iteration data)","href":"/api-client/rq-api-reference/rq-iteration-data"},{"title":"rq.request (Request object)","href":"/api-client/rq-api-reference/rq-request"},{"title":"rq.response (Response object)","href":"/api-client/rq-api-reference/rq-response"},{"title":"rq.sendRequest (Send a request)","href":"/api-client/rq-api-reference/rq-send-request"},{"title":"rq.test (Test object)","href":"/api-client/rq-api-reference/rq-test"},{"title":"rq.variables (All scopes)","href":"/api-client/rq-api-reference/rq-variables"},{"title":"rq.vault (Vault object)","href":"/api-client/rq-api-reference/rq-vault"},{"title":"rq.visualizer (Response visualization)","href":"/api-client/rq-api-reference/rq-visualizer"}]}]},{"group":"API Design","pages":[{"title":"API Design","href":"/api-client/api-design/overview"},{"title":"Create and Edit a Specification","href":"/api-client/api-design/create-and-edit-a-specification"},{"title":"Component Library","href":"/api-client/api-design/component-library"},{"title":"Issues \u0026 Governance","href":"/api-client/api-design/issues-and-governance"},{"title":"Sync a Collection from a Specification","href":"/api-client/api-design/sync-a-collection-from-a-specification"},{"title":"Versions \u0026 Releases","href":"/api-client/api-design/versions-and-releases"},{"title":"Publish API Documentation","href":"/api-client/api-design/publish-api-docs"}]},{"group":"Mock Server","pages":[{"title":"Introduction","href":"/api-client/mock-server"},{"group":"Create a mock","pages":[{"title":"From a Collection","href":"/api-client/mock-server/create-from-collection"},{"title":"From an OpenAPI File","href":"/api-client/mock-server/create-from-openapi"}]},{"title":"Routes","href":"/api-client/mock-server/routes"},{"title":"Responses and selection modes","href":"/api-client/mock-server/responses"},{"title":"Matching rules","href":"/api-client/mock-server/rules"},{"title":"Private Mocks","href":"/api-client/mock-server/private-mocks"},{"title":"Request Logs","href":"/api-client/mock-server/logs"}]},{"group":"Collaboration \u0026 Projects","pages":[{"title":"Introduction","href":"/collaboration/workspaces"},{"title":"Local project","href":"/collaboration/local-workspace"},{"title":"Working with multiple projects","href":"/collaboration/multiple-workspaces"},{"group":"Shared projects","pages":[{"title":"Team projects","href":"/collaboration/how-to-get-started-with-shared-workspace"},{"title":"Managing your project","href":"/collaboration/how-to-get-started-with-shared-workspace/managing-workspace"},{"title":"User Roles and Permissions","href":"/collaboration/how-to-get-started-with-shared-workspace/user-roles"}]}]},{"group":"Account \u0026 Administration","pages":[{"title":"Billing \u0026 Subscriptions","href":"/account/billing-subscriptions"},{"title":"Organization resources","href":"/account/organization-resources"},{"title":"Data residency","href":"/account/data-residency"},{"title":"AI features and your data","href":"/account/ai-and-your-data"},{"title":"Data Recovery Policy","href":"/account/data-recovery"},{"title":"How is the Browser Extension Different from the Desktop App","href":"/account/how-is-browser-extension-different-from-a-desktop-app"},{"group":"Single Sign-On","pages":[{"title":"Set up Microsoft Entra ID","href":"/account/sso/how-to-set-up-sso-with-microsoft-entra-id"},{"title":"SAML SSO with Okta","href":"/account/sso/setup-sso-with-okta"}]},{"group":"Enterprise Deployment","pages":[{"title":"Deploy on Windows","href":"/account/enterprise-deployment/deploy-windows-msix"}]}]}]},{"tab":"HTTP Interceptor","icon":"globe","href":"https://interceptor-docs.requestly.com"},{"tab":"Changelogs","icon":"clock","pages":[{"title":"Changelogs","href":"/changelogs"}]}]},"title":"Variables and Environment - Requestly","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":[],"chunks":[]}