{"id":39134894,"url":"https://github.com/gleanwork/api-client-go","last_synced_at":"2026-03-11T20:03:28.255Z","repository":{"id":291196573,"uuid":"971642591","full_name":"gleanwork/api-client-go","owner":"gleanwork","description":"The official Go library for the Glean API","archived":false,"fork":false,"pushed_at":"2026-03-06T09:05:37.000Z","size":5768,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-06T12:36:09.195Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gleanwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":"governance.go","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-23T20:46:49.000Z","updated_at":"2026-03-04T17:15:17.000Z","dependencies_parsed_at":"2025-06-11T21:09:30.072Z","dependency_job_id":"2eb1b03e-4967-435c-844d-346e7d4b95d8","html_url":"https://github.com/gleanwork/api-client-go","commit_stats":null,"previous_names":["gleanwork/api-client-go"],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/gleanwork/api-client-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleanwork%2Fapi-client-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleanwork%2Fapi-client-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleanwork%2Fapi-client-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleanwork%2Fapi-client-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gleanwork","download_url":"https://codeload.github.com/gleanwork/api-client-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gleanwork%2Fapi-client-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30398192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T18:46:22.935Z","status":"ssl_error","status_checked_at":"2026-03-11T18:46:17.045Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T21:23:36.543Z","updated_at":"2026-03-11T20:03:28.247Z","avatar_url":"https://github.com/gleanwork.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# api-client-go\n\nThe Glean Go SDK provides convenient access to the Glean REST API for Go 1.18+. It offers strongly typed request and response structs, context-based request handling, and uses the standard net/http package.\n\u003c!-- No Summary [summary] --\u003e\n\n## Unified SDK Architecture\n\nThis SDK combines both the Client and Indexing API namespaces into a single unified package:\n\n- **Client API**: Used for search, retrieval, and end-user interactions with Glean content\n- **Indexing API**: Used for indexing content, permissions, and other administrative operations\n\nEach namespace has its own authentication requirements and access patterns. While they serve different purposes, having them in a single SDK provides a consistent developer experience across all Glean API interactions.\n\n```go\n// Example of accessing Client namespace\ns := apiclientgo.New(\n\tapiclientgo.WithSecurity(\"client-token\"),\n)\nres, err := s.Client.Search.Query(ctx, components.SearchRequest{\n\tQuery: \"search term\",\n})\n\n// Example of accessing Indexing namespace \ns := apiclientgo.New(\n\tapiclientgo.WithSecurity(\"indexing-token\"),\n)\nres, err := s.Indexing.Documents.Index(ctx, components.DocumentRequest{\n\t// document data\n})\n```\n\nRemember that each namespace requires its own authentication token type as described in the [Authentication Methods](#authentication-methods) section.\n\n\u003c!-- Start Table of Contents [toc] --\u003e\n## Table of Contents\n\u003c!-- $toc-max-depth=2 --\u003e\n* [api-client-go](#api-client-go)\n  * [Unified SDK Architecture](#unified-sdk-architecture)\n  * [SDK Installation](#sdk-installation)\n  * [SDK Example Usage](#sdk-example-usage)\n  * [Authentication](#authentication)\n  * [Available Resources and Operations](#available-resources-and-operations)\n  * [Retries](#retries)\n  * [Error Handling](#error-handling)\n  * [Server Selection](#server-selection)\n  * [Custom HTTP Client](#custom-http-client)\n  * [Special Types](#special-types)\n  * [Experimental Features and Deprecation Testing](#experimental-features-and-deprecation-testing)\n* [Development](#development)\n  * [Maturity](#maturity)\n  * [Contributions](#contributions)\n\n\u003c!-- End Table of Contents [toc] --\u003e\n\n\u003c!-- Start SDK Installation [installation] --\u003e\n## SDK Installation\n\nTo add the SDK as a dependency to your project:\n```bash\ngo get github.com/gleanwork/api-client-go\n```\n\u003c!-- End SDK Installation [installation] --\u003e\n\n\u003c!-- Start SDK Example Usage [usage] --\u003e\n## SDK Example Usage\n\n### Example 1\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\ts := apiclientgo.New(\n\t\tapiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n\t)\n\n\tres, err := s.Client.Chat.Create(ctx, components.ChatRequest{\n\t\tMessages: []components.ChatMessage{\n\t\t\tcomponents.ChatMessage{\n\t\t\t\tFragments: []components.ChatMessageFragment{\n\t\t\t\t\tcomponents.ChatMessageFragment{\n\t\t\t\t\t\tText: apiclientgo.Pointer(\"What are the company holidays this year?\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}, nil, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif res.ChatResponse != nil {\n\t\t// handle response\n\t}\n}\n\n```\n\n### Example 2\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\ts := apiclientgo.New(\n\t\tapiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n\t)\n\n\tres, err := s.Client.Chat.CreateStream(ctx, components.ChatRequest{\n\t\tMessages: []components.ChatMessage{\n\t\t\tcomponents.ChatMessage{\n\t\t\t\tFragments: []components.ChatMessageFragment{\n\t\t\t\t\tcomponents.ChatMessageFragment{\n\t\t\t\t\t\tText: apiclientgo.Pointer(\"What are the company holidays this year?\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif res.ChatRequestStream != nil {\n\t\t// handle response\n\t}\n}\n\n```\n\u003c!-- End SDK Example Usage [usage] --\u003e\n\n\u003c!-- Start Authentication [security] --\u003e\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security scheme globally:\n\n| Name       | Type | Scheme      | Environment Variable |\n| ---------- | ---- | ----------- | -------------------- |\n| `APIToken` | http | HTTP Bearer | `GLEAN_API_TOKEN`    |\n\nYou can configure it using the `WithSecurity` option when initializing the SDK client instance. For example:\n```go\npackage main\n\nimport (\n\t\"context\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n\t\"github.com/gleanwork/api-client-go/types\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\ts := apiclientgo.New(\n\t\tapiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n\t)\n\n\tres, err := s.Client.Activity.Report(ctx, components.Activity{\n\t\tEvents: []components.ActivityEvent{\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction:    components.ActivityEventActionHistoricalView,\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/\",\n\t\t\t},\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction: components.ActivityEventActionSearch,\n\t\t\t\tParams: \u0026components.ActivityEventParams{\n\t\t\t\t\tQuery: apiclientgo.Pointer(\"query\"),\n\t\t\t\t},\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/search?q=query\",\n\t\t\t},\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction: components.ActivityEventActionView,\n\t\t\t\tParams: \u0026components.ActivityEventParams{\n\t\t\t\t\tDuration: apiclientgo.Pointer[int64](20),\n\t\t\t\t\tReferrer: apiclientgo.Pointer(\"https://example.com/document\"),\n\t\t\t\t},\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/\",\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif res != nil {\n\t\t// handle response\n\t}\n}\n\n```\n\u003c!-- End Authentication [security] --\u003e\n\n### Authentication Methods\n\nGlean supports different authentication methods depending on which API namespace you're using:\n\n#### Client Namespace\n\nThe Client namespace supports two authentication methods:\n\n1. **Manually Provisioned API Tokens**\n   - Can be created by an Admin or a user with the API Token Creator role\n   - Used for server-to-server integrations\n\n2. **OAuth**\n   - Requires OAuth setup to be completed by an Admin\n   - Used for user-based authentication flows\n\n#### Indexing Namespace\n\nThe Indexing namespace supports only one authentication method:\n\n1. **Manually Provisioned API Tokens**\n   - Can be created by an Admin or a user with the API Token Creator role\n   - Used for secure document indexing operations\n\n\u003e [!IMPORTANT]\n\u003e Client tokens **will not work** for Indexing operations, and Indexing tokens **will not work** for Client operations. You must use the appropriate token type for the namespace you're accessing.\n\nFor more information on obtaining the appropriate token type, please contact your Glean administrator.\n\n\u003c!-- Start Available Resources and Operations [operations] --\u003e\n## Available Resources and Operations\n\n\u003cdetails open\u003e\n\u003csummary\u003eAvailable methods\u003c/summary\u003e\n\n### [Authentication](docs/sdks/authentication/README.md)\n\n* [Checkdatasourceauth](docs/sdks/authentication/README.md#checkdatasourceauth) - Check datasource authorization\n\n### [Client.Activity](docs/sdks/activity/README.md)\n\n* [Report](docs/sdks/activity/README.md#report) - Report document activity\n* [Feedback](docs/sdks/activity/README.md#feedback) - Report client activity\n\n### [Client.Agents](docs/sdks/agents/README.md)\n\n* [Retrieve](docs/sdks/agents/README.md#retrieve) - Retrieve an agent\n* [RetrieveSchemas](docs/sdks/agents/README.md#retrieveschemas) - List an agent's schemas\n* [List](docs/sdks/agents/README.md#list) - Search agents\n* [RunStream](docs/sdks/agents/README.md#runstream) - Create an agent run and stream the response\n* [Run](docs/sdks/agents/README.md#run) - Create an agent run and wait for the response\n\n### [Client.Announcements](docs/sdks/announcements/README.md)\n\n* [Create](docs/sdks/announcements/README.md#create) - Create Announcement\n* [Delete](docs/sdks/announcements/README.md#delete) - Delete Announcement\n* [Update](docs/sdks/announcements/README.md#update) - Update Announcement\n\n### [Client.Answers](docs/sdks/answers/README.md)\n\n* [Create](docs/sdks/answers/README.md#create) - Create Answer\n* [Delete](docs/sdks/answers/README.md#delete) - Delete Answer\n* [Update](docs/sdks/answers/README.md#update) - Update Answer\n* [Retrieve](docs/sdks/answers/README.md#retrieve) - Read Answer\n* [~~List~~](docs/sdks/answers/README.md#list) - List Answers :warning: **Deprecated**\n\n### [Client.Authentication](docs/sdks/clientauthentication/README.md)\n\n* [CreateToken](docs/sdks/clientauthentication/README.md#createtoken) - Create authentication token\n\n### [Client.Chat](docs/sdks/chat/README.md)\n\n* [Create](docs/sdks/chat/README.md#create) - Chat\n* [DeleteAll](docs/sdks/chat/README.md#deleteall) - Deletes all saved Chats owned by a user\n* [Delete](docs/sdks/chat/README.md#delete) - Deletes saved Chats\n* [Retrieve](docs/sdks/chat/README.md#retrieve) - Retrieves a Chat\n* [List](docs/sdks/chat/README.md#list) - Retrieves all saved Chats\n* [RetrieveApplication](docs/sdks/chat/README.md#retrieveapplication) - Gets the metadata for a custom Chat application\n* [UploadFiles](docs/sdks/chat/README.md#uploadfiles) - Upload files for Chat.\n* [RetrieveFiles](docs/sdks/chat/README.md#retrievefiles) - Get files uploaded by a user for Chat.\n* [DeleteFiles](docs/sdks/chat/README.md#deletefiles) - Delete files uploaded by a user for chat.\n* [CreateStream](docs/sdks/chat/README.md#createstream) - Chat\n\n### [Client.Collections](docs/sdks/collections/README.md)\n\n* [AddItems](docs/sdks/collections/README.md#additems) - Add Collection item\n* [Create](docs/sdks/collections/README.md#create) - Create Collection\n* [Delete](docs/sdks/collections/README.md#delete) - Delete Collection\n* [DeleteItem](docs/sdks/collections/README.md#deleteitem) - Delete Collection item\n* [Update](docs/sdks/collections/README.md#update) - Update Collection\n* [UpdateItem](docs/sdks/collections/README.md#updateitem) - Update Collection item\n* [Retrieve](docs/sdks/collections/README.md#retrieve) - Read Collection\n* [List](docs/sdks/collections/README.md#list) - List Collections\n\n### [Client.Documents](docs/sdks/clientdocuments/README.md)\n\n* [RetrievePermissions](docs/sdks/clientdocuments/README.md#retrievepermissions) - Read document permissions\n* [Retrieve](docs/sdks/clientdocuments/README.md#retrieve) - Read documents\n* [RetrieveByFacets](docs/sdks/clientdocuments/README.md#retrievebyfacets) - Read documents by facets\n* [Summarize](docs/sdks/clientdocuments/README.md#summarize) - Summarize documents\n\n### [Client.Entities](docs/sdks/entities/README.md)\n\n* [List](docs/sdks/entities/README.md#list) - List entities\n* [ReadPeople](docs/sdks/entities/README.md#readpeople) - Read people\n\n### [Client.Governance.Data.Policies](docs/sdks/policies/README.md)\n\n* [Retrieve](docs/sdks/policies/README.md#retrieve) - Gets specified policy\n* [Update](docs/sdks/policies/README.md#update) - Updates an existing policy\n* [List](docs/sdks/policies/README.md#list) - Lists policies\n* [Create](docs/sdks/policies/README.md#create) - Creates new policy\n* [Download](docs/sdks/policies/README.md#download) - Downloads violations CSV for policy\n\n### [Client.Governance.Data.Reports](docs/sdks/reports/README.md)\n\n* [Create](docs/sdks/reports/README.md#create) - Creates new one-time report\n* [Download](docs/sdks/reports/README.md#download) - Downloads violations CSV for report\n* [Status](docs/sdks/reports/README.md#status) - Fetches report run status\n\n### [Client.Governance.Documents.Visibilityoverrides](docs/sdks/visibilityoverrides/README.md)\n\n* [List](docs/sdks/visibilityoverrides/README.md#list) - Fetches documents visibility\n* [Create](docs/sdks/visibilityoverrides/README.md#create) - Hide or unhide docs\n\n### [Client.Insights](docs/sdks/insights/README.md)\n\n* [Retrieve](docs/sdks/insights/README.md#retrieve) - Get insights\n\n### [Client.Messages](docs/sdks/messages/README.md)\n\n* [Retrieve](docs/sdks/messages/README.md#retrieve) - Read messages\n\n### [Client.Pins](docs/sdks/pins/README.md)\n\n* [Update](docs/sdks/pins/README.md#update) - Update pin\n* [Retrieve](docs/sdks/pins/README.md#retrieve) - Read pin\n* [List](docs/sdks/pins/README.md#list) - List pins\n* [Create](docs/sdks/pins/README.md#create) - Create pin\n* [Remove](docs/sdks/pins/README.md#remove) - Delete pin\n\n### [Client.Search](docs/sdks/search/README.md)\n\n* [QueryAsAdmin](docs/sdks/search/README.md#queryasadmin) - Search the index (admin)\n* [Autocomplete](docs/sdks/search/README.md#autocomplete) - Autocomplete\n* [RetrieveFeed](docs/sdks/search/README.md#retrievefeed) - Feed of documents and events\n* [Recommendations](docs/sdks/search/README.md#recommendations) - Recommend documents\n* [Query](docs/sdks/search/README.md#query) - Search\n\n### [Client.Shortcuts](docs/sdks/clientshortcuts/README.md)\n\n* [Create](docs/sdks/clientshortcuts/README.md#create) - Create shortcut\n* [Delete](docs/sdks/clientshortcuts/README.md#delete) - Delete shortcut\n* [Retrieve](docs/sdks/clientshortcuts/README.md#retrieve) - Read shortcut\n* [List](docs/sdks/clientshortcuts/README.md#list) - List shortcuts\n* [Update](docs/sdks/clientshortcuts/README.md#update) - Update shortcut\n\n### [Client.Tools](docs/sdks/tools/README.md)\n\n* [List](docs/sdks/tools/README.md#list) - List available tools\n* [Run](docs/sdks/tools/README.md#run) - Execute the specified tool\n\n### [Client.Verification](docs/sdks/verification/README.md)\n\n* [AddReminder](docs/sdks/verification/README.md#addreminder) - Create verification\n* [List](docs/sdks/verification/README.md#list) - List verifications\n* [Verify](docs/sdks/verification/README.md#verify) - Update verification\n\n### [Datasources](docs/sdks/datasources/README.md)\n\n* [GetDatasourceInstanceConfiguration](docs/sdks/datasources/README.md#getdatasourceinstanceconfiguration) - Get datasource instance configuration\n* [UpdateDatasourceInstanceConfiguration](docs/sdks/datasources/README.md#updatedatasourceinstanceconfiguration) - Update datasource instance configuration\n\n### [Governance](docs/sdks/governance/README.md)\n\n* [Createfindingsexport](docs/sdks/governance/README.md#createfindingsexport) - Creates findings export\n* [Listfindingsexports](docs/sdks/governance/README.md#listfindingsexports) - Lists findings exports\n* [Downloadfindingsexport](docs/sdks/governance/README.md#downloadfindingsexport) - Downloads findings export\n* [Deletefindingsexport](docs/sdks/governance/README.md#deletefindingsexport) - Deletes findings export\n\n### [Indexing.Authentication](docs/sdks/indexingauthentication/README.md)\n\n* [RotateToken](docs/sdks/indexingauthentication/README.md#rotatetoken) - Rotate token\n\n### [Indexing.Datasource](docs/sdks/datasource/README.md)\n\n* [Status](docs/sdks/datasource/README.md#status) - Beta: Get datasource status\n\n\n### [Indexing.Datasources](docs/sdks/indexingdatasources/README.md)\n\n* [Add](docs/sdks/indexingdatasources/README.md#add) - Add or update datasource\n* [RetrieveConfig](docs/sdks/indexingdatasources/README.md#retrieveconfig) - Get datasource config\n\n### [Indexing.Documents](docs/sdks/indexingdocuments/README.md)\n\n* [AddOrUpdate](docs/sdks/indexingdocuments/README.md#addorupdate) - Index document\n* [Index](docs/sdks/indexingdocuments/README.md#index) - Index documents\n* [BulkIndex](docs/sdks/indexingdocuments/README.md#bulkindex) - Bulk index documents\n* [ProcessAll](docs/sdks/indexingdocuments/README.md#processall) - Schedules the processing of uploaded documents\n* [Delete](docs/sdks/indexingdocuments/README.md#delete) - Delete document\n* [Debug](docs/sdks/indexingdocuments/README.md#debug) - Beta: Get document information\n\n* [DebugMany](docs/sdks/indexingdocuments/README.md#debugmany) - Beta: Get information of a batch of documents\n\n* [CheckAccess](docs/sdks/indexingdocuments/README.md#checkaccess) - Check document access\n* [~~Status~~](docs/sdks/indexingdocuments/README.md#status) - Get document upload and indexing status :warning: **Deprecated**\n* [~~Count~~](docs/sdks/indexingdocuments/README.md#count) - Get document count :warning: **Deprecated**\n\n### [Indexing.People](docs/sdks/people/README.md)\n\n* [Debug](docs/sdks/people/README.md#debug) - Beta: Get user information\n\n* [~~Count~~](docs/sdks/people/README.md#count) - Get user count :warning: **Deprecated**\n* [Index](docs/sdks/people/README.md#index) - Index employee\n* [~~BulkIndex~~](docs/sdks/people/README.md#bulkindex) - Bulk index employees :warning: **Deprecated**\n* [ProcessAllEmployeesAndTeams](docs/sdks/people/README.md#processallemployeesandteams) - Schedules the processing of uploaded employees and teams\n* [Delete](docs/sdks/people/README.md#delete) - Delete employee\n* [IndexTeam](docs/sdks/people/README.md#indexteam) - Index team\n* [DeleteTeam](docs/sdks/people/README.md#deleteteam) - Delete team\n* [BulkIndexTeams](docs/sdks/people/README.md#bulkindexteams) - Bulk index teams\n\n### [Indexing.Permissions](docs/sdks/permissions/README.md)\n\n* [UpdatePermissions](docs/sdks/permissions/README.md#updatepermissions) - Update document permissions\n* [IndexUser](docs/sdks/permissions/README.md#indexuser) - Index user\n* [BulkIndexUsers](docs/sdks/permissions/README.md#bulkindexusers) - Bulk index users\n* [IndexGroup](docs/sdks/permissions/README.md#indexgroup) - Index group\n* [BulkIndexGroups](docs/sdks/permissions/README.md#bulkindexgroups) - Bulk index groups\n* [IndexMembership](docs/sdks/permissions/README.md#indexmembership) - Index membership\n* [BulkIndexMemberships](docs/sdks/permissions/README.md#bulkindexmemberships) - Bulk index memberships for a group\n* [ProcessMemberships](docs/sdks/permissions/README.md#processmemberships) - Schedules the processing of group memberships\n* [DeleteUser](docs/sdks/permissions/README.md#deleteuser) - Delete user\n* [DeleteGroup](docs/sdks/permissions/README.md#deletegroup) - Delete group\n* [DeleteMembership](docs/sdks/permissions/README.md#deletemembership) - Delete membership\n* [AuthorizeBetaUsers](docs/sdks/permissions/README.md#authorizebetausers) - Beta users\n\n### [Indexing.Shortcuts](docs/sdks/indexingshortcuts/README.md)\n\n* [BulkIndex](docs/sdks/indexingshortcuts/README.md#bulkindex) - Bulk index external shortcuts\n* [Upload](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts\n\n\u003c/details\u003e\n\u003c!-- End Available Resources and Operations [operations] --\u003e\n\n\u003c!-- Start Retries [retries] --\u003e\n## Retries\n\nSome of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.\n\nTo change the default retry strategy for a single API call, simply provide a `retry.Config` object to the call by using the `WithRetries` option:\n```go\npackage main\n\nimport (\n\t\"context\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n\t\"github.com/gleanwork/api-client-go/retry\"\n\t\"github.com/gleanwork/api-client-go/types\"\n\t\"log\"\n\t\"models/operations\"\n\t\"os\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\ts := apiclientgo.New(\n\t\tapiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n\t)\n\n\tres, err := s.Client.Activity.Report(ctx, components.Activity{\n\t\tEvents: []components.ActivityEvent{\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction:    components.ActivityEventActionHistoricalView,\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/\",\n\t\t\t},\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction: components.ActivityEventActionSearch,\n\t\t\t\tParams: \u0026components.ActivityEventParams{\n\t\t\t\t\tQuery: apiclientgo.Pointer(\"query\"),\n\t\t\t\t},\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/search?q=query\",\n\t\t\t},\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction: components.ActivityEventActionView,\n\t\t\t\tParams: \u0026components.ActivityEventParams{\n\t\t\t\t\tDuration: apiclientgo.Pointer[int64](20),\n\t\t\t\t\tReferrer: apiclientgo.Pointer(\"https://example.com/document\"),\n\t\t\t\t},\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/\",\n\t\t\t},\n\t\t},\n\t}, operations.WithRetries(\n\t\tretry.Config{\n\t\t\tStrategy: \"backoff\",\n\t\t\tBackoff: \u0026retry.BackoffStrategy{\n\t\t\t\tInitialInterval: 1,\n\t\t\t\tMaxInterval:     50,\n\t\t\t\tExponent:        1.1,\n\t\t\t\tMaxElapsedTime:  100,\n\t\t\t},\n\t\t\tRetryConnectionErrors: false,\n\t\t}))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif res != nil {\n\t\t// handle response\n\t}\n}\n\n```\n\nIf you'd like to override the default retry strategy for all operations that support retries, you can use the `WithRetryConfig` option at SDK initialization:\n```go\npackage main\n\nimport (\n\t\"context\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n\t\"github.com/gleanwork/api-client-go/retry\"\n\t\"github.com/gleanwork/api-client-go/types\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\ts := apiclientgo.New(\n\t\tapiclientgo.WithRetryConfig(\n\t\t\tretry.Config{\n\t\t\t\tStrategy: \"backoff\",\n\t\t\t\tBackoff: \u0026retry.BackoffStrategy{\n\t\t\t\t\tInitialInterval: 1,\n\t\t\t\t\tMaxInterval:     50,\n\t\t\t\t\tExponent:        1.1,\n\t\t\t\t\tMaxElapsedTime:  100,\n\t\t\t\t},\n\t\t\t\tRetryConnectionErrors: false,\n\t\t\t}),\n\t\tapiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n\t)\n\n\tres, err := s.Client.Activity.Report(ctx, components.Activity{\n\t\tEvents: []components.ActivityEvent{\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction:    components.ActivityEventActionHistoricalView,\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/\",\n\t\t\t},\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction: components.ActivityEventActionSearch,\n\t\t\t\tParams: \u0026components.ActivityEventParams{\n\t\t\t\t\tQuery: apiclientgo.Pointer(\"query\"),\n\t\t\t\t},\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/search?q=query\",\n\t\t\t},\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction: components.ActivityEventActionView,\n\t\t\t\tParams: \u0026components.ActivityEventParams{\n\t\t\t\t\tDuration: apiclientgo.Pointer[int64](20),\n\t\t\t\t\tReferrer: apiclientgo.Pointer(\"https://example.com/document\"),\n\t\t\t\t},\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/\",\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif res != nil {\n\t\t// handle response\n\t}\n}\n\n```\n\u003c!-- End Retries [retries] --\u003e\n\n\u003c!-- Start Error Handling [errors] --\u003e\n## Error Handling\n\nHandling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both.\n\nBy Default, an API error will return `apierrors.APIError`. When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation.\n\nFor example, the `Retrieve` function may return the following errors:\n\n| Error Type              | Status Code | Content Type     |\n| ----------------------- | ----------- | ---------------- |\n| apierrors.ErrorResponse | 404         | application/json |\n| apierrors.APIError      | 4XX, 5XX    | \\*/\\*            |\n\n### Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/apierrors\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\ts := apiclientgo.New(\n\t\tapiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n\t)\n\n\tres, err := s.Client.Agents.Retrieve(ctx, \"\u003cid\u003e\", nil, nil)\n\tif err != nil {\n\n\t\tvar e *apierrors.ErrorResponse\n\t\tif errors.As(err, \u0026e) {\n\t\t\t// handle error\n\t\t\tlog.Fatal(e.Error())\n\t\t}\n\n\t\tvar e *apierrors.APIError\n\t\tif errors.As(err, \u0026e) {\n\t\t\t// handle error\n\t\t\tlog.Fatal(e.Error())\n\t\t}\n\t}\n}\n\n```\n\u003c!-- End Error Handling [errors] --\u003e\n\n\u003c!-- Start Server Selection [server] --\u003e\n## Server Selection\n\n### Server Variables\n\nThe default server `https://{instance}-be.glean.com` contains variables and is set to `https://instance-name-be.glean.com` by default. To override default values, the following options are available when initializing the SDK client instance:\n\n| Variable   | Option                          | Default           | Description                                                                                            |\n| ---------- | ------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------ |\n| `instance` | `WithInstance(instance string)` | `\"instance-name\"` | The instance name (typically the email domain without the TLD) that determines the deployment backend. |\n\n#### Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n\t\"github.com/gleanwork/api-client-go/types\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\ts := apiclientgo.New(\n\t\tapiclientgo.WithServerIndex(0),\n\t\tapiclientgo.WithInstance(\"instance-name\"),\n\t\tapiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n\t)\n\n\tres, err := s.Client.Activity.Report(ctx, components.Activity{\n\t\tEvents: []components.ActivityEvent{\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction:    components.ActivityEventActionHistoricalView,\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/\",\n\t\t\t},\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction: components.ActivityEventActionSearch,\n\t\t\t\tParams: \u0026components.ActivityEventParams{\n\t\t\t\t\tQuery: apiclientgo.Pointer(\"query\"),\n\t\t\t\t},\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/search?q=query\",\n\t\t\t},\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction: components.ActivityEventActionView,\n\t\t\t\tParams: \u0026components.ActivityEventParams{\n\t\t\t\t\tDuration: apiclientgo.Pointer[int64](20),\n\t\t\t\t\tReferrer: apiclientgo.Pointer(\"https://example.com/document\"),\n\t\t\t\t},\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/\",\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif res != nil {\n\t\t// handle response\n\t}\n}\n\n```\n\n### Override Server URL Per-Client\n\nThe default server can be overridden globally using the `WithServerURL(serverURL string)` option when initializing the SDK client instance. For example:\n```go\npackage main\n\nimport (\n\t\"context\"\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n\t\"github.com/gleanwork/api-client-go/types\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\ts := apiclientgo.New(\n\t\tapiclientgo.WithServerURL(\"https://instance-name-be.glean.com\"),\n\t\tapiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n\t)\n\n\tres, err := s.Client.Activity.Report(ctx, components.Activity{\n\t\tEvents: []components.ActivityEvent{\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction:    components.ActivityEventActionHistoricalView,\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/\",\n\t\t\t},\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction: components.ActivityEventActionSearch,\n\t\t\t\tParams: \u0026components.ActivityEventParams{\n\t\t\t\t\tQuery: apiclientgo.Pointer(\"query\"),\n\t\t\t\t},\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/search?q=query\",\n\t\t\t},\n\t\t\tcomponents.ActivityEvent{\n\t\t\t\tAction: components.ActivityEventActionView,\n\t\t\t\tParams: \u0026components.ActivityEventParams{\n\t\t\t\t\tDuration: apiclientgo.Pointer[int64](20),\n\t\t\t\t\tReferrer: apiclientgo.Pointer(\"https://example.com/document\"),\n\t\t\t\t},\n\t\t\t\tTimestamp: types.MustTimeFromString(\"2000-01-23T04:56:07.000Z\"),\n\t\t\t\tURL:       \"https://example.com/\",\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif res != nil {\n\t\t// handle response\n\t}\n}\n\n```\n\u003c!-- End Server Selection [server] --\u003e\n\n\u003c!-- Start Custom HTTP Client [http-client] --\u003e\n## Custom HTTP Client\n\nThe Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface:\n\n```go\ntype HTTPClient interface {\n\tDo(req *http.Request) (*http.Response, error)\n}\n```\n\nThe built-in `net/http` client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout.\n\n```go\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/gleanwork/api-client-go\"\n)\n\nvar (\n\thttpClient = \u0026http.Client{Timeout: 30 * time.Second}\n\tsdkClient  = apiclientgo.New(apiclientgo.WithClient(httpClient))\n)\n```\n\nThis can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration.\n\u003c!-- End Custom HTTP Client [http-client] --\u003e\n\n\u003c!-- Start Special Types [types] --\u003e\n## Special Types\n\nThis SDK defines the following custom types to assist with marshalling and unmarshalling data.\n\n### Date\n\n`types.Date` is a wrapper around time.Time that allows for JSON marshaling a date string formatted as \"2006-01-02\".\n\n#### Usage\n\n```go\nd1 := types.NewDate(time.Now()) // returns *types.Date\n\nd2 := types.DateFromTime(time.Now()) // returns types.Date\n\nd3, err := types.NewDateFromString(\"2019-01-01\") // returns *types.Date, error\n\nd4, err := types.DateFromString(\"2019-01-01\") // returns types.Date, error\n\nd5 := types.MustNewDateFromString(\"2019-01-01\") // returns *types.Date and panics on error\n\nd6 := types.MustDateFromString(\"2019-01-01\") // returns types.Date and panics on error\n```\n\u003c!-- End Special Types [types] --\u003e\n\n## Experimental Features and Deprecation Testing\n\nThe SDK provides options to test upcoming API changes before they become the default behavior. This is useful for:\n\n- **Testing experimental features** before they are generally available\n- **Preparing for deprecations** by excluding deprecated endpoints ahead of their removal\n\n### Configuration Options\n\nYou can configure these options either via environment variables or SDK constructor options:\n\n#### Using Environment Variables\n\n```bash\nexport X_GLEAN_EXCLUDE_DEPRECATED_AFTER=\"2026-10-15\"\nexport X_GLEAN_INCLUDE_EXPERIMENTAL=\"true\"\n```\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\ts := apiclientgo.New(\n\t\tapiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n\t\tapiclientgo.WithServerURL(\"https://mycompany-be.glean.com\"),\n\t)\n\n\tres, err := s.Client.Search.Query(ctx, components.SearchRequest{\n\t\tQuery: \"test\",\n\t}, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// Headers are automatically set based on environment variables\n\tlog.Println(res)\n}\n```\n\n#### Using SDK Constructor Options\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tapiclientgo \"github.com/gleanwork/api-client-go\"\n\t\"github.com/gleanwork/api-client-go/models/components\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\ts := apiclientgo.New(\n\t\tapiclientgo.WithSecurity(os.Getenv(\"GLEAN_API_TOKEN\")),\n\t\tapiclientgo.WithServerURL(\"https://mycompany-be.glean.com\"),\n\t\tapiclientgo.WithExcludeDeprecatedAfter(\"2026-10-15\"),\n\t\tapiclientgo.WithIncludeExperimental(true),\n\t)\n\n\tres, err := s.Client.Search.Query(ctx, components.SearchRequest{\n\t\tQuery: \"test\",\n\t}, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(res)\n}\n```\n\n### Option Reference\n\n| Option | Environment Variable | Type | Description |\n| ------ | -------------------- | ---- | ----------- |\n| `WithExcludeDeprecatedAfter` | `X_GLEAN_EXCLUDE_DEPRECATED_AFTER` | `string` (date) | Exclude API endpoints that will be deprecated after this date (format: `YYYY-MM-DD`). Use this to test your integration against upcoming deprecations. |\n| `WithIncludeExperimental` | `X_GLEAN_INCLUDE_EXPERIMENTAL` | `bool` | When `true`, enables experimental API features that are not yet generally available. Use this to preview and test new functionality. |\n\n\u003e **Note:** Environment variables take precedence over SDK constructor options when both are set.\n\n\u003e **Warning:** Experimental features may change or be removed without notice. Do not rely on experimental features in production environments.\n\n\u003c!-- Placeholder for Future Speakeasy SDK Sections --\u003e\n\n# Development\n\n## Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n## Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. \nWe look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. \n\n### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=github-com/gleanwork/api-client-go\u0026utm_campaign=go)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgleanwork%2Fapi-client-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgleanwork%2Fapi-client-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgleanwork%2Fapi-client-go/lists"}