> ## Documentation Index
> Fetch the complete documentation index at: https://interceptor-docs.requestly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Record API Sessions

> Learn how to record APIs using Requestly Interceptor Desktop App, save and share API sessions, import HAR files, perform bulk mocking, and replay sessions for debugging.

***

**Recording API sessions** allows you to monitor and debug HTTP traffic between your application and the server. This can significantly improve debugging efficiency by providing insights into network behavior, as well as enhance testing workflows by enabling precise analysis of API interactions.

With the Requestly Interceptor Desktop App, you can capture and analyze network activity effortlessly. This guide will walk you through the steps to create, manage, and utilize API sessions effectively.

<Warning>
  This feature is available only on <a target="_blank" href="https://requestly.com/downloads/">Desktop App</a>.
</Warning>

## How to Create an API Session in Requestly Interceptor

Creating an API session in Requestly Interceptor is straightforward, allowing you to record, import, and analyze network traffic with ease. Here are three methods to get started:

### Save Captured Live Traffic with HTTP Interceptor

One way to create an API session in Requestly Interceptor is by saving captured traffic using the **HTTP Interceptor** while monitoring a browser or an app’s traffic. This allows you to share or analyze the traffic later.

Here's how:

<Steps>
  <Step title="Navigate to the Network Table">
    Open the Requestly Interceptor desktop and access the Network Table.
  </Step>

  <Step title="Connect an App">
    Click the `Connect Apps` button

    <img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/e27862b0-793d-40b9-b2f1-4b0fc2464a13.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=b2635ca74987b3cd70afda4852f0732f" align="center" fullwidth="false" width="2400" height="1620" data-path="images/record-api-sessions/e27862b0-793d-40b9-b2f1-4b0fc2464a13.png" />
  </Step>

  <Step title="Select the Traffic Source">
    Choose from where you want to intercept traffic (e.g., browser, Android, iOS). Click **Open/Launch** for browser traffic and follow the instructions for mobile traffic.

    <img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/9238e6e6-0dab-42d1-8f2a-30cee28053bb.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=6ccbea523f2fae55c784d6a842bb4797" align="center" fullwidth="false" width="2400" height="1530" data-path="images/record-api-sessions/9238e6e6-0dab-42d1-8f2a-30cee28053bb.png" />
  </Step>

  <Step title="Capture and Save Traffic">
    As traffic gets intercepted, perform relevant activities. When you're ready to save the session, click the `Save` button.

    <img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/d9cbfef7-6811-4b36-863f-6411702c5362.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=91d2729121ce51fbc16567bd0fe64f63" align="center" fullwidth="false" width="2400" height="1620" data-path="images/record-api-sessions/d9cbfef7-6811-4b36-863f-6411702c5362.png" />
  </Step>
</Steps>

### Import a HAR File

Another method is to **import a HAR file**, which can be generated from various sources, including browser network sessions, other interceptors, or even Requestly Interceptor's traffic interceptor.

Follow these steps:

<Steps>
  <Step title="Export the HAR File">
    Generate and **export the HAR** file from your preferred source.
  </Step>

  <Step title="Import into Requestly Interceptor">
    In the Requestly Interceptor app, go to the **Sessions** tab and click **Import HAR**.

    <img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/60864cc6-0519-4d29-9031-0fde2fc5a303.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=1e1393b8cd0f9d90c3e2bc32f9e31b2c" align="center" fullwidth="false" width="2400" height="1620" data-path="images/record-api-sessions/60864cc6-0519-4d29-9031-0fde2fc5a303.png" />
  </Step>

  <Step title="Analyze the Session">
    Once imported, you can start analyzing the session data.
  </Step>
</Steps>

### Import a .rqly File

Requestly Interceptor also supports importing its proprietary `.rqly` file format. This is useful for loading sessions captured from browser-based Sessions workflows.

Here's how:

