Reference: Integration with Insomnia API Client

You can upload a Tanium Gateway example requests json file to the Insomnia API client, configure communications between Insomnia and Tanium Cloud, and submit example requests and receive responses. Insomnia can also parse the example requests and generate code samples based on the requests.

Prerequisites

  • Download the Insomnia API client and install it on an endpoint that can bidirectionally communicate with Tanium Cloud. Ensure that your Insomnia API client version supports importing the Insomnia v4 json file format.

  • Download one of the following JSON files that contains Tanium Gateway Insomnia example requests:

    • Tanium Gateway Insomnia example requests collection (json file) through January 2026

    • new Tanium Gateway Insomnia example requests (json file) added after February 2025 (as of August 2025)

    • Tanium Gateway Insomnia example requests collection (json file) through August 2025

    • Tanium Gateway Insomnia example requests collection (json file) through January 2025

    • new Tanium Gateway Insomnia example requests (json file) added after August 2024 (as of January 2025)

    • Tanium Gateway Insomnia example requests collection (json file) through November 2024

    • new Tanium Gateway Insomnia example requests (json file) added after May 2024 (as of August 2024)

    • Tanium Gateway Insomnia example requests collection (json file) through August 2024

  • In Tanium Console, create a user account for the integration. Add this user to the Gateway User role, and any other roles based on the Tanium solutions against which you want to submit requests. For more information about how to create a user, see Managing users. For more information about supported Tanium solutions, see Gateway requirements.

    Note: If you create an integration user in Tanium Console, you must also create a matching integration user in the identity provider that you use for Tanium. For more information, see Create a user and User authentication.
  • In Tanium Console, create an API token for this user account and copy the token to your clipboard. For more information, see Create an API token.

Configure Insomnia to communicate with Tanium

Important: Back up your workspace before importing a json file. If you previously imported a Tanium Gateway example requests json file and made updates in the workspace, then import another json file into the project, it might overwrite your workspace changes.
  1. In the Insomnia client, click + next to Projects.
  2. Enter a project name, then click Create.
  3. From the new project, select Create > Request Collection.
  4. Enter a collection name, then click Create.
  5. Select collection_name > Import/Export > Import.
  6. Select the Tanium Gateway Insomnia example requests file, then click Scan.
  7. Click Import.
  8. Select project_name > collection_name. Confirm that the import succeeded and the example syntax is loaded.

    If you previously imported a Tanium Gateway Insomnia example requests file into a project or collection, the import might overwrite your existing workspace.

  9. From the new project, select No Environment > Manage Environments.
  10. If table view is enabled, click Table Edit to enable json editing.
  11. Copy the following json object, then paste it in the Base Environment pane:
    JSON
    {
      "url": "https://",
      "path": "/plugin/products/gateway/graphql",
      "api_token": "token-string"
    }
  12. Update the url value to https://<customerName>-api.cloud.tanium.com, replacing <customerName> with your Tanium Cloud instance domain name.
  13. Update the api_token value to the API token string associated with your integration user. Click Close.

Verify integration

  1. In the Insomnia client, select project_name > collection_name.
  2. Expand General examples and then click Time. Verify that the request path is POST _.url_.path.
  3. Click Header and verify that the session header is set to the _.api_token variable, and that the Content-Type header is set to application/json.
  4. Click Send. The Gateway service responds with the current system time, such as the following:
    JSON
    {
      "data": {
        "now": "2021-11-08T19:22:03Z"
      }
    }

Generate code example from example request

  1. In the Insomnia client, right-click an example, then select Generate Code.
  2. Select a language from the dropdown list, then an associated library from the dropdown list. The code example updates as you select a language and library.