apiclientgo

package module
v0.17.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 14 Imported by: 1

README

api-client-go

The 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.

Unified SDK Architecture

This SDK combines both the Client and Indexing API namespaces into a single unified package:

  • Client API: Used for search, retrieval, and end-user interactions with Glean content
  • Indexing API: Used for indexing content, permissions, and other administrative operations

Each 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.

// Example of accessing Client namespace
s := apiclientgo.New(
	apiclientgo.WithSecurity("client-token"),
)
res, err := s.Client.Search.Query(ctx, components.SearchRequest{
	Query: "search term",
})

// Example of accessing Indexing namespace 
s := apiclientgo.New(
	apiclientgo.WithSecurity("indexing-token"),
)
res, err := s.Indexing.Documents.Index(ctx, components.DocumentRequest{
	// document data
})

Remember that each namespace requires its own authentication token type as described in the Authentication Methods section.

Table of Contents

SDK Installation

To add the SDK as a dependency to your project:

go get github.com/gleanwork/api-client-go

SDK Example Usage

Example 1
package main

import (
	"context"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
	)

	res, err := s.Client.Chat.Create(ctx, components.ChatRequest{
		Messages: []components.ChatMessage{
			components.ChatMessage{
				Fragments: []components.ChatMessageFragment{
					components.ChatMessageFragment{
						Text: apiclientgo.Pointer("What are the company holidays this year?"),
					},
				},
			},
		},
	}, nil, nil)
	if err != nil {
		log.Fatal(err)
	}
	if res.ChatResponse != nil {
		// handle response
	}
}

Example 2
package main

import (
	"context"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
	)

	res, err := s.Client.Chat.CreateStream(ctx, components.ChatRequest{
		Messages: []components.ChatMessage{
			components.ChatMessage{
				Fragments: []components.ChatMessageFragment{
					components.ChatMessageFragment{
						Text: apiclientgo.Pointer("What are the company holidays this year?"),
					},
				},
			},
		},
	}, nil)
	if err != nil {
		log.Fatal(err)
	}
	if res.ChatRequestStream != nil {
		// handle response
	}
}

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme Environment Variable
APIToken http HTTP Bearer GLEAN_API_TOKEN

You can configure it using the WithSecurity option when initializing the SDK client instance. For example:

package main

