# DocumentsClient not working with admin-access

**URL:** <https://community.dynatrace.com/t/documentsclient-not-working-with-admin-access/51727>\
**Category:** Dashboarding\
**Tags:** dynatrace-sdk, dashboards\
**Created:** [May 21, 2025, 10:51am UTC](https://community.dynatrace.com/t/documentsclient-not-working-with-admin-access/51727 "2025-05-21T10:51:09Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![kumaravel](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kumaravel/32/41704_2.png) [@kumaravel](https://community.dynatrace.com/u/kumaravel)\
**Post date:** [May 21, 2025, 10:51am UTC](https://community.dynatrace.com/t/documentsclient-not-working-with-admin-access/51727/1 "2025-05-21T10:51:09Z")

</div>

Hello,

I am trying use the Dashboard Code option to build a panel listing all the documents in the environment.

```markup
import { documentsClient } from "@dynatrace-sdk/client-document";

export default async function () {
  const data = await documentsClient.listDocuments({
    pageSize: 1000,
    adminAccess: true,
    filter: "type == 'dashboard'"
  });
  return data
}

```

I am getting the below error

```markup
{
  "error": {
    "code": 540,
    "message": "Execution crashed.",
    "details": {
      "logs": "",
      "type": "UNCAUGHT_EXCEPTION",
      "message": "Uncaught (in promise) Forbidden: Insufficient permissions to request admin-access. errorRef: \"8eb588de-a8ff-46bd-8134-5af3c0fd76bd\"",
      "details": {
        "lineNumber": 3809,
        "startColumn": 19,
        "stack": "Forbidden: Insufficient permissions to request admin-access. errorRef: \"8eb588de-a8ff-46bd-8134-5af3c0fd76bd\"\n at DocumentsClient.listDocuments (file:///opt/sdk_modules/@dynatrace-sdk/client-document/esm/index.js:3809:19)\n at eventLoopTick (ext:core/01_core.js:175:7)\n at async default (file:///script.ts:11:16)"
      }
    }
  }
}

```

I tried the same using the Swagger API to list the documents and that is working as expected.

Is there some more permission to run the code in dashboards?

Kind Regards,

Kumaravel

---

_[View the full topic](https://community.dynatrace.com/t/documentsclient-not-working-with-admin-access/51727)._