<Steps>
  <Step title="Download the Session">
    Navigate to the desired session in the web app's Session and click **Download**.

    <img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/fd44be4c-1820-4343-82b8-80be502f3dd4.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=bc7cc61b112d834af4a4f1fd975f21b9" align="center" fullwidth="false" width="2400" height="1208" data-path="images/record-api-sessions/fd44be4c-1820-4343-82b8-80be502f3dd4.png" />
  </Step>

  <Step title="Import into Requestly Interceptor">
    In the Requestly Interceptor Desktop App, click **Import .rqly File** and upload the downloaded file.

    <img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/de206470-f4a2-4e72-87fa-8c3fc8aded39.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=031174881a0459d80abe41356f727077" align="center" fullwidth="false" width="2400" height="1620" data-path="images/record-api-sessions/de206470-f4a2-4e72-87fa-8c3fc8aded39.png" />
  </Step>
</Steps>

You can view the saved session later under the **Sessions** tab on the left side of the app.

***

## Session Interface

<img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/2b2020df-250b-4350-882e-239dd34ad792.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=82310a9e6a8d71acd17008d03329c9ee" align="center" fullwidth="false" width="2400" height="1530" data-path="images/record-api-sessions/2b2020df-250b-4350-882e-239dd34ad792.png" />

### Search and Filters

<img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/ae78ca53-6210-4eec-9137-98d9c93f8af6.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=ba9f5927f93584243f57ed66367a2b7e" align="center" fullwidth="false" width="2400" height="416" data-path="images/record-api-sessions/ae78ca53-6210-4eec-9137-98d9c93f8af6.png" />

* **Search URL**: Look for specific requests by entering part of the URL, a wildcard, or a regular expression.

* **Filter by Method**: Narrow requests using HTTP methods like GET, POST, or PUT.

* **Filter by Status Code**: Filter responses by status codes (e.g., 200 for success, 404 for not found).

* **Filter by Resource Type**: Focus on resource types such as CSS files, JavaScript files, or images.

* **Modified Requests**: Check this box to see only requests altered by your applied rules.

* **Clear All**: Reset all filters to view the full list of requests.

### Traffic Table

<img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/f35800fc-4548-4d1e-95fd-9634f90f4436.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=8bfcb5e6761e9ed2d5325f618ed26c29" align="center" fullwidth="false" width="2400" height="1102" data-path="images/record-api-sessions/f35800fc-4548-4d1e-95fd-9634f90f4436.png" />

The main table provides a detailed overview of network requests, including:

* **Time**: The timestamp of each request.

* **URL**: The accessed URLs for better visibility into endpoints.

* **Method**: The HTTP method used (e.g., GET, POST).

* **Content-Type**: The type of content being transmitted (e.g., `text/css`, `application/json`).

* **Status**: The HTTP response status code (e.g., 200, 404).

### Details Section (Bottom Panel)

<img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/8ea7dcc1-9a49-49db-bced-1b1616453695.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=0510e8bf610c9eceaffa2aa9bb929c9a" align="center" fullwidth="false" width="2400" height="648" data-path="images/record-api-sessions/8ea7dcc1-9a49-49db-bced-1b1616453695.png" />

The bottom panel provides detailed information about selected requests, including

* **Request Details**: View the HTTP method, path, host, and port.

* **Headers**: Inspect request and response headers.

* **Payload**: Check data sent with the request (e.g., for POST requests).

* **Body**: Examine the response body.

* **Preview**: Render response content, such as HTML or CSS, if applicable

### Action Buttons

* **Create Mocks**: Simulate backend responses for testing and development without relying on an actual server. You can also perform **bulk mocking** to create multiple mock responses at once, streamlining the testing process.

* **Delete Sessions**: Remove old or unnecessary sessions to keep your workflow organized.

* **Download HAR Files**: Export HTTP Archive (HAR) files to analyze network activity and debug issues easily.

## Additional Features

### Bulk Mocking

Create multiple mock responses at once to save time and simplify your testing. This feature lets you simulate different backend scenarios, speeding up both development and testing.

With Bulk Mocking, you can quickly create mock responses for selected requests in a session, streamlining your workflow. Once your mocks are created, you can view and manage them easily.

