-
Debug - Beta: Get user information
-
Count- Get user count⚠️ Deprecated -
Index - Index employee
-
BulkIndex- Bulk index employees⚠️ Deprecated -
ProcessAllEmployeesAndTeams - Schedules the processing of uploaded employees and teams
-
Delete - Delete employee
-
IndexTeam - Index team
-
DeleteTeam - Delete team
-
BulkIndexTeams - Bulk index teams
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 for more information.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"github.com/gleanwork/api-client-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Indexing.People.Debug(ctx, "<value>", components.DebugUserRequest{
Email: "u1@foo.com",
})
if err != nil {
log.Fatal(err)
}
if res.DebugUserResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
datasource |
string |
✔️ | The datasource to which the user belongs |
debugUserRequest |
components.DebugUserRequest | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1DebugDatasourceUserResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Fetches user count for the specified custom datasource.
Tip: Use /debug/{datasource}/status for richer information.
⚠️ DEPRECATED: Deprecated on 2026-02-03, removal scheduled for 2026-10-15: Endpoint is deprecated.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"github.com/gleanwork/api-client-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Indexing.People.Count(ctx, components.GetUserCountRequest{
Datasource: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.GetUserCountResponse != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.GetUserCountRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1GetusercountResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Adds an employee or replaces the existing information about an employee.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"github.com/gleanwork/api-client-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Indexing.People.Index(ctx, components.IndexEmployeeRequest{
Employee: components.EmployeeInfoDefinition{
Email: "Jerrold_Hermann@hotmail.com",
Department: "<value>",
DatasourceProfiles: []components.DatasourceProfile{
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.IndexEmployeeRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1IndexemployeeResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Replaces all the currently indexed employees using paginated batch API calls. Please refer to the bulk indexing documentation for an explanation of how to use bulk endpoints.
⚠️ DEPRECATED: Deprecated on 2026-02-03, removal scheduled for 2026-10-15: Endpoint is deprecated.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"github.com/gleanwork/api-client-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Indexing.People.BulkIndex(ctx, components.BulkIndexEmployeesRequest{
UploadID: "<id>",
Employees: []components.EmployeeInfoDefinition{
components.EmployeeInfoDefinition{
Email: "Robin.Stoltenberg@yahoo.com",
Department: "<value>",
DatasourceProfiles: []components.DatasourceProfile{
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
},
},
components.EmployeeInfoDefinition{
Email: "Robin.Stoltenberg@yahoo.com",
Department: "<value>",
DatasourceProfiles: []components.DatasourceProfile{
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
},
},
components.EmployeeInfoDefinition{
Email: "Robin.Stoltenberg@yahoo.com",
Department: "<value>",
DatasourceProfiles: []components.DatasourceProfile{
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
},
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.BulkIndexEmployeesRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1BulkindexemployeesResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
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.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Indexing.People.ProcessAllEmployeesAndTeams(ctx)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1ProcessallemployeesandteamsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Delete an employee. Silently succeeds if employee is not present.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"github.com/gleanwork/api-client-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Indexing.People.Delete(ctx, components.DeleteEmployeeRequest{
EmployeeEmail: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.DeleteEmployeeRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1DeleteemployeeResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Adds a team or updates information about a team
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"github.com/gleanwork/api-client-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Indexing.People.IndexTeam(ctx, components.IndexTeamRequest{
Team: components.TeamInfoDefinition{
ID: "<id>",
Name: "<value>",
DatasourceProfiles: []components.DatasourceProfile{
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
},
Members: []components.TeamMember{
components.TeamMember{
Email: "Nasir.Hilll73@hotmail.com",
},
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.IndexTeamRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1IndexteamResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Delete a team based on provided id.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"github.com/gleanwork/api-client-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Indexing.People.DeleteTeam(ctx, components.DeleteTeamRequest{
ID: "<id>",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.DeleteTeamRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1DeleteteamResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |
Replaces all the currently indexed teams using paginated batch API calls. Please refer to the bulk indexing documentation for an explanation of how to use bulk endpoints.
package main
import(
"context"
"os"
apiclientgo "github.com/gleanwork/api-client-go"
"github.com/gleanwork/api-client-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := apiclientgo.New(
apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
)
res, err := s.Indexing.People.BulkIndexTeams(ctx, components.BulkIndexTeamsRequest{
UploadID: "<id>",
Teams: []components.TeamInfoDefinition{
components.TeamInfoDefinition{
ID: "<id>",
Name: "<value>",
DatasourceProfiles: []components.DatasourceProfile{
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
},
Members: []components.TeamMember{},
},
components.TeamInfoDefinition{
ID: "<id>",
Name: "<value>",
DatasourceProfiles: []components.DatasourceProfile{
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
},
Members: []components.TeamMember{},
},
components.TeamInfoDefinition{
ID: "<id>",
Name: "<value>",
DatasourceProfiles: []components.DatasourceProfile{
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
components.DatasourceProfile{
Datasource: "github",
Handle: "<value>",
},
},
Members: []components.TeamMember{},
},
},
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
components.BulkIndexTeamsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PostAPIIndexV1BulkindexteamsResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.APIError | 4XX, 5XX | */* |