Requests in Insomnia

Uses: Insomnia
Related Documentation
Related Resources

How do I create requests in Insomnia?

In Insomnia, requests are contained in collections. Before you can create a request, you need to create a collection. To do that, click Create > Request collection in your Insomnia project.

Once your collection is created, there are several ways to create requests. Click the + button and select an option:

Option

Steps

Create a request from scratch Select the type or request to create (HTTP, Event Stream, GraphQL, gRPC, or WebSocket).
Import a cURL command Select From Curl, then paste your command and click Import.
Import from a file (Postman collection, Swagger, OpenAPI, HAR, WSDL) Click From File, select an import option (file, URL, or clipboard), specify the file to import, then click Scan and Import.

How can I configure requests?

In Insomnia, you can configure every part of your request, and you can also add scripts and documentation.

All of these options apply to HTTP, GraphQL, and event stream requests. WebSocket requests have all of these expect for methods and scripts, and gRPC requests have a completely different configuration.

Element

Steps

Method Select an HTTP method in the dropdown list, or add a custom method.
Endpoint Enter a URL, and use environment variables and template tags if needed.
Query parameters In the Params tab, click Add to create a new query parameter and enter the name and value. You can also add a description. The value can be single line or multi-line text. You can use the checkbox next to the parameter to remove it from the URL without deleting it completely.
Body In the Body tab, select the type of body from the dropdown list.
Authentication In the Auth tab, select the authentication type from the dropdown list to get the corresponding form. If the request is in a folder, you can select Inherit from parent to use the folder’s authentication.
Headers In the Headers tab, click Add to create a new header and enter the name and value. You can also add a description. You can use the checkbox next to the header to remove it from the request without deleting it completely.
Scripts In the Scripts tab, select Pre-request or After-response and write your script.
Docs In the Docs tab, select Write to add documentation to the request. You can use Markdown and HTML syntax, and you can click Preview to see the rendered content.

What can I do with requests?

You can simply click Send to send a request, but you can also click the context menu to see more options.

These options are only available for HTTP and event stream requests.

Option

Description

Generate Client Code Generate code based on your request. You can choose from a variety of languages.
Send After Delay Send the request after the specified amount of time.
Repeat On Interval Send the request on a loop with a specific interval. The loop needs to be stopped manually by clicking Cancel.

WebSocket support in Insomnia

Insomnia supports WebSocket requests alongside REST, GraphQL, and gRPC, allowing bi-directional data flow over a persistent connection. You can configure authentication, headers, and message formats using the request interface.

WebSocket messages can be sent in JSON or raw formats, and received messages appear in the Events panel. Detailed previews are available for both sent and received messages.

Environment variables and limitations

Insomnia 2022.6 adds support for environment variables and Nunjucks template tags in WebSocket URLs and message bodies.

Limitations include:

  • Custom WebSocket protocols aren’t supported.
  • Syncing WebSocket requests across different Insomnia versions (pre- and post-2022.6) may result in data loss. Ensure all devices are on version 2022.6 or later when using sync.

SOAP requests

SOAP (simple object access protocol) is an XML-based protocol used to communicate structured data. To send a SOAP request from Insomnia, select the XML body type and setting the Content-Type header to text/xml. Then, construct your XML body as required.

Posting CSV data

To send CSV data in a POST request, set the request body type to Binary file and select your CSV file. Ensure that the appropriate Content-Type headers (for example, text/csv) are configured based on the API requirements.

This method allows you to send raw CSV files directly in the request payload.

What can I do with folders in a request collection?

Folders can be used to organize requests, but you can also add configuration to be used by all requests in the folder:

  • Authentication
  • Headers
  • Scripts
  • Environment variables

You can also add documentation about the folder.

FAQs

Insomnia supports:

  • HTTP
  • Event streams (SSE)
  • GraphQL
  • gRPC
  • WebSocket

Yes. Insomnia automatically encodes special characters in request URLs. This behavior ensures proper formatting for HTTP requests, but it may cause issues for users who intentionally want to send characters without encoding.

After sending a request, open the Timeline tab on the right-side panel. This shows the exact encoded request that was transmitted, allowing you to verify how special characters were handled.

Here are a few options for troubleshooting special character encoding issues:

  • Manually encode your request using tools like urlencoder or W3Schools
  • Use the Insomnia encoder plugin
  • Suggest advanced options like:
    • Per-parameter encoding toggle
    • Global workspace setting for encoding behavior
    • Character allowlist for fine-grained control
    • Disabling encoding entirely (not recommended unless necessary)
  1. Quit Insomnia and back up your app data directory. See Application Data for location info.
  2. Open the insomnia.requests.db file in a code editor.
  3. Find the offending request and clear its body field.
  4. Search for any other uses of the same request ID and clear those body fields as well.
  5. Save and relaunch Insomnia.
Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!