Skip to main content

Adding Reusable Variables, Snippets, and Files in the Vault

Our Vault feature allows you to store variables and code snippets to use in your tests in one project, or across all projects. You can also store files for use in one project.

What You'll Need

  • An existing API Testing project. For details on how to create one, see the Quickstart guide.

Vault Types

There are two types of API Testing vaults, the Company Vault and a project-specific Vault. While their UI is the same, they serve two different purposes.

Company Vault

The Company Vault is where you can store variables and test code snippets to use across all of your projects. You can access this tab from your API Testing home page, where all of your projects are listed.
Access Company Vault

Project Vault

The project Vault, which you can access from within a project, is where you can store project-specific variables, test code snippets, and files.
Access Vault from Project View


In the Variables section, you can define environment variables to use in your tests, so that you don't need to rewrite them every time.

The screenshot below shows the Company Vault; these variables are available across all projects.

Company Vault View

Define a variable at the project-specific Vault when you need to use the same one across multiple tests. For example, you could save a password here as a variable and reuse it in multiple tests.

Import Postman Collections into a vault

Additionally, you can import variables from Postman. See Importing Postman Collections, Variables, and Environments for more details.


If the same variable with the same name definition exists in both the Project Vault and Company Vault, then the value in the Project Vault will override the one in the Company Vault.

Create a Variable

  1. Open a project.
  2. In the left panel, click Vault.
  3. Select New Entry.
  4. Add a Key (e.g., domain).
  5. Add a Value (e.g.,
  6. Optionally, check Sensitive.
  7. Select Confirm.
Domain Variables

Then in your tests, you'd reference the variable by the Key using the following syntax: ${domain}.

Mark Variables as Sensitive

You can mark a variable as sensitive if it contains a sensitive value that you do not want to appear in your test reports. When you mark a variable as sensitive, the value is obfuscated anywhere it appears: in Vault, tests reports, and the project dashboard's logs and metrics when the variable is used in the URL, path, or query. Variables marked sensitive cannot be edited. If you need to change the value, you can delete the variable and recreate it with the new value.


Variables marked as sensitive are always excluded from Vault exports.

In the following example test report, the token variable has been marked as sensitive in Vault and appears as obfuscated in the report.

data obfuscated in report

Check a common use case out of saving variables in the vault.


In the Code Snippets section of the Vault, you can create or import test component/code examples. A snippet is a test code fragment that you can create, import, and store in your Vault and reuse in multiple tests. Snippet length can range from one line of code to an entire test.

Much like with variable scope, snippets saved in a project Vault are only available in that project, and snippets saved in the Company Vault are available across all projects.

When you save a snippet from the Composer, it will be saved in the project Vault. While you cannot save a snippet from the Composer to the Company Vault, you can export there using the import/export feature (see screenshot below).

Create a Snippet

While is perfectly fine typing the code snippet directly in the area, if you are confortable doing this. There's a easier way to create a snippet.

  1. Open a project.
  2. Open the test you want to generate the snippet of.
  3. Hold down the Ctrl key, highlight the components in the UI you want to include in the snippet. They do not need to be adjacent to each otherSave snippet
  4. Click Save Snippet
  5. Give the snippet a name and click Save SnippetSnippet name

Update a Snippet

  1. Open a project.
  2. In the left panel, click Vault, then click Code Snippets.
  3. Click any of the fields and begin typing to edit the details.
  4. When you have finished, click Save Snippet

Learn how you can improve your test by generating an Authentication Snippet


In the Drive section of a project-specific Vault, you can upload files to use in your tests. The file size limit for an individual file is 16 MB. The total limit for the Organization is 100 MB. This means if one project-specific Vault Drive is using 100 MB of storage, other projects cannot upload additional files.

Upload a file

  1. Open a project.
  2. In the left panel, click Vault, then click Drive.
  3. Click Upload file.
  4. Upload the file using drag and drop or Choose file, or enter the URL, then click Upload.

You can work with your files in Vault Drive as follows:

If you upload a file via a URL, you can hover over source url to view the full address.
View Source URL

You can rename, download, or delete individual files.
Rename, delete or download files

To delete multiple files, select the checkbox next to the files, then click Delete Selected.
Delete multiple files

More Information