For more detailed instructions, check out our <a target="_blank" href="/api-mocking/create-local-api-mocks#using-recorded-sessions-for-bulk-api-mocking">Bulk Mocking Guide</a>.

### Saving and Sharing Sessions

You can keep your session data for later use or **share it** with others. Use the **Export HAR** option to download session data, which can be shared or re-imported into Requestly Interceptor. To learn more, visit the <a target="_blank" href="/sessions/import-view-har-file">**Import/View HAR file page**</a>.

### Creating Rules from Captured Sessions

Requestly Interceptor allows you to use captured sessions to create rules tailored to specific testing scenarios. This method helps replicate real-world conditions effectively. Here's how you can leverage sessions to define rules:

**Popular Use Cases**

* **Redirect Requests:** Create rules to reroute specific URLs to alternative endpoints for testing purposes.

* **Modify Headers:** Adjust request or response headers to simulate various environments or configurations.

* **Delay Responses:** Introduce network delays to observe how your app handles slow response times.

Here’s how to create a Rule from Captured Sessions:

<Steps>
  <Step title="Open Your Session">
    Open Your Session and Right-click any request from the traffic table.
  </Step>

  <Step title="Select a Rule Type:">
    Choose a rule type (e.g., Redirect URL, Modify Header).

    <img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/98aa04ca-f9cb-44bf-aecb-438cc6eebd56.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=c5a890a4f8d0d177deedafd6bfa6ded4" align="center" fullwidth="false" width="2400" height="1530" data-path="images/record-api-sessions/98aa04ca-f9cb-44bf-aecb-438cc6eebd56.png" />
  </Step>

  <Step title="Configure the Rule:">
    Configure the rule as needed for your testing scenario.

    <img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/246a9604-43b1-440f-9a1c-854a12a0803e.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=ee9d014f1094f56d9350a79abb033409" align="center" fullwidth="false" width="2400" height="1530" data-path="images/record-api-sessions/246a9604-43b1-440f-9a1c-854a12a0803e.png" />
  </Step>

  <Step title="Save the Rule:">
    Click `Save` to finalize and apply the rule.
  </Step>
</Steps>

### Edit and Replay

The Edit and Replay feature lets you send API requests to an endpoint and modify various parameters like headers, body, query parameters, and more. This functionality acts as an integrated API client within your sessions, making it easier to test and modify API requests directly.

<img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/12630239-ec3c-48f6-bc09-7374c3079f8a.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=069a31e9701e8b1982bc46e254d96bb5" align="center" fullwidth="false" width="2400" height="1530" data-path="images/record-api-sessions/12630239-ec3c-48f6-bc09-7374c3079f8a.png" />

Here’s how to use Edit and Replay :

<Steps>
  <Step title="Select a Session">
    In your session, choose the interaction or API request you want to analyze. **Right-click** the session and click **Edit and Replay**.

    <img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/0d9debea-50bb-4c8f-b3e1-2e40fb30e195.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=a92154a38294bb7dbf3d4e36b9769795" align="center" fullwidth="false" width="2400" height="1530" data-path="images/record-api-sessions/0d9debea-50bb-4c8f-b3e1-2e40fb30e195.png" />
  </Step>

  <Step title="Analyze Session Data">
    Review the recorded parameters, including headers, body, and query parameters, to understand the request behavior.

    <img src="https://mintcdn.com/interceptor/8EZFE0FR6CIM9m_C/images/record-api-sessions/e8d5113d-3fd0-41c1-8efa-1356fa1a440a.png?fit=max&auto=format&n=8EZFE0FR6CIM9m_C&q=85&s=05c9ba28fb3fd4a2f1531e241c6b115e" align="center" fullwidth="false" width="2400" height="1530" data-path="images/record-api-sessions/e8d5113d-3fd0-41c1-8efa-1356fa1a440a.png" />
  </Step>

  <Step title="Replay and Debug">
    After analyzing the session, click the **Send** button to resend the modified request and debug the issue effectively.
  </Step>
</Steps>
