---
title: "Check document access"
method: POST
path: "/api/index/v1/checkdocumentaccess"
tags: ["Troubleshooting"]
---

# Check document access

`POST /api/index/v1/checkdocumentaccess`

Check if a given user has access to access a document in a custom datasource

Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/indexing/debugging/datasource-config) for more information.

## Request body

- CheckDocumentAccessRequest — Describes the request body of the /checkdocumentaccess API call
  - `datasource` string, required — Datasource of document to check access for.
  - `objectType` string, required — Object type of document to check access for.
  - `docId` string, required — Glean Document ID to check access for.
  - `userEmail` string, required — Email of user to check access for.

## Response `200`

OK

- CheckDocumentAccessResponse — Describes the response body of the /checkdocumentaccess API call
  - `hasAccess` boolean — If true, user has access to document for search

## Other responses

- `400` — Bad Request
- `401` — Not Authorized
- `429` — Too Many Requests

---

[API](https://skmtc.dev/gleanwork/apis/glean-api-2.md) · [All operations](https://skmtc.dev/gleanwork/apis/glean-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gleanwork/glean-api-2/revisions/8516a7bdcc02/schema)
