# PRO TIP - Dynatrace Grail Storage Management API Postman Collection

**URL:** <https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637>\
**Category:** Dynatrace Tips\
**Tags:** usability, integrations, grail, latest-dynatrace, tips-and-tricks, dynatrace-api\
**Created:** [November 15, 2023, 4:40pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637 "2023-11-15T16:40:06Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [November 15, 2023, 4:40pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/1 "2023-11-15T16:40:06Z")

</div>

A few months ago I shared a [Postman collection](https://community.dynatrace.com/post/221026) for the [Account management API](https://www.dynatrace.com/support/help/shortlink/account-api) with the community.Right now, I share the link to a recently created [Postman Collection](https://github.com/dstanizzo/Dynatrace-API-Grail.Storage.Management-Postman-Collection) for the Grail Storage Management API.I share the steps to get this working in your Postman client.

## 1. Create an Oauth2 Client in Dynatrace.

For more reference in this step you can take a look at [this](https://community.dynatrace.com/post/217350) post from [@AgataWlodarczyk](https://community.dynatrace.com/user/45226) with a video from [@adam\_gardner](https://community.dynatrace.com/user/167)

1. Open the User menu and select Account settings (in latest Dynatrace, Account Management).
2. On the top navigation bar, go to Identity & access management \> OAuth clients.
3. Select Create client.
4. Provide an email of the user who owns the client.
5. Provide a description for the new client.
6. Select the required token scopes. These are the scopes that the client will be able to grant. Tokens generated by the client might have different scope sets.
  - Grants permission to read records from the events-table **storage:events:read**
  - Grants permission to read timeseries from the metrics-table **storage:metrics:read**
  - Grants permission to read records from the logs-table **storage:logs:read**
  - Grants permission to read records from the entities-table **storage:entities:read**
  - Grants permission to read records from the bizevents-table **storage:bizevents:read**
  - Grants permission to read records from all system tables **storage:system:read**
  - Grants permission to read records from Grail buckets. Required additionally to a table permission. **storage:buckets:read**
  - Grants permission to read bucket definitions from Grail **storage:bucket-definitions:read**
  - Grants permission to write bucket definitions to Grail **storage:bucket-definitions:write**
  - Grants permission to delete bucket definitions from Grail **storage:bucket-definitions:delete**
  - Grants permission to delete all records from a bucket (not delete the bucket itself) in Grail. **storage:bucket-definitions:truncate**

7. Select Create client.
8. Copy the generated information to the clipboard. Store it in a password manager for future use.

## 2. Create an Environment for your Collection in Postman.

 ![Environment](https://global.discourse-cdn.com/dynatrace/original/3X/0/b/0b20c8605404bc09f33c5b21f09ae18de5ae4462.png)

1. Select Environments.
2. Click the + sign.
3. Name your Environment.
4. The environment needs that you define these variables:
  - **DT\_CLIENT\_ID** Provided when you create the Oauth2 client in step 1.
  - **DT\_CLIENT\_SECRET** Provided when you create the Oauth2 client in step 1.
  - **DT\_ACCOUNT\_URN** Provided when you create the Oauth2 client in step 1.
  - **DT\_UUID** Same value of DT\_ACCOUNT\_URN but stripping the urn:account:
  - **DT\_SCOPE** A list of required scopes separated by a whitespace.
  - **DT\_TOKEN\_URL ⚠**** PLEASE DON’T CHANGE THIS VALUE ⚠**The URL _[https://sso.dynatrace.com/sso/oauth2/token](https://sso.dynatrace.com/sso/oauth2/token)_ where you need to obtain your Bearer token after create the Oauth2 client.
  - **DT\_TOKEN\_NAME** The name for your token.
  - **DT\_TOKEN** In this variable you will store your assigned dynamic token.
  - **DT\_HOST** ⚠ **PLEASE DON’T CHANGE THIS VALUE​⚠** The URL _[api.dynatrace.com](http://api.dynatrace.com)_ of the Dynatrace API for Account Management.
  - **DT\_SaaS\_HOST** Your Environment ID url for the Latest Dynatrace **{your-environment-id}.apps.dynatrace.com**

5. Leave this Environment Selected.

## 3. Import Dynatrace Grail Storage Management API Collection.

 ![DanielS_16-1700063605929.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/3/4357224e8a0d45c67503fe43c48b60744c80ef3b.png)

Import

1. Download the [Dynatrace Grail Storage Management](https://github.com/dstanizzo/Dynatrace-API-Grail.Storage.Management-Postman-Collection) JSON from the repository.
2. Select Collections.
3. Click on Import and choose the previously downloaded JSON.
4. Your Dynatrace Grail Storage Management API v1 Collection has been added to your collection.

## 4. Get your Bearer Token.

 ![DanielS_7-1700063173526.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/7/b71dc35d526b170a10dbb9c6727d13516dd93d05.jpeg)

Get your Bearer Token

1. **⚠DON’T FORGET TO HAVE SELECTED THE ENVIRONMENT CREATED IN STEP 2 ⚠**
2. Select your recently imported Dynatrace Grail Storage Management API v1 Collection.
3. Click on the Authorization tab.
4. Click on Get New Access Token.
5. Wait until the token has been collected.
6. Click on Use Token.
7. **⚠BE SURE TO SELECT ALL YOUR TOKEN ⚠** And then select Set as variable.
8. Choose the **DT\_TOKEN** variable to store your new Bearer Token.

## 5. Ready, Set, Go.

 ![DanielS_17-1700063635912.png](https://global.discourse-cdn.com/dynatrace/original/1X/b8559d009fc4c64ccd779a481f4260cc2405dff3.png)

Using Collection

1. **⚠DON’T FORGET TO HAVE SELECTED THE ENVIRONMENT CREATED IN STEP 2 ⚠**
2. Select Collections.
3. Then Select the Request you want to use and check the parameters.
4. Click on Send.
5. And if everything goes well you get your Response, but if it didn’t go well, continue to the next step.

## 6. Troubleshooting Grail IAM Permissions.

 ![DanielS_0-1700695087937.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/3/6368b09d6dbd7a5aff37e6c3f22f677ecf6a4f83.png)

At this point, if you are receiving _Required permissions not met_ it means that the Oauth&nbsp; 2.0 Token is working, but you are lacking the Dynatrace Identity and Access Management (IAM) framework permissions on the user you assign the Oauth 2.0 Token.

## 7. Create Grail Storage Admin Policy.

 ![DanielS_1-1700695712062.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/7d5bb4ebb99a712f04215c3e67f9b2d73d79ae9d.png)

1. Open the User menu and select Account settings (in latest Dynatrace, Account Management).  
On the top navigation bar, go to Identity & access management \> Policies.
2. Select Create policy, and set a name.
3. Write the policy statements as seen in the image. Note that for bucket management you only need the **storage:bucket-definitions** statements (8,9,10,11). But this policy is intended to be used by an Admin so it’s a bit more permissive.
4. Save it and you are ready with the policy.

## 8. Create Storage Manager Group.

 ![DanielS_2-1700696776667.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/2/824f38de19b569b2c7d204be3c048e1f0cdbf1d9.jpeg)

1. Open the User menu and select Account settings (in latest Dynatrace, Account Management).  
On the top navigation bar, go to Identity & access management \> Groups.
2. Select Create group, and set a name.
3. Under the Policies section click edit and assign the Policy **Storage - Admin** you created on the previous section **Create Grail Storage Admin Policy**.
4. Save it and we are ready with the group and policy assignment.

## 9. Assign Storage Manager Group to your Grail Admin User.

 ![DanielS_3-1700696984127.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/73f975a97abf92c9ef8137fcd43eaaaa21bcb7f6.png)

1. Open the User menu and select Account settings (in latest Dynatrace, Account Management).  
On the top navigation bar, go to Identity & access management \> People.
2. ![DanielS_6-1700697149006.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/5/95730d5b734446543ff45c35b85b62e041225b3e.png)  
**Search for the same user to which you assign the Oauth 2.0 Token.**  
 ![DanielS_6-1700697149006.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/5/95730d5b734446543ff45c35b85b62e041225b3e.png)
3. Edit the user and assign the **Storage Manager Group** you created in the previous step **Create Storage Manager Group**.
4. All set.

## 10. Ready to invoke the API call.

 ![DanielS_8-1700697413508.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/83f4119726bd0abe54c6ebcc0037193dcbf9007f.png)

1. Go back to Postman and invoke the API call. You should now get Code 200 and a response like the image.

## 11. Useful Resources

I also leave the links to great posts from Dynatrace blog and docs. They help to assign user permissions and have all this working.

- [Tailored access management, Part 2: Onboard users to Grail and AppEngine](https://www.dynatrace.com/news/blog/tailored-access-management-part-2-onboard-users-to-grail-and-appengine/)
- [Permissions in Grail](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions)
- And this great post from [@HansLougas](https://community.dynatrace.com/user/45442)&nbsp;[Enhance data management with Grail: Ultimate guide to custom buckets and security policies](https://www.dynatrace.com/news/blog/enhance-data-management-with-grail-ultimate-guide-to-custom-buckets-and-security-policies/)

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [November 15, 2023, 7:14pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/2 "2023-11-15T19:14:31Z")

</div>

Hi&nbsp;[@DanielS](https://community.dynatrace.com/user/35788),

WOOOOWWW! Thanks for sharing it!&nbsp;:dynaspin:

Best regards,

Mizső

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [November 15, 2023, 7:34pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/3 "2023-11-15T19:34:43Z")

</div>

[@DanielS](https://community.dynatrace.com/user/35788),

Have to try it out! Great stuff!

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [November 15, 2023, 9:33pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/4 "2023-11-15T21:33:01Z")

</div>

Let me know if you need something. Thanks.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [November 15, 2023, 9:37pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/5 "2023-11-15T21:37:22Z")

</div>

👌:dynatrace:👌:dynatrace:👌:dynatrace:👌:dynatrace:👌:dynatrace:👌:dynatrace:👌:dynatrace:👌:dynatrace:👌:dynatrace:

You are welcome. Just my two cents for the community.

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [November 16, 2023, 12:23pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/6 "2023-11-16T12:23:03Z")

</div>

[@DanielS](https://community.dynatrace.com/user/35788)&nbsp;power​🔥

---

<div class="post-metadata">

**Author:** ![DenisL](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@DenisL](https://community.dynatrace.com/u/DenisL)\
**Post date:** [December 12, 2023, 10:33pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/7 "2023-12-12T22:33:25Z")

</div>

The level of detail, steps-by-step is impressive for newcomers too!  
Thank you for taking the time to create and share this Dan.. it is VERY appreciated!

THANK YOU for sharing your efforts my friend!!!

---

<div class="post-metadata">

**Author:** ![gabriel\_casella](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gabriel_casella/32/4932_2.png) [@gabriel\_casella](https://community.dynatrace.com/u/gabriel_casella)\
**Post date:** [December 28, 2023, 1:47pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/8 "2023-12-28T13:47:08Z")

</div>

[@DanielS](https://community.dynatrace.com/user/35788)&nbsp;many thanks for this complete guide on how to do this! Plus the postman collection with the Token refresh is magnific!

I also would like to say that (at least for me on yet Postman v9.31.27),  
[I had to remove the comma on line 5, at the end of the line](https://github.com/dstanizzo/Dynatrace-API-Grail.Storage.Management-Postman-Collection/blob/c6f6de834e9130c7eeb456763a70eae2cf396ae9/Dynatrace%20Grail%20Storage%20Management%20API%20v1%20Collection/Dynatrace%20Grail%20Storage%20Management%20API%20v1.json#L5). Otherwise the JSON is invalid, and Postman does not import the collection.

Not sure if on Postman v10 it works fine though.

Thanks!

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [December 28, 2023, 7:06pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/9 "2023-12-28T19:06:47Z")

</div>

Thanks for your feedback&nbsp;[@gabriel\_casella](https://community.dynatrace.com/user/6137)&nbsp;and the note on Postman versions, I gonna try it on another machine because right now I’m using the web version of Postman. I’m glad to hear this is helpful because it took some effort to make. Thanks again.

---

<div class="post-metadata">

**Author:** ![samgar-kali](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@samgar-kali](https://community.dynatrace.com/u/samgar-kali)\
**Post date:** [April 1, 2024, 8:34pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/10 "2024-04-01T20:34:05Z")

</div>

Thank you for this awesome guide. I have one question: “Do we need to update the expired bearer token manually?”

It looks like, currently Dynatrace does not have a “refresh token” and Postman can not auto refresh it.

[Authenticate with OAuth 2.0 authentication in Postman | Postman Docs](https://learning.postman.com/docs/sending-requests/authorization/oauth-20/#requesting-an-oauth-20-token:~:text=Postman%20can%27t%20refresh%20the%20access%20tokens%20without%20the%20refresh%20token).

---

<div class="post-metadata">

**Author:** ![Malaik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/malaik/32/32673_2.png) [@Malaik](https://community.dynatrace.com/u/Malaik)\
**Post date:** [April 2, 2024, 7:15am UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/11 "2024-04-02T07:15:29Z")

</div>

Good JOB.

not yet on grail, but should try it once moved.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [April 2, 2024, 7:37pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/12 "2024-04-02T19:37:17Z")

</div>

Hello [@samgar-kali](https://community.dynatrace.com/user/57948). Yes, right now,&nbsp; once expired you need to refresh the token manually.

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [August 2, 2024, 11:07am UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/13 "2024-08-02T11:07:59Z")

</div>

Very very useful. Good job and thanks a lot for sharing, Daniel.

Regards,

Elena.

---

<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:** [November 4, 2025, 5:10pm UTC](https://community.dynatrace.com/t/pro-tip-dynatrace-grail-storage-management-api-postman-collection/42637/14 "2025-11-04T17:10:22Z")

</div>

thanks&nbsp;[@gabriel\_casella](https://community.dynatrace.com/user/6137) ,&nbsp;it would have taken me a while to find that komma 🙂 (Postman&nbsp;Version 11.70.1, MacOS)
