Skip to main content

Documents API

The Platform Documents API retrieves indexed documents that the caller has permission to see, by URL or by Glean document ID.

Use Cases

Get by URL

Retrieve one document by the URL that Platform search returns. The response URL is the permalink, which may differ from the URL you sent.

Get by ID

Retrieve one document by its Glean document ID.

Batch Retrieval

Retrieve up to 100 documents in one request, by URL or document ID. Documents that are not found come back as warnings, matched to the request by index.

Gmail and Outlook search results and chat citations can carry IDs that only work for the caller. Get document by ID cannot resolve those IDs, so retrieve these documents by URL. A Gmail or Outlook URL can still return not found. Federated results and go-link shortcut documents cannot be retrieved yet.

Requests need the documents:read scope.

These endpoints are experimental. Send X-Glean-Include-Experimental: true on each request, or they are not exposed.

For error responses, see Platform API Errors for the shared ProblemDetail code reference and remediation guidance.