curl --request POST \
  --url https://{domain}-be.glean.com/rest/api/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "idType": "CHANNEL_NAME",
  "id": "<string>",
  "workspaceId": "<string>",
  "direction": "OLDER",
  "timestampMillis": 123,
  "includeRootMessage": true,
  "datasource": "SLACK",
  "datasourceInstanceDisplayName": "<string>"
}'
{
  "hasMore": true,
  "searchResponse": {
    "trackingToken": "trackingToken",
    "suggestedSpellCorrectedQuery": "suggestedSpellCorrectedQuery",
    "hasMoreResults": true,
    "errorInfo": {
      "errorMessages": [
        {
          "source": "gmail",
          "errorMessage": "invalid token"
        },
        {
          "source": "slack",
          "errorMessage": "expired token"
        }
      ]
    },
    "requestID": "5e345ae500ff0befa2b9d1a3ba0001737e7363696f312d323535323137000171756572792d656e64706f696e743a323032303031333074313830343032000100",
    "results": [
      {
        "snippets": [
          {
            "snippet": "snippet",
            "mimeType": "mimeType"
          }
        ],
        "metadata": {
          "container": "container",
          "createTime": "2000-01-23T04:56:07.000Z",
          "datasource": "datasource",
          "author": {
            "name": "name"
          },
          "documentId": "documentId",
          "updateTime": "2000-01-23T04:56:07.000Z",
          "mimeType": "mimeType",
          "objectType": "objectType"
        },
        "title": "title",
        "url": "https://www.example.com/"
      },
      {
        "snippets": [
          {
            "snippet": "snippet",
            "mimeType": "mimeType"
          }
        ],
        "metadata": {
          "container": "container",
          "createTime": "2000-01-23T04:56:07.000Z",
          "datasource": "datasource",
          "author": {
            "name": "name"
          },
          "documentId": "documentId",
          "updateTime": "2000-01-23T04:56:07.000Z",
          "mimeType": "mimeType",
          "objectType": "objectType"
        },
        "title": "title",
        "url": "https://www.example.com/"
      }
    ],
    "facetResults": [
      {
        "buckets": [
          {
            "percentage": 5,
            "count": 1,
            "value": {
              "stringValue": "stringValue",
              "integerValue": 5
            }
          },
          {
            "percentage": 5,
            "count": 1,
            "value": {
              "stringValue": "stringValue",
              "integerValue": 5
            }
          }
        ],
        "sourceName": "sourceName",
        "operatorName": "operatorName",
        "objectType": "objectType"
      },
      {
        "buckets": [
          {
            "percentage": 5,
            "count": 1,
            "value": {
              "stringValue": "stringValue",
              "integerValue": 5
            }
          },
          {
            "percentage": 5,
            "count": 1,
            "value": {
              "stringValue": "stringValue",
              "integerValue": 5
            }
          }
        ],
        "sourceName": "sourceName",
        "operatorName": "operatorName",
        "objectType": "objectType"
      }
    ],
    "rewrittenQuery": "rewrittenQuery",
    "rewrittenFacetFilters": [
      {
        "fieldName": "fieldName",
        "values": [
          "fieldValues",
          "fieldValues"
        ]
      },
      {
        "fieldName": "fieldName",
        "values": [
          "fieldValues",
          "fieldValues"
        ]
      }
    ]
  },
  "rootMessage": {
    "snippets": [
      {
        "snippet": "snippet",
        "mimeType": "mimeType"
      }
    ],
    "metadata": {
      "container": "container",
      "createTime": "2000-01-23T04:56:07.000Z",
      "datasource": "datasource",
      "author": {
        "name": "name"
      },
      "documentId": "documentId",
      "updateTime": "2000-01-23T04:56:07.000Z",
      "mimeType": "mimeType",
      "objectType": "objectType"
    },
    "title": "title",
    "url": "https://example.com/foo/bar",
    "nativeAppUrl": "slack://foo/bar",
    "mustIncludeSuggestions": [
      {
        "missingTerm": "container",
        "query": "container"
      }
    ]
  }
}

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
Includes request params such as the id for channel/message and direction.
idType
enum<string>
required

Type of the id in the incoming request.

Available options:
CHANNEL_NAME,
THREAD_ID,
CONVERSATION_ID
id
string
required

ID corresponding to the requested idType. Note that channel and threads are represented by the underlying datasource's ID and conversations are represented by their document's ID.

