Variables

What Variables Are

Variables are reusable name/value pairs you define once and reference across your API checks. Instead of hard-coding the same base URL, token, or account id in every check, you store it as a variable and refer to it by name — change it in one place and every check that uses it picks up the new value.

You can incorporate variables into many parts of an API check:

  • URLs — dynamically construct request URLs.
  • Body — insert variables directly into the body of POST or PUT requests.
  • Headers — use variables in header values for added flexibility.
  • Query parameters — enhance GET requests with dynamic query parameters.
  • Basic authentication — pass a username and password without hard-coding them into each check.

Manage Variables

Open the Variables page to create, edit, and delete variables. Variables are scoped to your team, so everyone on the team can reference them from their checks.

Create a Variable

  1. Click New Variable.
  2. Enter a Variable Name — this is the name you'll reference in your checks (for example BASE_URL or API_TOKEN).
  3. Enter a Variable Value.
  4. Click Save Variable.

Both the name and the value are required — a variable with an empty name or value can't be saved.

Edit or Delete a Variable

Use the row actions on the Variables page to update a variable's value or remove it. Updating a value takes effect on the next run of any check that references it.

Reference a Variable in a Check

Reference a variable by wrapping its name in double curly braces: {{VARIABLE_NAME}}. LoadFocus substitutes the variable's current value when the check runs.

A few examples:

  • URL: https://{{BASE_URL}}/v1/users/{{USER_ID}}
  • Header: Authorization: Bearer {{API_TOKEN}}
  • Query parameter: ?account={{ACCOUNT_ID}}
  • Body: { "email": "{{TEST_EMAIL}}" }

Variables vs. Secrets

Use Variables for non-sensitive, reusable values such as base URLs, account ids, or feature flags — their values are shown in the Variables list.

Use Secrets for sensitive values such as API tokens, passwords, and signing keys. Secrets are write-only in the UI: once saved, their values are masked and never displayed back. Reference a secret the same way you reference a variable, with {{SECRET_NAME}}.

Tip: if a value is sensitive, store it as a Secret rather than a Variable so it isn't visible in the list.