# Create and manage custom log buckets - Grail Dynatrace API

**URL:** <https://community.dynatrace.com/t/create-and-manage-custom-log-buckets-grail-dynatrace-api/42043>\
**Category:** Logs\
**Tags:** grail, dynatrace-api, logs\
**Created:** [October 11, 2023, 5:59pm UTC](https://community.dynatrace.com/t/create-and-manage-custom-log-buckets-grail-dynatrace-api/42043 "2023-10-11T17:59:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hallstev5](https://avatars.discourse-cdn.com/v4/letter/h/85f322/32.png) [@hallstev5](https://community.dynatrace.com/u/hallstev5)\
**Post date:** [October 11, 2023, 5:59pm UTC](https://community.dynatrace.com/t/create-and-manage-custom-log-buckets-grail-dynatrace-api/42043/1 "2023-10-11T17:59:11Z")

</div>

I am attempting to create custom grail buckets following the instructions from the following link

[Grail data model | Dynatrace Docs](https://www.dynatrace.com/support/help/platform/grail/data-model#custom-grail-buckets)

I select the Bucket Management under the definition after going to the Dynatrace API.&nbsp; I create a OAuth client in account management under Identity and Access management.&nbsp; For this client I selected the following scopes:&nbsp; “storage:buckets:read, storage:bucket-definitions:read, storage:bucket-definitions:write, storage:bucket-definitions:delete, storage:bucket-definitions:truncate, account-env-read”

I wrote a powershell script to get the OAuth2 access token:

used:

grant\_type = ‘client\_credentials’

client\_id = \<My client id from the oauth client i created"

client\_secret = \<from the oauth client i created"

resource = \<URN from oauth client"

scope = “storage:bucket-definitions:read”

I got the access token and when i make the API call to get the bucket definitions (should be only the default bucket) i receive 403, required permissions not met

What permissions am i missing from the OAuth client to get this to work?

---

<div class="post-metadata">

**Author:** ![mferstl](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mferstl/32/26292_2.png) [@mferstl](https://community.dynatrace.com/u/mferstl)\
**Post date:** [October 18, 2023, 11:02am UTC](https://community.dynatrace.com/t/create-and-manage-custom-log-buckets-grail-dynatrace-api/42043/2 "2023-10-18T11:02:58Z")

</div>

Hi,

I have the same issue, did you already find which permissions are missing?

br

Michael

---

<div class="post-metadata">

**Author:** ![mferstl](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mferstl/32/26292_2.png) [@mferstl](https://community.dynatrace.com/u/mferstl)\
**Post date:** [October 18, 2023, 11:56am UTC](https://community.dynatrace.com/t/create-and-manage-custom-log-buckets-grail-dynatrace-api/42043/3 "2023-10-18T11:56:31Z")

</div>

did you maybe forget this step:  
 → Make sure the User who is creating the Buckets via the API has the following permissions:  
--\> Create a Policy with the definition:  
ALLOW storage:bucket-definitions:read;  
ALLOW storage:bucket-definitions:write;

---

<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, 5:02pm UTC](https://community.dynatrace.com/t/create-and-manage-custom-log-buckets-grail-dynatrace-api/42043/4 "2023-11-15T17:02:19Z")

</div>

Hello, your powershell script is missing the scope storage:bucket-definitions:write. Also I leave you this guide [https://community.dynatrace.com/t5/Dynatrace-tips/PRO-TIP-Dynatrace-Grail-Storage-Management-API-Postman/td-p/228831](https://community.dynatrace.com/topic/228831)
