Skip to main content

Configuring Insomnia for Sonrai GraphQL API

One-Click Least Privilege. Zero Disruption.



© 2025 Sonrai Security. All rights reserved.

Overview

The Sonrai GraphQL API library allow users to programatically run GraphQL queries for data and mutations to make updates & configuration changes, similar to the GraphQL commands in use by the user interface which can be run in the CPF application using Advanced Search. You can also use external third-party tools to query the Sonrai GraphQL API library, including:

This page describes configuration steps required to use the Sonrai GraphQL API with Insomnia.


Prerequisites

A successful token creation within the Sornai platform for use with Postman.
  • Retrieve your Sonrai Org Id by clicking the user profile icon on the top right:
Profile details in Sonrai, including Organization Id.

Configuring Insomnia

The Insomnia application has the ability to connect to the GraphQL server and run an “introspection” query, enabling documentation and autocomplete to work locally in the application.

To configure Insomnia:

  • Create a new request
  • Type POST
  • Select graphql

image-20220418161238305

  • Select the “Auth” tab and choose “Bearer Token” as the authentication type:

image-20220418161322516

  • Input your Org Id into the URL bar to query:
    • https://<yourOrgID>.sonraisecurity.com/graphql
info

https://<yourOrganization>.sonraisecurity.com/graphql (*if your Org does not display an Org ID)

  • On the “GraphQL” tab, select the “schema” button and select “Refresh Schema”:

image-20220418161337157

image-20220418161354431

After a couple of minutes, the schema will update:

image-20220418161408942

Once the schema updates, select the “Show Documentation” button. The Graphql Schema docs (a) should appear on the right side and autocomplete (b) should now be available:

a)

image-20220418161425599

image-20220418161454611

b)

image-20220418161513514