workspaceId
string

Id for the for the workspace in case of multiple workspaces.

direction
enum<string>

The direction of the results asked with respect to the reference timestamp. Missing field defaults to OLDER. Only applicable when using a message_id.

Available options:
OLDER,
NEWER
timestampMillis
integer

Timestamp in millis of the reference message. Only applicable when using a message_id.

includeRootMessage
boolean

Whether to include root message in response.

datasource
enum<string>

The type of the data source. Missing field defaults to SLACK.

Available options:
SLACK,
MICROSOFTTEAMS,
FACEBOOKWORKPLACE
datasourceInstanceDisplayName
string

The datasource instance display name from which the document was extracted. This is used for appinstance facet filter for datasources that support multiple instances.

Response

200
application/json
OK
hasMore
boolean
required

Whether there are more results for client to continue requesting.

searchResponse
object
Example:
{
  "trackingToken": "trackingToken",
  "suggestedSpellCorrectedQuery": "suggestedSpellCorrectedQuery",
  "hasMoreResults": true,
  "errorInfo": {
    "errorMessages": [
      {
        "source": "gmail",
        "errorMessage": "invalid token"
      },
      {
        "source": "slack",
        "errorMessage": "expired token"
      }
    ]
  },
  "requestID": "5e345ae500ff0befa2b9d1a3ba0001737e7363696f312d323535323137000171756572792d656e64706f696e743a323032303031333074313830343032000100",
  "results": [
    {
      "snippets": [
        {
          "snippet": "snippet",
          "mimeType": "mimeType"
        }
      ],
      "metadata": {
        "container": "container",
        "createTime": "2000-01-23T04:56:07.000Z",
        "datasource": "datasource",
        "author": { "name": "name" },
        "documentId": "documentId",
        "updateTime": "2000-01-23T04:56:07.000Z",
        "mimeType": "mimeType",
        "objectType": "objectType"
      },
      "title": "title",
      "url": "https://www.example.com/"
    },
    {
      "snippets": [
        {
          "snippet": "snippet",
          "mimeType": "mimeType"
        }
      ],
      "metadata": {
        "container": "container",
        "createTime": "2000-01-23T04:56:07.000Z",
        "datasource": "datasource",
        "author": { "name": "name" },
        "documentId": "documentId",
        "updateTime": "2000-01-23T04:56:07.000Z",
        "mimeType": "mimeType",
        "objectType": "objectType"
      },
      "title": "title",
      "url": "https://www.example.com/"
    }
  ],
  "facetResults": [
    {
      "buckets": [
        {
          "percentage": 5,
          "count": 1,
          "value": {
            "stringValue": "stringValue",
            "integerValue": 5
          }
        },
        {
          "percentage": 5,
          "count": 1,
          "value": {
            "stringValue": "stringValue",
            "integerValue": 5
          }
        }
      ],
      "sourceName": "sourceName",
      "operatorName": "operatorName",
      "objectType": "objectType"
    },
    {
      "buckets": [
        {
          "percentage": 5,
          "count": 1,
          "value": {
            "stringValue": "stringValue",
            "integerValue": 5
          }
        },
        {
          "percentage": 5,
          "count": 1,
          "value": {
            "stringValue": "stringValue",
            "integerValue": 5
          }
        }
      ],
      "sourceName": "sourceName",
      "operatorName": "operatorName",
      "objectType": "objectType"
    }
  ],
  "rewrittenQuery": "rewrittenQuery",
  "rewrittenFacetFilters": [
    {
      "fieldName": "fieldName",
      "values": ["fieldValues", "fieldValues"]
    },
    {
      "fieldName": "fieldName",
      "values": ["fieldValues", "fieldValues"]
    }
  ]
}
rootMessage
object
Example:
{
  "snippets": [
    {
      "snippet": "snippet",
      "mimeType": "mimeType"
    }
  ],
  "metadata": {
    "container": "container",
    "createTime": "2000-01-23T04:56:07.000Z",
    "datasource": "datasource",
    "author": { "name": "name" },
    "documentId": "documentId",
    "updateTime": "2000-01-23T04:56:07.000Z",
    "mimeType": "mimeType",
    "objectType": "objectType"
  },
  "title": "title",
  "url": "https://example.com/foo/bar",
  "nativeAppUrl": "slack://foo/bar",
  "mustIncludeSuggestions": [
    {
      "missingTerm": "container",
      "query": "container"
    }
  ]
}