# Test live requests in Replay

Replay opens on the synthetic documentation mock server. You can explore every published operation without a key and without reaching a dealership environment.

If you have a dealership API key, select **Connect live** in Replay. Enter the key once for the browser tab. The portal exchanges it directly with DX1, discards the key, and configures the live environment with the returned short-lived bearer token and `api_url`.

The live session is reused automatically when you move between DX1 Dealership API operations. You do not need to re-enter the key for each request. You must reconnect when the token expires or after you close the browser tab.

## Connect a live session

1. Open a DX1 Dealership API operation and select **Try It**.
2. Leave the documentation mock server selected if you only want synthetic data.
3. To send live requests, select **Connect live** in the Replay toolbar.
4. Enter the dealership API key and select **Connect live**.
5. Confirm that the environment changes to **DX1 live API (session)**.
6. Start with an Inventory operation, `Take: 1`, and `Skip: 0`.


The browser sends the key only to `https://api.dx1app.com/api/Authentication/ValidateAccessKey`. A successful response supplies the bearer token, its lifetime, and the dealership-specific API route. The browser then sends operation requests directly to that returned DX1 route; requests do not pass through the documentation CORS proxy.

## Credential lifetime and storage

- The dealership API key exists only in the connection form and authentication request. The portal does not save it.
- The returned bearer token and `api_url` are saved in browser tab session storage so they can be reused across operations.
- The live session is removed when the tab closes, when the token expires, or when you select **Disconnect live**.
- After expiration, Replay returns to the mock server and asks for the key again before another live session can begin.


## Protect live data

Live responses may contain dealership or customer information. Use the smallest useful result size, begin with Inventory instead of Customer or Lead, and do not capture or share live response bodies.

Select **Disconnect live** when finished. Clear Replay request history if a live response contained sensitive data. You can continue using the mock environment without a key.

Direct-browser execution depends on CORS support from the token endpoint and the particular `api_url` returned for the dealership. The tested route supports it, but a different route may require DevOps to enable the documentation origins and the `Authorization`, `Content-Type`, and `Accept` request headers.