-
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 hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.DebugUserRequest;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DebugDatasourceUserResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PostApiIndexV1DebugDatasourceUserResponse res = sdk.indexing().people().debug()
.datasource("<value>")
.debugUserRequest(DebugUserRequest.builder()
.email("u1@foo.com")
.build())
.call();
if (res.debugUserResponse().isPresent()) {
System.out.println(res.debugUserResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
datasource |
String | ✔️ | The datasource to which the user belongs |
debugUserRequest |
DebugUserRequest | ✔️ | N/A |
PostApiIndexV1DebugDatasourceUserResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 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 hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.GetUserCountRequest;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1GetusercountResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
GetUserCountRequest req = GetUserCountRequest.builder()
.datasource("<value>")
.build();
PostApiIndexV1GetusercountResponse res = sdk.indexing().people().count()
.request(req)
.call();
if (res.getUserCountResponse().isPresent()) {
System.out.println(res.getUserCountResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
request |
GetUserCountRequest | ✔️ | The request object to use for the request. |
PostApiIndexV1GetusercountResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
Adds an employee or replaces the existing information about an employee.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.*;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexemployeeResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
IndexEmployeeRequest req = IndexEmployeeRequest.builder()
.employee(EmployeeInfoDefinition.builder()
.email("Jerrold_Hermann@hotmail.com")
.department("<value>")
.datasourceProfiles(List.of(
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build()))
.build())
.build();
PostApiIndexV1IndexemployeeResponse res = sdk.indexing().people().index()
.request(req)
.call();
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
request |
IndexEmployeeRequest | ✔️ | The request object to use for the request. |
PostApiIndexV1IndexemployeeResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 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 hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.*;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexemployeesResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
BulkIndexEmployeesRequest req = BulkIndexEmployeesRequest.builder()
.uploadId("<id>")
.employees(List.of(
EmployeeInfoDefinition.builder()
.email("Robin.Stoltenberg@yahoo.com")
.department("<value>")
.datasourceProfiles(List.of(
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build()))
.build(),
EmployeeInfoDefinition.builder()
.email("Robin.Stoltenberg@yahoo.com")
.department("<value>")
.datasourceProfiles(List.of(
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build()))
.build(),
EmployeeInfoDefinition.builder()
.email("Robin.Stoltenberg@yahoo.com")
.department("<value>")
.datasourceProfiles(List.of(
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build()))
.build()))
.build();
PostApiIndexV1BulkindexemployeesResponse res = sdk.indexing().people().bulkIndex()
.request(req)
.call();
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
request |
BulkIndexEmployeesRequest | ✔️ | The request object to use for the request. |
PostApiIndexV1BulkindexemployeesResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 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 hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1ProcessallemployeesandteamsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
PostApiIndexV1ProcessallemployeesandteamsResponse res = sdk.indexing().people().processAllEmployeesAndTeams()
.call();
// handle response
}
}PostApiIndexV1ProcessallemployeesandteamsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
Delete an employee. Silently succeeds if employee is not present.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.DeleteEmployeeRequest;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DeleteemployeeResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
DeleteEmployeeRequest req = DeleteEmployeeRequest.builder()
.employeeEmail("<value>")
.build();
PostApiIndexV1DeleteemployeeResponse res = sdk.indexing().people().delete()
.request(req)
.call();
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
request |
DeleteEmployeeRequest | ✔️ | The request object to use for the request. |
PostApiIndexV1DeleteemployeeResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
Adds a team or updates information about a team
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.*;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1IndexteamResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
IndexTeamRequest req = IndexTeamRequest.builder()
.team(TeamInfoDefinition.builder()
.id("<id>")
.name("<value>")
.members(List.of(
TeamMember.builder()
.email("Nasir.Hilll73@hotmail.com")
.build()))
.datasourceProfiles(List.of(
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build(),
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build(),
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build()))
.build())
.build();
PostApiIndexV1IndexteamResponse res = sdk.indexing().people().indexTeam()
.request(req)
.call();
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
request |
IndexTeamRequest | ✔️ | The request object to use for the request. |
PostApiIndexV1IndexteamResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
Delete a team based on provided id.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.DeleteTeamRequest;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1DeleteteamResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
DeleteTeamRequest req = DeleteTeamRequest.builder()
.id("<id>")
.build();
PostApiIndexV1DeleteteamResponse res = sdk.indexing().people().deleteTeam()
.request(req)
.call();
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
request |
DeleteTeamRequest | ✔️ | The request object to use for the request. |
PostApiIndexV1DeleteteamResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 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 hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.*;
import com.glean.api_client.glean_api_client.models.operations.PostApiIndexV1BulkindexteamsResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
BulkIndexTeamsRequest req = BulkIndexTeamsRequest.builder()
.uploadId("<id>")
.teams(List.of(
TeamInfoDefinition.builder()
.id("<id>")
.name("<value>")
.members(List.of())
.datasourceProfiles(List.of(
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build(),
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build()))
.build(),
TeamInfoDefinition.builder()
.id("<id>")
.name("<value>")
.members(List.of())
.datasourceProfiles(List.of(
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build(),
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build()))
.build(),
TeamInfoDefinition.builder()
.id("<id>")
.name("<value>")
.members(List.of())
.datasourceProfiles(List.of(
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build(),
DatasourceProfile.builder()
.datasource("github")
.handle("<value>")
.build()))
.build()))
.build();
PostApiIndexV1BulkindexteamsResponse res = sdk.indexing().people().bulkIndexTeams()
.request(req)
.call();
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
request |
BulkIndexTeamsRequest | ✔️ | The request object to use for the request. |
PostApiIndexV1BulkindexteamsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |