curl --request POST \
  --url https://{domain}-be.glean.com/rest/api/v1/getdocumentsbyfacets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "datasourcesFilter": [
    "<string>"
  ],
  "filterSets": [
    {
      "filters": [
        {
          "fieldName": "type",
          "values": [
            {
              "value": "Spreadsheet",
              "relationType": "EQUALS"
            },
            {
              "value": "Presentation",
              "relationType": "EQUALS"
            }
          ]
        }
      ]
    }
  ],
  "cursor": "<string>"
}'
{
  "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>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Scio-Actas
string

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

X-Glean-Auth-Type
string

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

Body

application/json
Information about facet conditions for documents to be retrieved.
filterSets
object[]
required

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

Within a single FacetFilterSet, the filters are treated as AND. For example, owner Sumeet and type Spreadsheet shows documents that are by Sumeet AND are Spreadsheets.

datasourcesFilter
string[]

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

cursor
string

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

Response

200
application/json
OK
documents
object[]

The document details, ordered by score.

hasMoreResults
boolean

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

cursor
string

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