# Insomnia for effortless dynatrace API access across environments

**URL:** <https://community.dynatrace.com/t/insomnia-for-effortless-dynatrace-api-access-across-environments/37021>\
**Category:** Dynatrace Tips\
**Tags:** usability, dynatrace-api\
**Created:** [October 25, 2022, 2:52pm UTC](https://community.dynatrace.com/t/insomnia-for-effortless-dynatrace-api-access-across-environments/37021 "2022-10-25T14:52:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [October 25, 2022, 2:52pm UTC](https://community.dynatrace.com/t/insomnia-for-effortless-dynatrace-api-access-across-environments/37021/1 "2022-10-25T14:52:56Z")

</div>

I already have a collection for Postman [you can find here](https://community.dynatrace.com/post/116410).

I had a few requests for a Insomnia collection as well, so I created one. With this you have all Dynatrace API Endpoints in Insomnia and can switch easily between different dynatrace environments, clusters or tenants via Insomnia Environments.

I have put the files on&nbsp;[github](https://github.com/pahofmann/dynatrace-insomnia-collection),&nbsp;maybe someone will find it useful.

Setup is very quick, then you can just select the request and environment against which to execute it.

Here is a short guide:

Import collection

Import (Application → Preferences → Data → Impot Data) .json file for the&nbsp;[APIs](https://github.com/pahofmann/dynatrace-insomnia-collection/blob/main/specs/Dynatrace-All-APIs.json).

A collection&nbsp;Dynatrace APIs&nbsp;will be created with subfolders for each API:

 ![collections.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/2/821f1383f51f84befb14dc925850f20d7412cb18.png)

Create environments

For each of your dynatrace environments you want to use, add a insomnia environment&nbsp;environment dropdown → Manage Environments:

 ![manage-environments.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/a/1ac5d2374dfd169d2f1de4660bd267e26338b8a7.png)

You can adapt the&nbsp;Example Environment&nbsp;or create new ones based on it, you need to adjust the following:

- base\_url
  - URL to the environments
    - For managed:&nbsp;&nbsp;https: [//your-dt-domain.com/e/Environment-ID](https://your-dt-domain.com/e/Environment-ID)
      - https: [//example.com/e/b80b158e-ev23-4330-30fcc-c4391bbx6ce2](https://example.com/e/b80b158e-ev23-4330-30fcc-c4391bbx6ce2)

    - For managed (Cluster API):&nbsp;https: [//your-dt-domain.com](https://your-dt-domain.com)
      - https: [//example.com](https://example.com)

    - For SaaS:&nbsp;https: [//Env-ID.live.dynatrace.com](https://Env-ID.live.dynatrace.com)
      - https: [//abc133769.live.dynatrace.com](https://abc133769.live.dynatrace.com)

- authorization
  - Enter the token instead of&nbsp;REPLACE\_ME\_WITH\_TOKEN
    - Api-Token dt01.PUBLIC.SECRET

 ![new-environment.png](https://global.discourse-cdn.com/dynatrace/original/2X/0/08d2e278678f5d6a8a924c70d958d34039e96033.png)

## Request away!

Now you can open any request and easily execute it against different dynatrace environments by selecting the environment on the top left.

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [January 9, 2023, 10:25pm UTC](https://community.dynatrace.com/t/insomnia-for-effortless-dynatrace-api-access-across-environments/37021/2 "2023-01-09T22:25:18Z")

</div>

Thanks for the Pro Tip&nbsp;[@pahofmann](https://community.dynatrace.com/user/22796)

---

<div class="post-metadata">

**Author:** ![fstekelenburg](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fstekelenburg/32/22029_2.png) [@fstekelenburg](https://community.dynatrace.com/u/fstekelenburg)\
**Post date:** [March 5, 2023, 3:04pm UTC](https://community.dynatrace.com/t/insomnia-for-effortless-dynatrace-api-access-across-environments/37021/3 "2023-03-05T15:04:04Z")

</div>

Perhaps you can make the json file easy to download as you did for the postman collection.

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [March 6, 2023, 12:43pm UTC](https://community.dynatrace.com/t/insomnia-for-effortless-dynatrace-api-access-across-environments/37021/4 "2023-03-06T12:43:19Z")

</div>

You can find the JSON under&nbsp;_releases_&nbsp;on github:&nbsp;[Release Version 1.248 · pahofmann/dynatrace-insomnia-collection · GitHub](https://github.com/pahofmann/dynatrace-insomnia-collection/releases/tag/1.248)
