⚠️ This documentation pertains to a preview endpoint. This feature is not yet ready for API consumption and may change.
For inquiries or feedback, please contact us at Glean.

Read documents by facets

post/getdocumentsbyfacets

Read the documents including metadata (does not include enhanced metadata via /documentmetadata) macthing the given facet conditions.

SecurityBearerAuth
Request
header Parameters
X-Glean-Auth-Type
string

Auth type being used to access the endpoint (should be non-empty only for global tokens).

X-Scio-Actas
string <email>

Email address of a user on whose behalf the request is intended to be made (should be non-empty only for global tokens).

Request Body schema: application/json

Information about facet conditions for documents to be retrieved.

required
Array of objects (FacetFilterSet)

A list of facet filter sets that will be OR'ed together. An AND is assumed between different filters in each set.

cursor
string

Pagination cursor. A previously received opaque token representing the position in the overall results at which to start.

datasourcesFilter
Array of strings

Filter results to one or more datasources (e.g. gmail, slack). All results are returned if missing.

Responses
200

OK

Response Schema: application/json
cursor
string

Cursor that indicates the start of the next page of results. To be passed in "more" requests for this query.

Array of objects (Document)

The document details, ordered by score.

hasMoreResults
boolean

Whether more results are available. Use cursor to retrieve them.

400

Invalid request

401

Not Authorized

404

Not Found

429

Too Many Requests

Request samples
application/json
{
  • "datasourcesFilter": [
    • "string"
    ],
  • "filterSets": [
    • {
      • "filters": [
        • {
          • "fieldName": "type",
          • "values": [
            • {
              • "value": "Spreadsheet",
              • "relationType": "EQUALS"
              },
            • {
              • "value": "Presentation",
              • "relationType": "EQUALS"
              }
            ]
          }
        ]
      }
    ],
  • "cursor": "string"
}
Response samples
application/json
{
  • "documents": [
    • {
      • "id": "string",
      • "datasource": "string",
      • "connectorType": "API_CRAWL",
      • "docType": "string",
      • "content": {
        • "fullTextList": [
          • "string"
          ]
        },
      • "containerDocument": { },
      • "parentDocument": { },
      • "title": "string",
      • "url": "string",
      • "metadata": {
        • "container": "container",
        • "parentId": "JIRA_EN-1337",
        • "createTime": "2000-01-23T04:56:07.000Z",
        • "datasource": "datasource",
        • "author": {
          • "name": "name"
          },
        • "documentId": "documentId",
        • "updateTime": "2000-01-23T04:56:07.000Z",
        • "mimeType": "mimeType",
        • "objectType": "Feature Request",
        • "components": [
          • "Backend",
          • "Networking"
          ],
        • "status": [
          • "Done"
          ],
        • "customData": {
          • "someCustomField": "someCustomValue"
          }
        },
      • "sections": [
        • {
          • "title": "string",
          • "url": "string"
          }
        ]
      }
    ],
  • "hasMoreResults": true,
  • "cursor": "string"
}