Client API Quickstart
Make a permission-aware search request with the Client API. This is the shortest path from a credential to a successful response; use the Client API overview to choose other capabilities.
Before you begin
Find your API URL
If automatic discovery is unavailable, ask a Glean admin for the complete Server instance (QE) value. Glean admins can copy it from the About Glean page.
Configure authentication
Configure OAuth or a user-scoped Glean-issued token with the Client API authentication guide.
Choose a test query
Use a query that should return content the authenticated user can access.
Make your first request
Replace <your_token> and any placeholder API URL, then run the request:
curl -X POST https://your-instance-be.glean.com/rest/api/v1/search \
-H 'Authorization: Bearer <your_token>' \
-H 'Content-Type: application/json' \
-d '{
"query": "quarterly planning",
"pageSize": 10,
"requestOptions": {
"datasourcesFilter": ["confluence", "gdrive"],
"facetBucketSize": 100
}
}'
A successful response contains a results array with documents the authenticated user is allowed to see. An empty results array is still a successful request; try a broader query or confirm that the user can access matching content.
See the Search API reference for request parameters and the complete response model.