# Pynt for Insomnia

## **What is Insomnia?**

{% hint style="info" %}
💡 [**Insomnia**](https://insomnia.rest/) by Kong is a powerful API client and design tool known for its sleek, intuitive interface. It supports REST, GraphQL, and WebSockets, and offers features like environment variables, authentication helpers, and code generation to streamline API development.
{% endhint %}

<figure><img src="https://3462681674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZKwBF6q0tAGXlIih38HL%2Fuploads%2F7ZLNTv8asqLXDOZf1ZVv%2Fimage.png?alt=media&#x26;token=59577bca-a9f2-4dc6-bd90-4fd77f22244e" alt=""><figcaption><p>Insomnia</p></figcaption></figure>

***

## Pynt's Integration with Insomnia

As part of its [API security testing](https://docs.pynt.io/documentation/api-security-testing) suit, Pynt allows seamless integration with any Insomnia tests.

By integrating Pynt with Insomnia, you can leverage the power of this vast platform while enhancing your API security. Pynt automatically generates context-aware security tests based on your Insomnia  tests, enabling you to identify vulnerabilities early in the development cycle and reduce the risk of security issues in production.

***

## Quick start&#x20;

1. First, make sure Pynt's [prerequisites](https://docs.pynt.io/documentation/api-security-testing/prerequisites-for-running-pynt-scans) are met.
2. Follow the instructions to install Pynt container [here](https://docs.pynt.io/documentation/api-security-testing/how-to-install-pynt-cli).
3. Download [`insomnia_goat.json`](https://raw.githubusercontent.com/pynt-io/pynt/main/goat_functional_tests/Insomnia_goat.json) functional test and import it into Insomnia.

In this example, we will use [`pynt listen`](https://docs.pynt.io/documentation/api-security-testing/pynt-cli-modes/pynt-listen-cli-mode) and set it to capture all domains (no filter)

```bash
pynt listen --captured-domains "*"
```

***

## Configuring Insomnia to use Pynt as a proxy

1. Open Insomnia.
2. Navigate to the settings by clicking on "Preferences" or use the shortcut `Ctrl+,` (`Cmd+,` on macOS).
3. In the Preferences window, go to the "Proxy" tab.
4. Check the option "Enable HTTP Proxy".
5. Set the "HTTP Proxy" field to `127.0.0.1` and the "Port" to `6666`, which matches the Pynt listening address and port.
6. If you're working with HTTPS requests, also check "Enable HTTPS Proxy" and use the same proxy settings.
7. Close the Preferences window and proceed with your API requests as usual.

We will see the following output, meaning Pynt is listening on port 6666 for incoming traffic

<figure><img src="https://3462681674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZKwBF6q0tAGXlIih38HL%2Fuploads%2FDa7NBVJDCJvltbmEM17b%2Fimage.png?alt=media&#x26;token=0d5ce52c-9b0d-4d3a-866d-73ce6719d9c2" alt=""><figcaption><p>Pynt listen mode</p></figcaption></figure>

Run the goat tests on Insomnia, All the HTTP and HTTPS requests from Insomnia will now be routed through Pynt. When done, return to the terminal and hit Enter to start Pynt scan on the traffic generated by Insomnia

<figure><img src="https://3462681674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZKwBF6q0tAGXlIih38HL%2Fuploads%2FXnRIv8V7hIvtNiOLW6kG%2Fimage.png?alt=media&#x26;token=4174da27-1ca5-4f72-a116-537930917f70" alt=""><figcaption><p>Pynt for Insomnia example</p></figcaption></figure>

When the scan is complete the Pynt report will open in the browser.

***

{% hint style="info" %}
💡 **Pynt CLI Troubleshooting**: If you're encountering issues with Pynt's CLI, visit the [**Pynt CLI Troubleshooting Guide**](https://docs.pynt.io/documentation/api-security-testing/pynt-scans-troubleshooting/pynt-cli-troubleshooting) for solutions and troubleshooting tips.
{% endhint %}

{% hint style="info" %}
💡 **Still Need Help?** For any questions or troubleshooting, reach out to the [**Pynt Community Support**](https://www.pynt.io/community).
{% endhint %}
