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 Glean backend URL, such as
https://your-instance-be.glean.com. - Configure OAuth or a user-scoped Glean-issued token with the Client API authentication guide.
- Have a query that should return content the authenticated user can access.
Make your first request
Replace <your_token> and the example backend URL, then run:
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.