Overview

The Glean Chat API provides a programmatic interface to interact with the Glean chat system. It allows developers to send and receive messages and handle conversation streams.

The Glean Chat API utilizes a streaming POST endpoint at https://<your-domain>-be.glean.com/rest/api/v1/chat for continuous, real-time conversational interactions. Remember to replace <your-domain-be> with your specific domain.

Setup

First, a Glean admin at https://app.glean.com/admin/setup/gleanassistant must set a key with access to GPT-4 as well as who has access to the Glean Assistant.

Authentication

Glean’s Chat API uses the standard HTTP Authorization header to transmit the bearer token, similar to Glean’s Client REST API authentication methods.

CHAT scoped bearer tokens are required to interact with Glean’s Chat API and can be generated from the admin console. More details about token permissions, scopes and generation can be found here.

Please note that all samples in the document assume the usage of a user-permissioned token. For a global-permissioned token, you would need to add an additional ‘X-Scio-Actas’ HTTP header to make the request on behalf of another user in your company. You can learn about making your first request here.

Personalisation & Privacy

Glean Search and Glean Chat ensure personalized search results based on your document access permissions. Be aware, if a user-permissioned token is used, the results might reflect your private information. Similarly, with a global token, the response may include private data of the user specified in the X-Scio-Actas HTTP header. This feature is designed to enhance data relevance, but it’s important to be mindful of the privacy implications. Handle your tokens with care to maintain your personal information’s confidentiality.