import (
	"context"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
	)

	res, err := s.Agents.Search(ctx, components.PlatformAgentsSearchRequest{
		Name: apiclientgo.Pointer("HR Policy Agent"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.PlatformAgentsSearchResponse != nil {
		// handle response
	}
}

Authentication Methods

Glean supports different authentication methods depending on which API namespace you're using:

Client Namespace

The Client namespace supports two authentication methods:

  1. Manually Provisioned API Tokens

    • Can be created by an Admin or a user with the API Token Creator role
    • Used for server-to-server integrations
  2. OAuth

    • Requires OAuth setup to be completed by an Admin
    • Used for user-based authentication flows
Indexing Namespace

The Indexing namespace supports only one authentication method:

  1. Manually Provisioned API Tokens
    • Can be created by an Admin or a user with the API Token Creator role
    • Used for secure document indexing operations

[!IMPORTANT] 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.

For more information on obtaining the appropriate token type, please contact your Glean administrator.

Available Resources and Operations

Available methods
Admin.Agents
  • List - List all agents
Admin.Idpgroups
  • List - List IdP groups
  • Get - Get an IdP group
Admin.Oauth.Clients
  • List - List OAuth clients
  • Get - Get an OAuth client
Agents
Chat
Client.Activity
Client.Agents
  • Create - Create an agent
  • Retrieve - Retrieve an agent ⚠ Deprecated
  • Update - Edit an agent
  • RetrieveSchemas - List an agent's schemas ⚠ Deprecated
  • Import - Import an agent
  • List - Search agents ⚠ Deprecated
  • RunStream - Create an agent run and stream the response ⚠ Deprecated
  • Run - Create an agent run and wait for the response ⚠ Deprecated
Client.Announcements
Client.Answers
Client.Authentication
Client.Chat
Client.Collections
Client.Datasources
Client.Documents
Client.Entities
Client.Governance.Data.Findings
  • Create - Creates findings export
  • List - Lists findings exports
  • Download - Downloads findings export
  • Delete - Deletes findings export
Client.Governance.Data.Policies
  • Retrieve - Gets specified policy
  • Update - Updates an existing policy
  • List - Lists policies
  • Create - Creates new policy
  • Download - Downloads violations CSV for policy
Client.Governance.Data.Reports
  • Create - Creates new one-time report
  • Download - Downloads violations CSV for report
  • Status - Fetches report run status
Client.Governance.Documents.Visibilityoverrides
  • List - Fetches documents visibility
  • Create - Hide or unhide docs
Client.Insights
Client.Messages
Client.Pins
Client.Shortcuts
Client.Tools
Client.Verification
Departments
  • List - List departments
  • Get - Get a department
Documents
Indexing.Authentication
Indexing.CustomMetadata
Indexing.Datasource
  • Status - Beta: Get datasource status
Indexing.Datasources
Indexing.Documents
  • AddOrUpdate - Index document

  • Index - Index documents

  • BulkIndex - Bulk index documents

  • ProcessAll - Schedules the processing of uploaded documents

  • Delete - Delete document

  • Debug - Beta: Get document information

  • DebugMany - Beta: Get information of a batch of documents

  • CheckAccess - Check document access

  • Status - Get document upload and indexing status ⚠ Deprecated

  • Count - Get document count ⚠ Deprecated

  • DebugEvents - Beta: Get document lifecycle events

Indexing.People
Indexing.Permissions
Indexing.Shortcuts
Skills
Triggers
Users

Server-sent event streaming

Server-sent events are used to stream content from certain operations. These operations will expose the stream as an iterable that can be consumed using a simple for loop. The loop will terminate when the server no longer has any events to send and closes the underlying connection.

package main

import (
	"context"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"github.com/gleanwork/api-client-go/models/operations"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
	)

	res, err := s.Chat.CreateStream(ctx, operations.PlatformChatCreateStreamRequest{
		Input: operations.CreatePlatformChatCreateStreamInputStr(
			"Summarize our parental leave policy as JSON.",
		),
		Text: &operations.PlatformChatCreateStreamText{
			Format: apiclientgo.Pointer(operations.CreatePlatformChatCreateStreamFormatPlatformChatJSONSchemaFormat(
				components.PlatformChatJSONSchemaFormat{
					Type: components.PlatformChatJSONSchemaFormatTypeJSONSchema,
					Name: "policy_summary",
					Schema: map[string]any{
						"type": "object",
						"properties": map[string]any{
							"eligible_employees": map[string]any{
								"type": "string",
							},
							"duration_weeks": map[string]any{
								"type": "integer",
							},
						},
						"required": []any{
							"eligible_employees",
							"duration_weeks",
						},
					},
				},
			)),
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.PlatformChatStreamEventServerSentEvent != nil {
		defer res.PlatformChatStreamEventServerSentEvent.Close()

		for res.PlatformChatStreamEventServerSentEvent.Next() {
			event := res.PlatformChatStreamEventServerSentEvent.Value()
			log.Print(event)
			// Handle the event
		}
	}
}

Retries

Some 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.

To change the default retry strategy for a single API call, simply provide a retry.Config object to the call by using the WithRetries option:

package main

import (
	"context"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"github.com/gleanwork/api-client-go/retry"
	"log"
	"models/operations"
	"os"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
	)

	res, err := s.Agents.Search(ctx, components.PlatformAgentsSearchRequest{
		Name: apiclientgo.Pointer("HR Policy Agent"),
	}, operations.WithRetries(
		retry.Config{
			Strategy: "backoff",
			Backoff: &retry.BackoffStrategy{
				InitialInterval: 1,
				MaxInterval:     50,
				Exponent:        1.1,
				MaxElapsedTime:  100,
			},
			RetryConnectionErrors: false,
		}))
	if err != nil {
		log.Fatal(err)
	}
	if res.PlatformAgentsSearchResponse != nil {
		// handle response
	}
}

If you'd like to override the default retry strategy for all operations that support retries, you can use the WithRetryConfig option at SDK initialization:

package main

import (
	"context"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"github.com/gleanwork/api-client-go/retry"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithRetryConfig(
			retry.Config{
				Strategy: "backoff",
				Backoff: &retry.BackoffStrategy{
					InitialInterval: 1,
					MaxInterval:     50,
					Exponent:        1.1,
					MaxElapsedTime:  100,
				},
				RetryConnectionErrors: false,
			}),
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
	)

	res, err := s.Agents.Search(ctx, components.PlatformAgentsSearchRequest{
		Name: apiclientgo.Pointer("HR Policy Agent"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.PlatformAgentsSearchResponse != nil {
		// handle response
	}
}

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both.

By 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.

For example, the Search function may return the following errors:

Error Type Status Code Content Type
apierrors.PlatformProblemDetailError 400, 401, 403, 404, 408, 413, 429 application/problem+json
apierrors.PlatformProblemDetailError 500, 503 application/problem+json
apierrors.APIError 4XX, 5XX */*
Example
package main

import (
	"context"
	"errors"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/apierrors"
	"github.com/gleanwork/api-client-go/models/components"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
	)

	res, err := s.Agents.Search(ctx, components.PlatformAgentsSearchRequest{
		Name: apiclientgo.Pointer("HR Policy Agent"),
	})
	if err != nil {

		var e *apierrors.PlatformProblemDetailError
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}

		var e *apierrors.PlatformProblemDetailError
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}

		var e *apierrors.APIError
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}
	}
}

Server Selection

Server Variables

The 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:

Variable Option Default Description
instance WithInstance(instance string) "instance-name" The instance name (typically the email domain without the TLD) that determines the deployment backend.
Example
package main

import (
	"context"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithServerIndex(0),
		apiclientgo.WithInstance("instance-name"),
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
	)

	res, err := s.Agents.Search(ctx, components.PlatformAgentsSearchRequest{
		Name: apiclientgo.Pointer("HR Policy Agent"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.PlatformAgentsSearchResponse != nil {
		// handle response
	}
}

Override Server URL Per-Client

The default server can be overridden globally using the WithServerURL(serverURL string) option when initializing the SDK client instance. For example:

package main

import (
	"context"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithServerURL("https://instance-name-be.glean.com"),
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
	)

	res, err := s.Agents.Search(ctx, components.PlatformAgentsSearchRequest{
		Name: apiclientgo.Pointer("HR Policy Agent"),
	})
	if err != nil {
		log.Fatal(err)
	}
	if res.PlatformAgentsSearchResponse != nil {
		// handle response
	}
}

Override Server URL Per-Operation

The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:

package main

import (
	"context"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/operations"
	"log"
	"os"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
	)

	res, err := s.Indexing.Datasources.Submit(ctx, "<value>", "<value>", map[string]any{
		"key":  "<value>",
		"key1": "<value>",
		"key2": "<value>",
	}, operations.WithServerURL("https://instance-name-be.glean.com"))
	if err != nil {
		log.Fatal(err)
	}
	if res.Object != nil {
		// handle response
	}
}

Custom HTTP Client

The 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:

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

The 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.

import (
	"net/http"
	"time"

	"github.com/gleanwork/api-client-go"
)

var (
	httpClient = &http.Client{Timeout: 30 * time.Second}
	sdkClient  = apiclientgo.New(apiclientgo.WithClient(httpClient))
)

This can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration.

Special Types

This SDK defines the following custom types to assist with marshalling and unmarshalling data.

Date

types.Date is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02".

Usage
d1 := types.NewDate(time.Now()) // returns *types.Date

d2 := types.DateFromTime(time.Now()) // returns types.Date

d3, err := types.NewDateFromString("2019-01-01") // returns *types.Date, error

d4, err := types.DateFromString("2019-01-01") // returns types.Date, error

d5 := types.MustNewDateFromString("2019-01-01") // returns *types.Date and panics on error

d6 := types.MustDateFromString("2019-01-01") // returns types.Date and panics on error

Experimental Features and Deprecation Testing

The SDK provides options to test upcoming API changes before they become the default behavior. This is useful for:

  • Testing experimental features before they are generally available
  • Preparing for deprecations by excluding deprecated endpoints ahead of their removal
Configuration Options

You can configure these options either via environment variables or SDK constructor options:

Using Environment Variables
export X_GLEAN_EXCLUDE_DEPRECATED_AFTER="2026-10-15"
export X_GLEAN_INCLUDE_EXPERIMENTAL="true"
package main

import (
	"context"
	"log"
	"os"

	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
		apiclientgo.WithServerURL("https://mycompany-be.glean.com"),
	)

	res, err := s.Client.Search.Query(ctx, components.SearchRequest{
		Query: "test",
	}, nil)
	if err != nil {
		log.Fatal(err)
	}
	// Headers are automatically set based on environment variables
	log.Println(res)
}
Using SDK Constructor Options
package main

import (
	"context"
	"log"
	"os"

	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
)

func main() {
	ctx := context.Background()

	s := apiclientgo.New(
		apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
		apiclientgo.WithServerURL("https://mycompany-be.glean.com"),
		apiclientgo.WithExcludeDeprecatedAfter("2026-10-15"),
		apiclientgo.WithIncludeExperimental(true),
	)

	res, err := s.Client.Search.Query(ctx, components.SearchRequest{
		Query: "test",
	}, nil)
	if err != nil {
		log.Fatal(err)
	}
	log.Println(res)
}
Option Reference
Option Environment Variable Type Description
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.
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.

Note: Environment variables take precedence over SDK constructor options when both are set.

Warning: Experimental features may change or be removed without notice. Do not rely on experimental features in production environments.

Development

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While 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. We 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.

SDK Created by Speakeasy

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerList = []string{
	"https://{instance}-be.glean.com",
}

ServerList contains the list of servers available to the SDK

Functions

func Bool

func Bool(b bool) *bool

Bool provides a helper function to return a pointer to a bool

func Float32

func Float32(f float32) *float32

Float32 provides a helper function to return a pointer to a float32

func Float64

func Float64(f float64) *float64

Float64 provides a helper function to return a pointer to a float64

func Int

func Int(i int) *int

Int provides a helper function to return a pointer to an int

func Int64

func Int64(i int64) *int64

Int64 provides a helper function to return a pointer to an int64

func Pointer

func Pointer[T any](v T) *T

Pointer provides a helper function to return a pointer to a type

func String

func String(s string) *string

String provides a helper function to return a pointer to a string

Types

type Activity

type Activity struct {
	// contains filtered or unexported fields
}

func (*Activity) Feedback

func (s *Activity) Feedback(ctx context.Context, feedbackQueryParameter *string, feedback1 *components.Feedback, opts ...operations.Option) (*operations.FeedbackResponse, error)

Feedback - Report client activity Report events that happen to results within a Glean client UI, such as search result views and clicks. This signal improves search quality.

func (*Activity) Report

Report document activity Report user activity that occurs on indexed documents such as viewing or editing. This signal improves search quality.

type Admin added in v0.17.0

type Admin struct {
	Oauth     *Oauth
	Idpgroups *Idpgroups
	Agents    *AdminAgents
	// contains filtered or unexported fields
}

type AdminAgents added in v0.17.0

type AdminAgents struct {
	// contains filtered or unexported fields
}

func (*AdminAgents) List added in v0.17.0

List all agents List every agent in the workspace, ordered by name and then by agent_id. Each agent has the same shape that Get agent returns. Unlike agent search, the list does not depend on who an agent is shared with, so it includes private and disabled agents. Deleted agents are left out. Use the agent_id with other Platform APIs, for example as a usage limit target. The caller must be able to read all agents, administer agents, or read workspace billing.

type Agents

type Agents struct {
	// contains filtered or unexported fields
}

func (*Agents) CancelRun added in v0.15.15

func (s *Agents) CancelRun(ctx context.Context, agentID string, platformAgentRunCancellationRequest components.PlatformAgentRunCancellationRequest, opts ...operations.Option) (*operations.PlatformAgentsCancelRunResponse, error)

CancelRun - Cancel an agent run Request cooperative cancellation of the durable agent run identified by `run_id` in the JSON body. Requires ownership, current agent access, and the agents.run scope. Sending a cancellation signal does not itself change an active run from RUNNING; poll GET run for the final state. Paused runs become CANCELLED without resuming execution. Repeated requests and requests for terminal runs return the current snapshot. Completion may win a race with cancellation. Completed tool side effects cannot be undone, and external work may continue if a tool does not support cancellation. Cancellation targets this run, not separate background-subagent executions. An active run without a cancellation registration returns 409. Cancellation signaling requires Redis. An interrupted active run can instead become FAILED through deadline cleanup; this does not verify that external tool work has stopped.

func (*Agents) CreateRun added in v0.13.0

func (s *Agents) CreateRun(ctx context.Context, agentID string, platformAgentRunCreateRequest components.PlatformAgentRunCreateRequest, opts ...operations.Option) (*operations.PlatformAgentsCreateRunResponse, error)

CreateRun - Create agent run Execute an agent run. By default, set `stream` to true to receive server-sent events; otherwise the response contains the final agent messages. Set `execution_mode` to `DURABLE` to persist a new run and return its initial snapshot with HTTP 201 without waiting for execution. Poll the agent-scoped GET run endpoint for progress. Durable execution continues after an HTTP disconnect, but is not automatically resumed after a QE restart or crash. An active turn becomes overdue more than 40 minutes after acceptance (a 30-minute execution timeout plus 10 minutes of grace). The next GET of the run marks the overdue turn FAILED without replay; there is no periodic sweep. Without a GET, the stored run can remain RUNNING. Failure does not prove that external tool work has stopped. Paused runs are not expired; an accepted approval continuation starts a fresh deadline. Each POST creates a new run; retrying a POST can create another execution. Submit pending approval decisions through the run responses endpoint, and cancellation can be requested through the run cancellations endpoint. A run tracks one workflow execution; automatic background-subagent wake turns are separate executions, not continuations tracked by this run ID.

func (*Agents) Get added in v0.13.0

Get agent Retrieve details for an agent available to the authenticated user.

func (*Agents) GetRun added in v0.15.15

func (s *Agents) GetRun(ctx context.Context, agentID string, runID string, opts ...operations.Option) (*operations.PlatformAgentsGetRunResponse, error)

GetRun - Get agent run Retrieve a persisted workflow execution owned by the authenticated user. The run must belong to the specified agent, and the user must still have access to that agent. Unknown runs, runs owned by another user, and mismatched agent/run identifiers return 404. Requires the agents.run scope. Executions without a persisted workflow record are not available through this endpoint.

func (*Agents) GetSchemas added in v0.13.0

func (s *Agents) GetSchemas(ctx context.Context, agentID string, includeTools *bool, opts ...operations.Option) (*operations.PlatformAgentsGetSchemasResponse, error)

GetSchemas - Get agent schemas Retrieve an agent's input and output JSON schemas.

func (*Agents) RespondToRun added in v0.15.15

func (s *Agents) RespondToRun(ctx context.Context, agentID string, platformAgentRunResponsesRequest components.PlatformAgentRunResponsesRequest, opts ...operations.Option) (*operations.PlatformAgentsCreateRunResponsesResponse, error)

RespondToRun - Respond to agent run approvals Submit decisions for every pending tool approval in the paused run's current batch. The run is identified by `run_id` in the JSON body. Decisions apply only to the stored invocations and arguments; argument edits, authentication responses, and session-wide grants are not supported. The caller must own the run, still have agent access, and have the agents.run scope. Acceptance persists the decisions before resuming the same run and chat session. Identical accepted decisions return the current snapshot without another continuation. Conflicting, stale, incomplete, or non-pending decisions return 409. Cancellation registration failure returns 503 without accepting the decisions; retry the same approval batch. This retry guarantee does not cover an indeterminate database commit outcome. Go workflow approval resumes currently support one tool invocation and one approval response. Unsupported multi-tool or multi-decision Go resumes fail without executing tools. The resumed action must resolve to the tool identified by the stored approval request and paused checkpoint. Missing or inconsistent identity fails without executing tools. Execution continues after HTTP disconnects, but is not automatically resumed after a QE crash. Each accepted continuation starts a fresh 30-minute execution timeout and 40-minute cleanup deadline. Identical retries do not extend that deadline. Waiting for approval does not expire a run. The next GET marks an overdue active turn FAILED without replaying execution.

func (*Agents) Search added in v0.13.0

Search agents Search agents available to the authenticated user by agent name.

type Announcements

type Announcements struct {
	// contains filtered or unexported fields
}

func (*Announcements) Create

Create Announcement Create a textual announcement visible to some set of users based on department and location.

func (*Announcements) Delete

Delete Announcement Delete an existing user-generated announcement.

func (*Announcements) Update

Update Announcement Update a textual announcement visible to some set of users based on department and location.

type Answers

type Answers struct {
	// contains filtered or unexported fields
}

func (*Answers) Create

func (s *Answers) Create(ctx context.Context, createAnswerRequest components.CreateAnswerRequest, locale *string, opts ...operations.Option) (*operations.CreateanswerResponse, error)

Create Answer Create a user-generated Answer that contains a question and answer.

func (*Answers) Delete

func (s *Answers) Delete(ctx context.Context, deleteAnswerRequest components.DeleteAnswerRequest, locale *string, opts ...operations.Option) (*operations.DeleteanswerResponse, error)

Delete Answer Delete an existing user-generated Answer.

func (*Answers) List deprecated

func (s *Answers) List(ctx context.Context, listAnswersRequest components.ListAnswersRequest, locale *string, opts ...operations.Option) (*operations.ListanswersResponse, error)

List Answers List Answers created by the current user.

Deprecated: Deprecated on 2026-01-21, removal scheduled for 2027-01-15: Answer boards have been removed and this endpoint no longer serves a purpose.

func (*Answers) Retrieve

func (s *Answers) Retrieve(ctx context.Context, getAnswerRequest components.GetAnswerRequest, locale *string, opts ...operations.Option) (*operations.GetanswerResponse, error)

Retrieve - Read Answer Read the details of a particular Answer given its ID.

func (*Answers) Update

func (s *Answers) Update(ctx context.Context, editAnswerRequest components.EditAnswerRequest, locale *string, opts ...operations.Option) (*operations.EditanswerResponse, error)

Update Answer Update an existing user-generated Answer.

type Chat

type Chat struct {
	// contains filtered or unexported fields
}

func (*Chat) Create

Create a chat response Run an assistant turn. The default response is JSON. HTTP clients request server-sent events by setting `stream` to true in the JSON body. An `Accept: text/event-stream` header does not replace `stream`.

func (*Chat) CreateStream

CreateStream - Create a streaming chat response SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Run an assistant turn as server-sent events. HTTP clients request this mode by setting `stream` to true in the JSON body.

func (*Chat) Update added in v0.17.1

func (s *Chat) Update(ctx context.Context, chatID string, platformChatUpdateRequest components.PlatformChatUpdateRequest, opts ...operations.Option) (*operations.PlatformChatUpdateResponse, error)

Update a chat Update the name of a chat. Only the chat owner can update it.

type Client

type Client struct {
	Activity       *Activity
	Announcements  *Announcements
	Answers        *Answers
	Authentication *ClientAuthentication
	Chat           *ClientChat
	Agents         *ClientAgents
	Collections    *Collections
	Documents      *ClientDocuments
	Insights       *Insights
	Messages       *Messages
	Pins           *Pins
	Search         *ClientSearch
	Entities       *Entities
	Shortcuts      *ClientShortcuts
	Verification   *Verification
	Tools          *Tools
	Governance     *Governance
	Datasources    *ClientDatasources
	// contains filtered or unexported fields
}

type ClientAgents added in v0.12.0

type ClientAgents struct {
	// contains filtered or unexported fields
}

func (*ClientAgents) Create added in v0.13.0

func (s *ClientAgents) Create(ctx context.Context, createWorkflowRequest components.CreateWorkflowRequest, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.CreateAgentResponse, error)

Create an agent Create an agent.

func (*ClientAgents) Import added in v0.13.5

func (s *ClientAgents) Import(ctx context.Context, agentID string, importAgentRequest components.ImportAgentRequest, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.ImportAgentResponse, error)

Import an agent Imports an [agent](https://developers.glean.com/agents/agents-api) from its on-disk folder representation (spec.yaml, instructions.md, skills/, subagents/) packaged as a zip, and creates or updates the agent. Inverse of the export flow: the folder-to-schema conversion runs server-side. The bundle must contain only regular files; symlinks are resolved by the caller at packaging time.

func (*ClientAgents) List deprecated added in v0.12.0

List - Search agents Search for [agents](https://developers.glean.com/agents/agents-api) by agent name.

Deprecated: Deprecated on 2026-08-25, removal scheduled for 2027-04-15: Use POST /api/agents/search instead..

func (*ClientAgents) Retrieve deprecated added in v0.12.0

func (s *ClientAgents) Retrieve(ctx context.Context, agentID string, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.GetAgentResponse, error)

Retrieve an agent Returns details of an [agent](https://developers.glean.com/agents/agents-api) created in the Agent Builder.

Deprecated: Deprecated on 2026-08-25, removal scheduled for 2027-04-15: Use GET /api/agents/{agent_id} instead..

func (*ClientAgents) RetrieveSchemas deprecated added in v0.12.0

func (s *ClientAgents) RetrieveSchemas(ctx context.Context, agentID string, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.GetAgentSchemasResponse, error)

RetrieveSchemas - List an agent's schemas Return [agent](https://developers.glean.com/agents/agents-api)'s input and output schemas. You can use these schemas to detect changes to an agent's input or output structure.

Deprecated: Deprecated on 2026-08-25, removal scheduled for 2027-04-15: Use GET /api/agents/{agent_id}/schemas instead..

func (*ClientAgents) Run deprecated added in v0.12.0

Run - Create an agent run and wait for the response Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the final response. **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object.

Deprecated: Deprecated on 2026-08-25, removal scheduled for 2027-04-15: Use POST /api/agents/{agent_id}/runs instead..

func (*ClientAgents) RunStream deprecated added in v0.12.0

RunStream - Create an agent run and stream the response Executes an [agent](https://developers.glean.com/agents/agents-api) run and returns the result as a stream of server-sent events (SSE). **Note**: If the agent uses an input form trigger, all form fields (including optional fields) must be included in the `input` object.

Deprecated: Deprecated on 2026-08-25, removal scheduled for 2027-04-15: Use POST /api/agents/{agent_id}/runs with stream=true instead..

func (*ClientAgents) Update added in v0.13.0

func (s *ClientAgents) Update(ctx context.Context, agentID string, editWorkflowRequest components.EditWorkflowRequest, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.EditAgentResponse, error)

Update - Edit an agent Creates a draft or publishes an [agent](https://developers.glean.com/agents/agents-api). Use `isDraft=true` to save a draft, or `isDraft=false` (or omit) to publish immediately. Only draft and publish modes are supported.

type ClientAuthentication

type ClientAuthentication struct {
	// contains filtered or unexported fields
}

func (*ClientAuthentication) CheckDatasourceAuth added in v0.13.0

CheckDatasourceAuth - Check datasource authorization Returns all datasource instances that require per-user OAuth authorization for the authenticated user, along with a transient auth token that can be appended to auth URLs to complete OAuth flows.

Clients construct the full OAuth URL by combining the backend base URL, the `authUrlRelativePath` from each instance, and the transient auth token: `<backend>/<authUrlRelativePath>?transient_auth_token=<token>`.

func (*ClientAuthentication) CreateToken

CreateToken - Create authentication token Creates an authentication token for the authenticated user. These are specifically intended to be used with the [Web SDK](https://developers.glean.com/web).

Note: The tokens generated from this endpoint are **not** valid tokens for use with the Client API (e.g. `/rest/api/v1/*`).

type ClientChat added in v0.12.0

type ClientChat struct {
	// contains filtered or unexported fields
}

func (*ClientChat) Create added in v0.12.0

func (s *ClientChat) Create(ctx context.Context, chatRequest components.ChatRequest, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.ChatResponse, error)

Create - Chat Have a conversation with Glean AI.

func (*ClientChat) CreateStream added in v0.12.0

func (s *ClientChat) CreateStream(ctx context.Context, chatRequest components.ChatRequest, timezoneOffset *int64, opts ...operations.Option) (*operations.ChatStreamResponse, error)

CreateStream - Chat Have a conversation with Glean AI.

func (*ClientChat) Delete added in v0.12.0

func (s *ClientChat) Delete(ctx context.Context, deleteChatsRequest components.DeleteChatsRequest, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.DeletechatsResponse, error)

Delete - Deletes saved Chats Deletes saved Chats and all their contained conversational content.

func (*ClientChat) DeleteAll added in v0.12.0

func (s *ClientChat) DeleteAll(ctx context.Context, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.DeleteallchatsResponse, error)

DeleteAll - Deletes all saved Chats owned by a user Deletes all saved Chats a user has had and all their contained conversational content.

func (*ClientChat) DeleteFiles added in v0.12.0

func (s *ClientChat) DeleteFiles(ctx context.Context, deleteChatFilesRequest components.DeleteChatFilesRequest, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.DeletechatfilesResponse, error)

DeleteFiles - Delete files uploaded by a user for chat Delete files uploaded by a user for Chat.

func (*ClientChat) List added in v0.12.0

func (s *ClientChat) List(ctx context.Context, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.ListchatsResponse, error)

List - Retrieves all saved Chats Retrieves all the saved Chats between Glean Assistant and the user. The returned Chats contain only metadata and no conversational content.

func (*ClientChat) Retrieve added in v0.12.0

func (s *ClientChat) Retrieve(ctx context.Context, getChatRequest components.GetChatRequest, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.GetchatResponse, error)

Retrieve - Retrieves a Chat Retrieves the chat history between Glean Assistant and the user for a given Chat. Omit pagination fields to return the full message history (existing behavior). Use last alone for the latest page, last with before for older messages, or first with after for newer messages. Each page is chronological and includes pagination cursors and page flags.

func (*ClientChat) RetrieveApplication added in v0.12.0

func (s *ClientChat) RetrieveApplication(ctx context.Context, getChatApplicationRequest components.GetChatApplicationRequest, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.GetchatapplicationResponse, error)

RetrieveApplication - Gets the metadata for a custom Chat application Gets the Chat application details for the specified application ID.

func (*ClientChat) RetrieveFile added in v0.13.5

func (s *ClientChat) RetrieveFile(ctx context.Context, fileID string, preview *bool, opts ...operations.Option) (*operations.GetChatFileResponse, error)

RetrieveFile - Download a chat file Download the raw content of a file generated or uploaded during a chat session (for example, an image produced by the assistant). Returns the file bytes with a Content-Type header matching the file's MIME type.

func (*ClientChat) RetrieveFiles added in v0.12.0

func (s *ClientChat) RetrieveFiles(ctx context.Context, getChatFilesRequest components.GetChatFilesRequest, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.GetchatfilesResponse, error)

RetrieveFiles - Get files uploaded by a user for Chat Get files uploaded by a user for Chat.

func (*ClientChat) UploadFiles added in v0.12.0

func (s *ClientChat) UploadFiles(ctx context.Context, uploadChatFilesRequest components.UploadChatFilesRequest, locale *string, timezoneOffset *int64, opts ...operations.Option) (*operations.UploadchatfilesResponse, error)

UploadFiles - Upload files for Chat Upload files for Chat.

type ClientDatasources added in v0.13.0

type ClientDatasources struct {
	// contains filtered or unexported fields
}

func (*ClientDatasources) RetrieveConfiguration added in v0.13.0

func (s *ClientDatasources) RetrieveConfiguration(ctx context.Context, datasourceID string, instanceID string, opts ...operations.Option) (*operations.GetDatasourceInstanceConfigurationResponse, error)

RetrieveConfiguration - Get datasource instance configuration Gets the greenlisted configuration values for a datasource instance. Returns only configuration keys that are exposed via the public API greenlist.

func (*ClientDatasources) RetrieveCredentialStatus added in v0.13.0

func (s *ClientDatasources) RetrieveCredentialStatus(ctx context.Context, datasourceInstanceID string, opts ...operations.Option) (*operations.GetDatasourceCredentialStatusResponse, error)

RetrieveCredentialStatus - Get datasource instance credential status Returns the current credential status for a datasource instance. Access is limited to callers with the ADMIN scope; the handler enforces this check.

func (*ClientDatasources) RotateCredentials added in v0.13.0

func (s *ClientDatasources) RotateCredentials(ctx context.Context, datasourceInstanceID string, rotateDatasourceCredentialsRequest components.RotateDatasourceCredentialsRequest, opts ...operations.Option) (*operations.RotateDatasourceCredentialsResponse, error)

RotateCredentials - Rotate datasource instance credentials Rotates the credentials that a datasource instance uses to connect to its upstream system. Replaces the active credential material with the supplied values and returns the credential status after rotation. Access is limited to callers with the ADMIN scope; the handler enforces this check. Only keys recognized as credential material for the datasource type may be set in `credentials.values` (e.g. `clientSecret`, `apiToken`, `privateKey`, depending on the configured auth method). Unrecognized keys, or keys that correspond to non-credential configuration, cause a 400; other instance configuration must be updated via PATCH /configure/datasources/{datasourceId}/instances/{instanceId}.

func (*ClientDatasources) UpdateConfiguration added in v0.13.0

func (s *ClientDatasources) UpdateConfiguration(ctx context.Context, datasourceID string, instanceID string, updateDatasourceConfigurationRequest components.UpdateDatasourceConfigurationRequest, opts ...operations.Option) (*operations.UpdateDatasourceInstanceConfigurationResponse, error)

UpdateConfiguration - Update datasource instance configuration Updates the greenlisted configuration values for a datasource instance. Only configuration keys that are exposed via the public API greenlist may be set. Returns the full greenlisted configuration after the update is applied.

type ClientDocuments

type ClientDocuments struct {
	// contains filtered or unexported fields
}

func (*ClientDocuments) Retrieve

func (s *ClientDocuments) Retrieve(ctx context.Context, locale *string, getDocumentsRequest *components.GetDocumentsRequest, opts ...operations.Option) (*operations.GetdocumentsResponse, error)

Retrieve - Read documents Read the documents including metadata (does not include enhanced metadata via `/documentmetadata`) for the given list of Glean Document IDs or URLs specified in the request.

func (*ClientDocuments) RetrieveByFacets

func (s *ClientDocuments) RetrieveByFacets(ctx context.Context, locale *string, getDocumentsByFacetsRequest *components.GetDocumentsByFacetsRequest, opts ...operations.Option) (*operations.GetdocumentsbyfacetsResponse, error)

RetrieveByFacets - Read documents by facets Read the documents including metadata (does not include enhanced metadata via `/documentmetadata`) macthing the given facet conditions.

func (*ClientDocuments) RetrievePermissions

func (s *ClientDocuments) RetrievePermissions(ctx context.Context, getDocPermissionsRequest components.GetDocPermissionsRequest, locale *string, opts ...operations.Option) (*operations.GetdocpermissionsResponse, error)

RetrievePermissions - Read document permissions Read the emails of all users who have access to the given document.

func (*ClientDocuments) Summarize

func (s *ClientDocuments) Summarize(ctx context.Context, summarizeRequest components.SummarizeRequest, locale *string, opts ...operations.Option) (*operations.SummarizeResponse, error)

Summarize documents Generate an AI summary of the requested documents.

type ClientSearch added in v0.13.0

type ClientSearch struct {
	// contains filtered or unexported fields
}

func (*ClientSearch) Autocomplete added in v0.13.0

func (s *ClientSearch) Autocomplete(ctx context.Context, autocompleteRequest components.AutocompleteRequest, locale *string, opts ...operations.Option) (*operations.AutocompleteResponse, error)

Autocomplete Retrieve query suggestions, operators and documents for the given partially typed query.

func (*ClientSearch) Query added in v0.13.0

func (s *ClientSearch) Query(ctx context.Context, searchRequest components.SearchRequest, locale *string, opts ...operations.Option) (*operations.SearchResponse, error)

Query - Search Retrieve results from the index for the given query and filters.

func (*ClientSearch) QueryAsAdmin added in v0.13.0

func (s *ClientSearch) QueryAsAdmin(ctx context.Context, searchRequest components.SearchRequest, locale *string, opts ...operations.Option) (*operations.AdminsearchResponse, error)

QueryAsAdmin - Search the index (admin) Retrieves results for search query without respect for permissions. This is available only to privileged users.

func (*ClientSearch) Recommendations added in v0.13.0

func (s *ClientSearch) Recommendations(ctx context.Context, recommendationsRequest components.RecommendationsRequest, locale *string, opts ...operations.Option) (*operations.RecommendationsResponse, error)

Recommendations - Recommend documents Retrieve recommended documents for the given URL or Glean Document ID.

func (*ClientSearch) RetrieveFeed added in v0.13.0

func (s *ClientSearch) RetrieveFeed(ctx context.Context, feedRequest components.FeedRequest, locale *string, opts ...operations.Option) (*operations.FeedResponse, error)

RetrieveFeed - Feed of documents and events The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more.

type ClientShortcuts

type ClientShortcuts struct {
	// contains filtered or unexported fields
}

func (*ClientShortcuts) Create

Create shortcut Create a user-generated shortcut that contains an alias and destination URL.

func (*ClientShortcuts) Delete

Delete shortcut Delete an existing user-generated shortcut.

func (*ClientShortcuts) List

func (s *ClientShortcuts) List(ctx context.Context, listShortcutsPaginatedRequest components.ListShortcutsPaginatedRequest, locale *string, opts ...operations.Option) (*operations.ListshortcutsResponse, error)

List shortcuts List shortcuts editable/owned by the currently authenticated user.

func (*ClientShortcuts) Retrieve

Retrieve - Read shortcut Read a particular shortcut's details given its ID.

func (*ClientShortcuts) Update

Update shortcut Updates the shortcut with the given ID.

type Clients added in v0.17.1

type Clients struct {
	// contains filtered or unexported fields
}

func (*Clients) Get added in v0.17.1

Get an OAuth client Get one static OAuth client that an admin created for this workspace. A client that an admin disabled is returned with is_enabled false. A deleted client, a dynamically registered client, one of Glean's own clients, such as Glean Desktop, and an unknown client_id all return 404. The path takes the OAuth client_id, not ai_gateway.usage_client_id. The caller needs admin read or billing read permission.

func (*Clients) List added in v0.17.1

List OAuth clients List the static OAuth clients that admins created for this workspace, ordered by display_name and then by client_id. Dynamically registered clients and Glean's own clients, such as Glean Desktop, are not listed. Disabled clients are left out unless an is_enabled filter includes the value "false". Use filters to find clients by name, client_id, usage_client_id, LLM Gateway access, or supported app. To set a usage limit for a client, send its ai_gateway.usage_client_id, not its client_id, to the usage APIs. The caller needs admin read or billing read permission.

type Collections

type Collections struct {
	// contains filtered or unexported fields
}

func (*Collections) AddItems

func (s *Collections) AddItems(ctx context.Context, addCollectionItemsRequest components.AddCollectionItemsRequest, locale *string, opts ...operations.Option) (*operations.AddcollectionitemsResponse, error)

AddItems - Add Collection item Add items to a Collection.

func (*Collections) Create

func (s *Collections) Create(ctx context.Context, createCollectionRequest components.CreateCollectionRequest, locale *string, opts ...operations.Option) (*operations.CreatecollectionResponse, error)

Create Collection Create a publicly visible (empty) Collection of documents.

func (*Collections) Delete

func (s *Collections) Delete(ctx context.Context, deleteCollectionRequest components.DeleteCollectionRequest, locale *string, opts ...operations.Option) (*operations.DeletecollectionResponse, error)

Delete Collection Delete a Collection given the Collection's ID.

func (*Collections) DeleteItem

func (s *Collections) DeleteItem(ctx context.Context, deleteCollectionItemRequest components.DeleteCollectionItemRequest, locale *string, opts ...operations.Option) (*operations.DeletecollectionitemResponse, error)

DeleteItem - Delete Collection item Delete a single item from a Collection.

func (*Collections) List

func (s *Collections) List(ctx context.Context, listCollectionsRequest components.ListCollectionsRequest, locale *string, opts ...operations.Option) (*operations.ListcollectionsResponse, error)

List Collections List all existing Collections.

func (*Collections) Retrieve

func (s *Collections) Retrieve(ctx context.Context, getCollectionRequest components.GetCollectionRequest, locale *string, opts ...operations.Option) (*operations.GetcollectionResponse, error)

Retrieve - Read Collection Read the details of a Collection given its ID. Does not fetch items in this Collection.

func (*Collections) Update

func (s *Collections) Update(ctx context.Context, editCollectionRequest components.EditCollectionRequest, locale *string, opts ...operations.Option) (*operations.EditcollectionResponse, error)

Update Collection Update the properties of an existing Collection.

func (*Collections) UpdateItem

func (s *Collections) UpdateItem(ctx context.Context, editCollectionItemRequest components.EditCollectionItemRequest, locale *string, opts ...operations.Option) (*operations.EditcollectionitemResponse, error)

UpdateItem - Update Collection item Update the URL, Glean Document ID, description of an item within a Collection given its ID.

type CustomMetadata added in v0.12.0

type CustomMetadata struct {
	// contains filtered or unexported fields
}

func (*CustomMetadata) Delete added in v0.12.0

Delete - Remove custom metadata Removes all custom metadata for the specified metadata group from a document.

func (*CustomMetadata) DeleteSchema added in v0.12.0

DeleteSchema - Remove metadata schema Deletes the schema definition for a metadata group. This does not delete existing metadata values on documents.

func (*CustomMetadata) GetSchema added in v0.12.0

GetSchema - Retrieve metadata schema Retrieves the current schema definition for a metadata group.

func (*CustomMetadata) Upsert added in v0.12.0

Upsert - Add or update custom metadata Associates custom metadata with a specific document. Custom metadata enables you to enrich documents with additional structured information that can be used for search, filtering, and faceting.

func (*CustomMetadata) UpsertSchema added in v0.12.0

UpsertSchema - Create or update metadata schema Defines or updates the schema for a metadata group. Schemas should be defined before indexing metadata.

type Data

type Data struct {
	Policies *Policies
	Reports  *Reports
	Findings *Findings
	// contains filtered or unexported fields
}

type Datasource

type Datasource struct {
	// contains filtered or unexported fields
}

func (*Datasource) Status

Status - Beta: Get datasource status

Gather information about the datasource's overall status. Currently in beta, might undergo breaking changes without prior notice.

Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/indexing/debugging/datasource-config) for more information.

type Departments added in v0.17.0

type Departments struct {
	// contains filtered or unexported fields
}

func (*Departments) Get added in v0.17.1

Get a department Get one department by its department_id. The department can be any department that the list returns, including one that only a usage limit names. A department_id that is not valid, or that no user and no usage limit uses, returns 404 resource_not_found. A department_id comes from the exact department name, so a renamed department gets a new ID, and a name that is used again gets its old ID back.

func (*Departments) List added in v0.17.0

List departments List the departments in the Glean directory, ordered by display_name and then by department_id. The list includes every department that at least one user belongs to or that a usage limit names, so a caller can show the name of a department that a usage limit still names after its users leave it. Department names are exact, so names that differ only by case are different departments. Send a name filter to return only the departments whose display_name contains a value.

type Documents added in v0.17.2

type Documents struct {
	// contains filtered or unexported fields
}

func (*Documents) Batch added in v0.17.2

Batch get documents Retrieve up to 100 permission-visible indexed documents by URL or document_id. Found items are in results. Complete misses are warnings correlated by index. Incomplete store work fails the whole request. Retrieving search results is best-effort parity with legacy getdocuments. Gmail and Outlook caller-specific citation IDs are not accepted as document_id selectors. Use URL selectors for them. A Gmail or Outlook URL can still return a resource_not_found warning. Federated results and go-link shortcut documents are not retrievable in this release.

func (*Documents) GetByID added in v0.17.2

GetByID - Get document by ID Retrieve one permission-visible indexed document by its Glean store ID. Gmail and Outlook search results and chat citations can carry caller-specific IDs that this operation cannot resolve. Try get document by URL for those documents. URL lookup does not resolve every Gmail or Outlook result.

func (*Documents) GetByURL added in v0.17.2

GetByURL - Get document by URL Retrieve one permission-visible indexed document by URL. The url is the lookup key that Platform search returns. Many URLs can resolve to one document. The response is a single document, not a list. The returned url is the permalink and may differ from the submitted URL. Gmail and Outlook search results and chat citations carry caller-specific IDs that get document by ID cannot resolve, so retrieve them by URL here. A Gmail or Outlook URL that Platform search returned can still return 404, as it can with legacy getdocuments. Retrieving search results is best-effort parity with legacy getdocuments. Federated results and go-link shortcut documents are not retrievable in this release.

type Entities

type Entities struct {
	// contains filtered or unexported fields
}

func (*Entities) List

func (s *Entities) List(ctx context.Context, listEntitiesRequest components.ListEntitiesRequest, locale *string, opts ...operations.Option) (*operations.ListentitiesResponse, error)

List entities List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities.

func (*Entities) ReadPeople

func (s *Entities) ReadPeople(ctx context.Context, peopleRequest components.PeopleRequest, locale *string, opts ...operations.Option) (*operations.PeopleResponse, error)

ReadPeople - Read people Read people details for the given IDs.

func (*Entities) RetrievePersonPhoto added in v0.13.0

func (s *Entities) RetrievePersonPhoto(ctx context.Context, personID string, ds *string, opts ...operations.Option) (*operations.GetPersonPhotoResponse, error)

RetrievePersonPhoto - Get person photo Returns the profile photo bytes for a person whose photo is stored in Glean (crawled from an identity source or user-uploaded via admin console). Photos hosted externally (e.g. Slack CDN) are not served by this endpoint; callers should follow the photoUrl from /people or /listentities directly. Responses include a Cache-Control header (max-age=3600) to reduce redundant fetches.

type Findings added in v0.13.0

type Findings struct {
	// contains filtered or unexported fields
}

func (*Findings) Create added in v0.13.0

Create - Creates findings export Creates a new DLP findings export job.

func (*Findings) Delete added in v0.13.0

Delete - Deletes findings export Deletes a DLP findings export.

func (*Findings) Download added in v0.13.0

Download - Downloads findings export Downloads a DLP findings export as a CSV file.

func (*Findings) List added in v0.13.0

List - Lists findings exports Lists all DLP findings exports.

type Glean

type Glean struct {
	SDKVersion  string
	Agents      *Agents
	Chat        *Chat
	Skills      *Skills
	Search      *Search
	Admin       *Admin
	Departments *Departments
	Users       *Users
	Documents   *Documents
	Triggers    *Triggers
	Client      *Client
	Indexing    *Indexing
	// contains filtered or unexported fields
}

Glean API: # Introduction In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean.

# Usage guidelines This API is evolving fast. Glean will provide advance notice of any planned backwards incompatible changes along with a 6-month sunset period for anything that requires developers to adopt the new versions.

# API Clients Official API clients for the Glean Indexing API are available in multiple languages:

- [Python](https://github.com/gleanwork/api-client-python) - [TypeScript](https://github.com/gleanwork/api-client-typescript) - [Go](https://github.com/gleanwork/api-client-go) - [Java](https://github.com/gleanwork/api-client-java)

These API clients provide type-safe, idiomatic interfaces for working with Glean IndexingAPIs in your language of choice.

func New

func New(opts ...SDKOption) *Glean

New creates a new instance of the SDK with the provided options

type Governance

type Governance struct {
	Data      *Data
	Documents *GovernanceDocuments
	// contains filtered or unexported fields
}

type GovernanceDocuments

type GovernanceDocuments struct {
	Visibilityoverrides *Visibilityoverrides
	// contains filtered or unexported fields
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for supplying the SDK with a custom HTTP client

type Idpgroups added in v0.17.0

type Idpgroups struct {
	// contains filtered or unexported fields
}

func (*Idpgroups) Get added in v0.17.1

Get an IdP group Get one identity provider (IdP) group by its idp_group_id. An idp_group_id that is not valid, or that names no group that the list returns, returns 404 resource_not_found. A group that was removed from the identity provider returns 404 after Glean reloads the directory. The caller must be able to read the workspace configuration or the workspace billing.

func (*Idpgroups) List added in v0.17.0

List IdP groups List the identity provider (IdP) groups that Glean loads from the directory, ordered by display_name and then by idp_group_id. Use idp_group_id to name a group in other Platform APIs, such as the usage limit evaluation and limit increase request APIs. Usage limits apply only to IdP groups from the datasource instance in usage_settings.user_grouping.idp_group_provider_instance of the get usage settings response, and this API always lists that instance's groups. To list only those groups, pass that value in a provider_instance filter of the filters parameter, for example `filters=[{"field":"provider_instance","operator":"EQUALS","values":["okta"]}]`, URL-encoded as `filters=%5B%7B%22field%22%3A%22provider_instance%22%2C%22operator%22%3A%22EQUALS%22%2C%22values%22%3A%5B%22okta%22%5D%7D%5D`. Send a provider filter to list only one provider's groups, and a name filter to list only the groups whose display_name contains a value. Internal O365 ownership groups and SharePoint groups are left out. The caller must be able to read the workspace configuration or the workspace billing.

type Indexing

type Indexing struct {
	Documents      *IndexingDocuments
	Permissions    *Permissions
	Datasource     *Datasource
	People         *People
	Datasources    *IndexingDatasources
	Authentication *IndexingAuthentication
	Shortcuts      *IndexingShortcuts
	CustomMetadata *CustomMetadata
	// contains filtered or unexported fields
}

type IndexingAuthentication

type IndexingAuthentication struct {
	// contains filtered or unexported fields
}

func (*IndexingAuthentication) RotateToken

RotateToken - Rotate token Rotates the secret value inside the Indexing API token and returns the new raw secret. All other properties of the token are unchanged. In order to rotate the secret value, include the token as the bearer token in the `/rotatetoken` request. Please refer to [Token rotation](https://developers.glean.com/indexing/authentication/token-rotation) documentation for more information.

type IndexingDatasources added in v0.11.29

type IndexingDatasources struct {
	// contains filtered or unexported fields
}

func (*IndexingDatasources) Add added in v0.11.29

Add or update datasource Add or update a custom datasource and its schema.

func (*IndexingDatasources) RetrieveConfig added in v0.11.29

RetrieveConfig - Get datasource config Fetches the datasource config for the specified custom datasource.

func (*IndexingDatasources) Submit added in v0.13.4

Submit datasource data Validates and asynchronously processes a datasource-specific submission.

type IndexingDocuments

type IndexingDocuments struct {
	// contains filtered or unexported fields
}

func (*IndexingDocuments) AddOrUpdate

AddOrUpdate - Index document Adds a document to the index or updates an existing document.

func (*IndexingDocuments) BulkIndex

BulkIndex - Bulk index documents Replaces the documents in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints.

func (*IndexingDocuments) CheckAccess

CheckAccess - Check document access Check if a given user has access to access a document in a custom datasource

Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/indexing/debugging/datasource-config) for more information.

func (*IndexingDocuments) Count deprecated

Count - Get document count Fetches document count for the specified custom datasource.

Tip: Use [/debug/{datasource}/status](https://developers.glean.com/indexing/debugging/datasource-status) for richer information.

Deprecated: Deprecated on 2026-02-03, removal scheduled for 2027-01-15: Endpoint is deprecated.

func (*IndexingDocuments) Debug

Debug - Beta: Get document information

Gives various information that would help in debugging related to a particular document. Currently in beta, might undergo breaking changes without prior notice.

Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/indexing/debugging/datasource-config) for more information.

func (*IndexingDocuments) DebugEvents added in v0.13.0

DebugEvents - Beta: Get document lifecycle events

Retrieves lifecycle events for a specific document including upload time, index times and deletions. Rate limited to 1 request per minute per datasource. Currently in beta, might undergo breaking changes without prior notice.

func (*IndexingDocuments) DebugMany

DebugMany - Beta: Get information of a batch of documents

Gives various information that would help in debugging related to a batch of documents. Currently in beta, might undergo breaking changes without prior notice.

Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/indexing/debugging/datasource-config) for more information.

func (*IndexingDocuments) Delete

Delete document Deletes the specified document from the index. Succeeds if document is not present.

func (*IndexingDocuments) Index

Index documents Adds or updates multiple documents in the index. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-indexing/choosing-indexdocuments-vs-bulkindexdocuments) documentation for an explanation of when to use this endpoint.

func (*IndexingDocuments) ProcessAll

ProcessAll - Schedules the processing of uploaded documents Schedules the immediate processing of documents uploaded through the indexing API. By default the uploaded documents will be processed asynchronously but this API can be used to schedule processing of all documents on demand.

If a `datasource` parameter is specified, processing is limited to that custom datasource. Without it, processing applies to all documents across all custom datasources. #### Rate Limits This endpoint is rate-limited to one usage every 3 hours. Exceeding this limit results in a 429 response code. Here's how the rate limit works: 1. Calling `/processalldocuments` for datasource `foo` prevents another call for `foo` for 3 hours. 2. Calling `/processalldocuments` for datasource `foo` doesn't affect immediate calls for `bar`. 3. Calling `/processalldocuments` for all datasources prevents any datasource calls for 3 hours. 4. Calling `/processalldocuments` for datasource `foo` doesn't affect immediate calls for all datasources.

For more frequent document processing, contact Glean support.

func (*IndexingDocuments) Status deprecated

Status - Get document upload and indexing status Intended for debugging/validation. Fetches the current upload and indexing status of documents.

Tip: Use [/debug/{datasource}/document](https://developers.glean.com/indexing/debugging/datasource-document) for richer information.

Deprecated: Deprecated on 2026-02-03, removal scheduled for 2027-01-15: Endpoint is deprecated.

type IndexingShortcuts

type IndexingShortcuts struct {
	// contains filtered or unexported fields
}

func (*IndexingShortcuts) BulkIndex

BulkIndex - Bulk index external shortcuts Replaces all the currently indexed shortcuts using paginated batch API calls. Note that this endpoint is used for indexing shortcuts not hosted by Glean. If you want to upload shortcuts that would be hosted by Glean, please use the `/uploadshortcuts` endpoint. For information on what you can do with Golinks, which are Glean-hosted shortcuts, please refer to [this](https://docs.glean.com/user-guide/knowledge/go-links/how-go-links-work) page.

func (*IndexingShortcuts) Upload

Upload shortcuts Creates glean shortcuts for uploaded shortcuts info. Glean would host the shortcuts, and they can be managed in the knowledge tab once uploaded.

type Insights

type Insights struct {
	// contains filtered or unexported fields
}

func (*Insights) Retrieve

func (s *Insights) Retrieve(ctx context.Context, insightsRequest components.InsightsRequest, locale *string, opts ...operations.Option) (*operations.InsightsResponse, error)

Retrieve - Get insights Gets the aggregate usage insights data displayed in the Insights Dashboards.

type Messages

type Messages struct {
	// contains filtered or unexported fields
}

func (*Messages) Retrieve

func (s *Messages) Retrieve(ctx context.Context, messagesRequest components.MessagesRequest, locale *string, opts ...operations.Option) (*operations.MessagesResponse, error)

Retrieve - Read messages Retrieves list of messages from messaging/chat datasources (e.g. Slack, Teams).

type Oauth added in v0.17.1

type Oauth struct {
	Clients *Clients
	// contains filtered or unexported fields
}

type People

type People struct {
	// contains filtered or unexported fields
}

func (*People) BulkIndex deprecated

BulkIndex - Bulk index employees Replaces all the currently indexed employees using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints.

Deprecated: Deprecated on 2026-02-03, removal scheduled for 2027-04-15: Endpoint is deprecated.

func (*People) BulkIndexTeams

BulkIndexTeams - Bulk index teams Replaces all the currently indexed teams using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints.

func (*People) Count deprecated

Count - Get user count Fetches user count for the specified custom datasource.

Tip: Use [/debug/{datasource}/status](https://developers.glean.com/indexing/debugging/datasource-status) for richer information.

Deprecated: Deprecated on 2026-02-03, removal scheduled for 2027-01-15: Endpoint is deprecated.

func (*People) Debug

Debug - Beta: Get user information

Gives various information that would help in debugging related to a particular user. Currently in beta, might undergo breaking changes without prior notice.

Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/indexing/debugging/datasource-config) for more information.

func (*People) Delete

Delete employee Delete an employee. Silently succeeds if employee is not present.

func (*People) DeleteTeam

DeleteTeam - Delete team Delete a team based on provided id.

func (*People) Index

Index employee Adds an employee or replaces the existing information about an employee.

func (*People) IndexTeam

IndexTeam - Index team Adds a team or updates information about a team

func (*People) ProcessAllEmployeesAndTeams

ProcessAllEmployeesAndTeams - Schedules the processing of uploaded employees and teams Schedules the immediate processing of employees and teams uploaded through the indexing API. By default all uploaded people data will be processed asynchronously but this API can be used to schedule its processing on demand.

type Permissions

type Permissions struct {
	// contains filtered or unexported fields
}

func (*Permissions) AuthorizeBetaUsers

AuthorizeBetaUsers - Beta users Allow the datasource be visible to the specified beta users. The default behaviour is datasource being visible to all users if it is enabled and not visible to any user if it is not enabled.

func (*Permissions) BulkIndexGroups

BulkIndexGroups - Bulk index groups Replaces the groups in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints. Note: Any groups deleted from the existing set will have their associated memberships deleted as well.

func (*Permissions) BulkIndexMemberships

BulkIndexMemberships - Bulk index memberships for a group Replaces the memberships for a group in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints.

func (*Permissions) BulkIndexUsers

BulkIndexUsers - Bulk index users Replaces the users in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints. Note: Any users deleted from the existing set will have their associated memberships deleted as well.

func (*Permissions) DeleteGroup

DeleteGroup - Delete group Delete group from the datasource. Silently succeeds if group is not present. Note: All memberships associated with the deleted group will also be deleted.

func (*Permissions) DeleteMembership

DeleteMembership - Delete membership Delete membership to a group in the specified datasource. Silently succeeds if membership is not present.

func (*Permissions) DeleteUser

DeleteUser - Delete user Delete the user from the datasource. Silently succeeds if user is not present. Note: All memberships associated with the deleted user will also be deleted.

func (*Permissions) IndexGroup

IndexGroup - Index group Add or update a group in the datasource.

func (*Permissions) IndexMembership

IndexMembership - Index membership Add the memberships of a group in the datasource.

func (*Permissions) IndexUser

IndexUser - Index user Adds a datasource user or updates an existing user.

func (*Permissions) ProcessMemberships

ProcessMemberships - Schedules the processing of group memberships Schedules the immediate processing of all group memberships uploaded through the indexing API. By default the uploaded group memberships will be processed asynchronously but this API can be used to schedule processing of all memberships on demand.

func (*Permissions) UpdatePermissions

UpdatePermissions - Update document permissions Updates the permissions for a given document without modifying document content.

type Pins

type Pins struct {
	// contains filtered or unexported fields
}

func (*Pins) Create

func (s *Pins) Create(ctx context.Context, pinRequest components.PinRequest, locale *string, opts ...operations.Option) (*operations.PinResponse, error)

Create pin Pin a document as a result for a given search query.Pin results that are known to be a good match.

func (*Pins) List

func (s *Pins) List(ctx context.Context, requestBody operations.ListpinsRequestBody, locale *string, opts ...operations.Option) (*operations.ListpinsResponse, error)

List pins Lists all pins.

func (*Pins) Remove

func (s *Pins) Remove(ctx context.Context, unpin components.Unpin, locale *string, opts ...operations.Option) (*operations.UnpinResponse, error)

Remove - Delete pin Unpin a previously pinned result.

func (*Pins) Retrieve

func (s *Pins) Retrieve(ctx context.Context, getPinRequest components.GetPinRequest, locale *string, opts ...operations.Option) (*operations.GetpinResponse, error)

Retrieve - Read pin Read pin details given its ID.

func (*Pins) Update

func (s *Pins) Update(ctx context.Context, editPinRequest components.EditPinRequest, locale *string, opts ...operations.Option) (*operations.EditpinResponse, error)

Update pin Update an existing user-generated pin.

type Policies

type Policies struct {
	// contains filtered or unexported fields
}

func (*Policies) Create

Create - Creates new policy Creates a new policy with specified specifications and returns its id.

func (*Policies) Download

Download - Downloads violations CSV for policy Downloads CSV violations report for a specific policy id. This does not support continuous policies.

func (*Policies) List

func (s *Policies) List(ctx context.Context, autoHide *bool, frequency *string, opts ...operations.Option) (*operations.ListpoliciesResponse, error)

List - Lists policies Lists policies with filtering.

func (*Policies) Retrieve

func (s *Policies) Retrieve(ctx context.Context, id string, version *int64, opts ...operations.Option) (*operations.GetpolicyResponse, error)

Retrieve - Gets specified policy Fetches the specified policy version, or the latest if no version is provided.

func (*Policies) Update

func (s *Policies) Update(ctx context.Context, id string, updateDlpReportRequest components.UpdateDlpReportRequest, opts ...operations.Option) (*operations.UpdatepolicyResponse, error)

Update - Updates an existing policy Updates an existing policy.

type Reports

type Reports struct {
	// contains filtered or unexported fields
}

func (*Reports) Create

Create - Creates new one-time report Creates a new one-time report and executes its batch job.

func (*Reports) Download

Download - Downloads violations CSV for report Downloads CSV violations report for a specific report id.

func (*Reports) Status

Status - Fetches report run status Fetches the status of the run corresponding to the report-id.

type SDKOption

type SDKOption func(*Glean)

func WithClient

func WithClient(client HTTPClient) SDKOption

WithClient allows the overriding of the default HTTP client used by the SDK

func WithExcludeDeprecatedAfter added in v0.11.21

func WithExcludeDeprecatedAfter(date string) SDKOption

WithExcludeDeprecatedAfter configures the SDK to exclude API endpoints that will be deprecated after the specified date. This is useful for testing your integration against upcoming deprecations.

Format: YYYY-MM-DD (e.g., "2026-10-15")

This can also be set via the X_GLEAN_EXCLUDE_DEPRECATED_AFTER environment variable. Environment variables take precedence over SDK options.

More information: https://developers.glean.com/deprecations/overview

func WithIncludeExperimental added in v0.11.21

func WithIncludeExperimental(enabled bool) SDKOption

WithIncludeExperimental configures the SDK to enable experimental API features that are not yet generally available. Use this to preview and test new functionality.

Warning: Experimental features may change or be removed without notice. Do not rely on experimental features in production environments.

This can also be set via the X_GLEAN_INCLUDE_EXPERIMENTAL environment variable. Environment variables take precedence over SDK options.

func WithInstance

func WithInstance(instance string) SDKOption

WithInstance allows setting the instance variable for url substitution

func WithRetryConfig

func WithRetryConfig(retryConfig retry.Config) SDKOption

func WithSecurity

func WithSecurity(apiToken string) SDKOption

WithSecurity configures the SDK to use the provided security details

func WithSecuritySource

func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption

WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication

func WithServerIndex

func WithServerIndex(serverIndex int) SDKOption

WithServerIndex allows the overriding of the default server by index

func WithServerURL

func WithServerURL(serverURL string) SDKOption

WithServerURL allows providing an alternative server URL

func WithTemplatedServerURL

func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption

WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters

func WithTimeout

func WithTimeout(timeout time.Duration) SDKOption

WithTimeout Optional request timeout applied to each operation

type Search struct {
	// contains filtered or unexported fields
}

func (*Search) ListFilters added in v0.13.5

func (s *Search) ListFilters(ctx context.Context, datasources []string, query *string, opts ...operations.Option) (*operations.PlatformSearchFiltersResponse, error)

ListFilters - List search filters List datasources and common built-in filter fields visible to the authenticated user. This is a best-effort catalog, not an exhaustive list of every filter search accepts. Without `query`, returns field metadata only and does not run a search. With a nonblank `query`, provide exactly one `datasources` value to request suggested filter values for that query; no documents are returned and this endpoint does not include warning objects. See `FilterFieldInfo.values` for limitations on suggested values. Rate-limited requests return HTTP 429 with `Retry-After`; temporary backend unavailability returns HTTP 503.

func (*Search) Query

Query - Search Search your organization's connected content and return ranked document results with cursor pagination. Use `GET /api/search/filters` to discover datasource identifiers and common filter fields. Built-in filter names are validated; other field names are accepted as custom filters and behavior depends on your Glean configuration and connected sources. Errors: HTTP 422 `unprocessable_query` returns no `results` or `next_cursor`. See `warnings` on the response for non-blocking issues such as partially available results. Not every query issue produces a warning or error.

type Skills added in v0.13.4

type Skills struct {
	// contains filtered or unexported fields
}

func (*Skills) Create added in v0.13.4

Create skill Create a skill from an uploaded SKILL.md, .zip, or .skill bundle. If the authenticated user already has a skill with the same name, the existing skill is superseded with a new version, unless it is source-managed: a same-name create over a GitHub-imported skill returns 409, and the caller syncs the existing skill instead. Two concurrent same-name creates can still produce two skills.

func (*Skills) CreateVersion added in v0.13.4

func (s *Skills) CreateVersion(ctx context.Context, skillID string, platformSkillVersionCreateRequest components.PlatformSkillVersionCreateRequest, opts ...operations.Option) (*operations.PlatformSkillsCreateVersionResponse, error)

CreateVersion - Create skill version Create a new immutable version for an existing caller-managed skill from an uploaded SKILL.md, .zip, or .skill bundle. A create-version over a GitHub-imported skill returns 409, and the caller syncs the existing skill instead.

func (*Skills) Delete added in v0.13.5

Delete skill Delete a skill the authenticated caller is allowed to manage. This operation permanently removes all versions of the skill.

func (*Skills) Import added in v0.13.5

Import skills from GitHub Import one or more skills selected from a GitHub source preview. Each source URL is fetched and persisted as an independent skill with source provenance. This operation does not create a durable source resource. The import is atomic: if any source cannot be fetched, validated, or persisted, no skills are created.

func (*Skills) List added in v0.13.4

func (s *Skills) List(ctx context.Context, pageSize *int64, cursor *string, opts ...operations.Option) (*operations.PlatformSkillsListResponse, error)

List skills List every custom skill the authenticated caller can access. Built-in skills are excluded: they have no versions, content download, update, or delete, so their identifiers would fail most skill operations. Chat-authored skills shared with the caller without a listed grant are omitted: they stay retrievable by identifier when it is known, but this list does not discover them.

func (*Skills) ListVersions added in v0.13.4

func (s *Skills) ListVersions(ctx context.Context, skillID string, pageSize *int64, cursor *string, opts ...operations.Option) (*operations.PlatformSkillsListVersionsResponse, error)

ListVersions - List skill versions List versions for a skill available to the authenticated user.

func (*Skills) PreviewSource added in v0.13.5

PreviewSource - Preview a GitHub skill source Inspect a GitHub URL without persisting a source or any discovered skills. Set stream to true to receive repository scan progress as server-sent events; otherwise the response contains the completed preview.

func (*Skills) PreviewSourceStream added in v0.16.0

PreviewSourceStream - Preview a GitHub skill source as events SDK-only logical operation. HTTP clients must call the base path; the URL fragment is not sent. Inspect a GitHub URL as server-sent events. HTTP clients request this mode by setting `stream` to true in the JSON body.

func (*Skills) Retrieve added in v0.13.4

func (s *Skills) Retrieve(ctx context.Context, skillID string, opts ...operations.Option) (*operations.PlatformSkillsGetResponse, error)

Retrieve skill Retrieve metadata for a skill available to the authenticated user.

func (*Skills) RetrieveContent added in v0.13.4

func (s *Skills) RetrieveContent(ctx context.Context, skillID string, opts ...operations.Option) (*operations.PlatformSkillsGetContentResponse, error)

RetrieveContent - Download skill content Download the latest installable bundle for a skill available to the authenticated user.

func (*Skills) RetrieveVersion added in v0.13.4

func (s *Skills) RetrieveVersion(ctx context.Context, skillID string, version int64, opts ...operations.Option) (*operations.PlatformSkillsGetVersionResponse, error)

RetrieveVersion - Retrieve skill version Retrieve metadata for a skill version available to the authenticated user.

func (*Skills) RetrieveVersionContent added in v0.13.4

func (s *Skills) RetrieveVersionContent(ctx context.Context, skillID string, version int64, opts ...operations.Option) (*operations.PlatformSkillsGetVersionContentResponse, error)

RetrieveVersionContent - Download skill version content Download the installable bundle for a skill version available to the authenticated user.

func (*Skills) Sync added in v0.13.5

Sync a GitHub-imported skill Refresh one GitHub-imported skill from its stored source URL. If the skill content has changed, this operation creates a new skill version. If the skill is no longer present upstream, the stored skill is left unchanged and must be deleted explicitly.

func (*Skills) Update added in v0.13.5

func (s *Skills) Update(ctx context.Context, skillID string, platformSkillUpdateRequest components.PlatformSkillUpdateRequest, opts ...operations.Option) (*operations.PlatformSkillsUpdateResponse, error)

Update skill Enable or disable the skill for the authenticated caller without changing its content. The owner's update sets the skill's stored status. Any other caller's update applies only to that caller.

func (*Skills) Validate added in v0.13.4

Validate skill bundle Validate a skill bundle without persisting it. Accepts a SKILL.md, .zip, or .skill upload and returns parsed metadata plus the normalized file layout.

type Tools added in v0.4.3

type Tools struct {
	// contains filtered or unexported fields
}

func (*Tools) AuthorizeActionPack added in v0.12.0

func (s *Tools) AuthorizeActionPack(ctx context.Context, actionPackID string, authorizeActionPackRequest components.AuthorizeActionPackRequest, opts ...operations.Option) (*operations.AuthorizeActionPackResponse, error)

AuthorizeActionPack - Start the OAuth authorization flow for an action pack. Starts the third-party OAuth flow for the specified action pack and returns the redirect URL that the client should navigate the end user to. After the OAuth callback completes, the user's browser is redirected back to `returnUrl` with a status query parameter (`?glean_action_auth=success|error&actionPackId=...`).

`returnUrl` must match the tenant's configured return URL allowlist; otherwise the request is rejected with 400.

func (*Tools) AuthorizeToolServer added in v0.13.2

func (s *Tools) AuthorizeToolServer(ctx context.Context, serverID string, authorizeToolServerRequest components.AuthorizeToolServerRequest, opts ...operations.Option) (*operations.AuthorizeToolServerResponse, error)

AuthorizeToolServer - Start the OAuth authorization flow for a tool server. Initiates the third-party OAuth flow for the specified tool server and returns the authorization URL that the client should navigate the end user to. After the OAuth callback completes, the user's browser is redirected back to `returnUrl` with query parameters indicating the result.

`returnUrl` must match the tenant's configured return URL allowlist; otherwise the request is rejected with 400.

func (*Tools) GetToolServerTools added in v0.13.5

func (s *Tools) GetToolServerTools(ctx context.Context, serverID string, toolNames []string, opts ...operations.Option) (*operations.GetToolServerToolsResponse, error)

GetToolServerTools - Get tool definitions from a tool server. Returns the name, description and JSON input schema for the named tools on the specified tool server. Works for Glean's built-in tools, tool packs and MCP servers.

`toolNames` is required. Names that do not exist on the server are returned in `notFound` rather than failing the request, so a single bad name does not force callers into one-at-a-time retries. Matching is case-insensitive and treats `-` and `_` as equivalent.

Use `serverId=native` for Glean's built-in tools.

func (*Tools) List added in v0.4.3

List available tools Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned.

func (*Tools) RetrieveActionPackAuthStatus added in v0.13.0

func (s *Tools) RetrieveActionPackAuthStatus(ctx context.Context, actionPackID string, opts ...operations.Option) (*operations.GetActionPackAuthStatusResponse, error)

RetrieveActionPackAuthStatus - Get end-user authentication status for an action pack. Reports whether the calling user is already authenticated against the third-party tool backing the specified action pack. Intended for headless / server-driven clients that render an "Authorize" prompt when the user has not yet consented to the tool.

func (*Tools) RetrieveToolServerAuthStatus added in v0.13.2

func (s *Tools) RetrieveToolServerAuthStatus(ctx context.Context, serverID string, opts ...operations.Option) (*operations.GetToolServerAuthStatusResponse, error)

RetrieveToolServerAuthStatus - Get end-user authentication status for a tool server. Returns display information and the calling user's current authentication status for the specified tool server.

func (*Tools) Run added in v0.4.3

Run - Execute the specified tool Execute the specified tool with provided parameters

type Triggers added in v0.14.0

type Triggers struct {
	// contains filtered or unexported fields
}

func (*Triggers) Create added in v0.14.0

Create trigger Create a trigger from a preset and return it with its signing secret.

func (*Triggers) Delete added in v0.14.0

Delete trigger Delete a trigger.

func (*Triggers) Get added in v0.14.0

Get trigger Retrieve a trigger owned by the authenticated caller.

func (*Triggers) GetPreset added in v0.14.0

GetPreset - Get trigger preset Retrieve a single trigger preset by id.

func (*Triggers) List added in v0.14.0

func (s *Triggers) List(ctx context.Context, pageSize *int64, cursor *string, opts ...operations.Option) (*operations.PlatformTriggersListResponse, error)

List triggers List triggers owned by the authenticated caller.

func (*Triggers) ListPresetInputValues added in v0.14.0

func (s *Triggers) ListPresetInputValues(ctx context.Context, presetID string, field string, query *string, opts ...operations.Option) (*operations.PlatformTriggerPresetsInputValuesListResponse, error)

ListPresetInputValues - Search trigger preset input values Return up to 300 selectable values for a single picklist input on a preset. Results are intended for typeahead selection and are not cursor-paginated. When `is_truncated` is true, refine `query` to narrow the result set.

func (*Triggers) ListPresets added in v0.14.0

func (s *Triggers) ListPresets(ctx context.Context, datasource *string, pageSize *int64, cursor *string, opts ...operations.Option) (*operations.PlatformTriggerPresetsListResponse, error)

ListPresets - List trigger presets List the trigger presets available to the caller. A preset is a curated content-trigger template (e.g. a new Jira ticket) which is passed when creating a trigger.

func (*Triggers) SearchEvents added in v0.14.0

func (s *Triggers) SearchEvents(ctx context.Context, triggerID string, platformTriggerEventSearchRequest *components.PlatformTriggerEventSearchRequest, opts ...operations.Option) (*operations.PlatformTriggersEventsSearchResponse, error)

SearchEvents - Search events for a trigger Search recent content events an existing trigger matches. Read-only — no webhook delivery is made. Covers the last seven days.

func (*Triggers) SearchPresetEvents added in v0.14.0

func (s *Triggers) SearchPresetEvents(ctx context.Context, presetID string, platformTriggerPresetEventSearchRequest *components.PlatformTriggerPresetEventSearchRequest, opts ...operations.Option) (*operations.PlatformTriggerPresetsEventsSearchResponse, error)

SearchPresetEvents - Search events for a trigger preset Search recent content events an unsaved trigger built from this preset would match, to preview it before creating the trigger. Read-only — no trigger is created and no webhook delivery is made. Covers the last seven days.

func (*Triggers) Update added in v0.14.0

func (s *Triggers) Update(ctx context.Context, triggerID string, platformTriggerUpdateRequest components.PlatformTriggerUpdateRequest, opts ...operations.Option) (*operations.PlatformTriggersUpdateResponse, error)

Update trigger Update a trigger.

type Users added in v0.17.0

type Users struct {
	// contains filtered or unexported fields
}

func (*Users) Get added in v0.17.1

Get user Get one user in the Glean directory by user_id. The user can be any person that the list returns. A user_id that is not in the directory returns 404 resource_not_found. This includes a deleted user and a person that the People directory does not show. An alias ID of a merged person returns the person's canonical user_id.

func (*Users) List added in v0.17.0

List users List the users in the Glean directory, ordered by display_name and then by user_id. The list includes the same people as the Glean People directory. Filter by name, email, manager_id, or department_id to find specific users. Use the returned user_id values with other Platform APIs, for example as usage limit targets.

type Verification

type Verification struct {
	// contains filtered or unexported fields
}

func (*Verification) AddReminder

AddReminder - Create verification Creates a verification reminder for the document. Users can create verification reminders from different product surfaces.

func (*Verification) List

List verifications Returns the information to be rendered in verification dashboard. Includes information for each document owned by user regarding their verifications.

func (*Verification) Verify

func (s *Verification) Verify(ctx context.Context, verifyRequest components.VerifyRequest, locale *string, opts ...operations.Option) (*operations.VerifyResponse, error)

Verify - Update verification Verify documents to keep the knowledge up to date within customer corpus.

type Visibilityoverrides

type Visibilityoverrides struct {
	// contains filtered or unexported fields
}

func (*Visibilityoverrides) Create

Create - Hide or unhide docs Sets the visibility-override state of the documents specified, effectively hiding or un-hiding documents.

func (*Visibilityoverrides) List

List - Fetches documents visibility Fetches the visibility override status of the documents passed.

Directories

Path Synopsis
internal
models

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL