Requestly Documentation

website·Indexed 36 days ago

https://docs.requestly.com/api-client/overview

Documentation for Requestly's API Client and tools, featuring OpenAPI 3.x specification design, API collection management, and a Collection Runner with CLI support. Includes guides on environment and global variables, SAML SSO setup with Okta and Microsoft Entra ID, and AI-powered test case generation via the Test Authoring Agent.

Tokens
93.8K
Snippets
247
Records
708
Agent score
64%

What's inside Requestly

  1. Overview of the Requestly Component Library

    The Component Library is a project-wide repository for reusable OpenAPI components. It allows you to define common data shapes, parameters, and responses once and reference them in any specification within the project using $ref. There is exactly one library per project, accessible via the Components Library section in the API Design sidebar.
  2. Overview of API Design in Requestly

    API Design allows you to write and edit OpenAPI specifications (contracts) directly within Requestly. Unlike standard collections that start from a sent request, API Design starts with the contract. Specifications live within your project alongside collections, enabling a single location for both design and execution. You can access this feature via the API Design icon in the API Client sidebar.
  3. Overview of Scheduled Runs

    Scheduled Runs allow you to execute an API collection automatically on a recurring schedule (e.g., hourly or daily) in the Requestly cloud. Unlike the Manual Collection Runner, Scheduled Runs run on a chosen cadence and maintain a history of every run to help identify regressions over time. Each Scheduled Run is associated with a single collection and is managed via that collection's Runner tab.
  4. Overview of Requestly Mock Server

    The Requestly Mock Server allows developers to create a fake API to serve sample HTTP responses from a hosted URL. It is useful for developing against non-existent APIs, reproducing edge cases (e.g., 500 errors, slow responses), or providing a stable target for frontend development while the backend is in flux. Mock servers are managed within the Mocks section of the API Client sidebar.
  5. Overview of Requestly Vault

    Vault is a local-first encrypted secrets store built into the Requestly desktop app. It allows developers to store API keys, tokens, and passwords encrypted via the OS keychain, or pull secrets from external providers. Secrets can be referenced in URLs, headers, auth fields, and bodies using the {{vault:key}} syntax.

    Critical Requirement: Vault requires the Requestly desktop app (Electron) for OS-level encryption via safeStorage. It is not available in web-only mode. Linux users must have a D-Bus Secret Service implementation (e.g., GNOME Keyring or KWallet) configured.

  6. Overview of Requestly Scripting

    Requestly allows adding JavaScript logic to API requests via two types of scripts:

    • Pre-request scripts: Execute before a request is sent. Use these to set variables, build signatures, fetch tokens, or conditionally skip the request.
    • Post-response scripts: Execute after a response is received. Use these to validate responses, extract values, and write tests.

    Both script types utilize the global rq object as the primary entry point for interacting with the request/response lifecycle and environment.

  7. Overview of Requestly API Testing Environment

    Requestly provides a JavaScript runtime for automated API testing. Tests are primarily written in the Scripts → Post-response tab, which executes after a response is received and includes the Chai.js library for BDD-style assertions. Pre-request scripts can also be used for setup tasks like modifying headers or setting variables before a request is sent.
  8. Overview of Requestly Git Stashing

    Stashing allows you to park uncommitted changes in your working tree to be retrieved later. In Requestly, stashes are managed via the Git panel in a dedicated Stashes section located between Commits and Remotes.

    Key Constraints:

    • Requires the Requestly desktop app.
    • Only available for local projects (the Git tab is hidden for team projects).
    • The Stashes section is hidden while a Git merge is in progress.
  9. Overview of rq.vault for secret management

    The rq.vault object provides read-only access to encrypted secrets during script execution in the Requestly desktop app. Vault secrets are stored locally or fetched from external providers (AWS Secrets Manager, Azure Key Vault) and are excluded from collections, exports, and cloud sync.

    Key constraints:

    • Availability: Only available in the Requestly desktop app (disabled in web-only mode).
    • Read-Only: Scripts cannot create, update, or delete secrets; management must be done via the Vault UI.
    • Security: Values returned by rq.vault.get() are masked in the Requestly console logs.
    • Data Type: All retrieved values are strings.
  10. Organize Requestly rules and mocks using Projects and Workspaces

    In Requestly, a project (referred to as a workspace within the HTTP Interception section) serves as a centralized container for storing related HTTP rules, mock APIs, API requests, and collections. This organization allows users to manage their configurations efficiently and collaborate with team members.
  11. Access execution metadata with rq.info

    The rq.info object provides metadata about the current script execution, which is particularly useful for tracking progress during collection runs.
    console.log(`Running ${rq.info.requestName}`);
    console.log(`Iteration ${rq.info.iteration + 1} of ${rq.info.iterationCount}`);
  12. Manage Cookies with the Cookie Jar

    Requestly includes an app-wide cookie jar that allows users to manage cookies across requests, similar to the Postman experience.