-
debug - Beta: Get user information
-
count- Get user count⚠️ Deprecated -
index - Index employee
-
bulk_index- Bulk index employees⚠️ Deprecated -
process_all_employees_and_teams - Schedules the processing of uploaded employees and teams
-
delete - Delete employee
-
index_team - Index team
-
delete_team - Delete team
-
bulk_index_teams - 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.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.indexing.people.debug(datasource="<value>", email="u1@foo.com")
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
datasource |
str | ✔️ | The datasource to which the user belongs | |
email |
str | ✔️ | Email ID of the user to get the status for | u1@foo.com |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GleanError | 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.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.indexing.people.count(datasource="<value>")
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
datasource |
str | ✔️ | Datasource name for which user count is needed. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GleanError | 4XX, 5XX | */* |
Adds an employee or replaces the existing information about an employee.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.people.index(employee={
"email": "Jerrold_Hermann@hotmail.com",
"department": "<value>",
"datasource_profiles": [
{
"datasource": "github",
"handle": "<value>",
},
],
})
# Use the SDK ...| Parameter | Type | Required | Description |
|---|---|---|---|
employee |
models.EmployeeInfoDefinition | ✔️ | Describes employee info |
version |
Optional[int] | ➖ | Version number for the employee object. If absent or 0 then no version checks are done |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GleanError | 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.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.people.bulk_index(upload_id="<id>", employees=[
{
"email": "Robin.Stoltenberg@yahoo.com",
"department": "<value>",
"datasource_profiles": [
{
"datasource": "github",
"handle": "<value>",
},
],
},
])
# Use the SDK ...| Parameter | Type | Required | Description |
|---|---|---|---|
upload_id |
str | ✔️ | Unique id that must be used for this bulk upload instance |
employees |
List[models.EmployeeInfoDefinition] | ✔️ | Batch of employee information |
is_first_page |
Optional[bool] | ➖ | true if this is the first page of the upload. Defaults to false |
is_last_page |
Optional[bool] | ➖ | true if this is the last page of the upload. Defaults to false |
force_restart_upload |
Optional[bool] | ➖ | Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true |
disable_stale_data_deletion_check |
Optional[bool] | ➖ | True if older employee data needs to be force deleted after the upload completes. Defaults to older data being deleted only if the percentage of data being deleted is less than 20%. This must only be set when isLastPage = true |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GleanError | 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.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.people.process_all_employees_and_teams()
# Use the SDK ...| Parameter | Type | Required | Description |
|---|---|---|---|
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GleanError | 4XX, 5XX | */* |
Delete an employee. Silently succeeds if employee is not present.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.people.delete(employee_email="<value>")
# Use the SDK ...| Parameter | Type | Required | Description |
|---|---|---|---|
employee_email |
str | ✔️ | The deleted employee's email |
version |
Optional[int] | ➖ | Version number for document for optimistic concurrency control. If absent or 0 then no version checks are done. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GleanError | 4XX, 5XX | */* |
Adds a team or updates information about a team
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.people.index_team(team={
"id": "<id>",
"name": "<value>",
"datasource_profiles": [
{
"datasource": "github",
"handle": "<value>",
},
],
"members": [
{
"email": "Valerie9@gmail.com",
},
],
})
# Use the SDK ...| Parameter | Type | Required | Description |
|---|---|---|---|
team |
models.TeamInfoDefinition | ✔️ | Information about an employee's team |
version |
Optional[int] | ➖ | Version number for the team object. If absent or 0 then no version checks are done |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GleanError | 4XX, 5XX | */* |
Delete a team based on provided id.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.people.delete_team(id="<id>")
# Use the SDK ...| Parameter | Type | Required | Description |
|---|---|---|---|
id |
str | ✔️ | The deleted team's id |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GleanError | 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.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
glean.indexing.people.bulk_index_teams(upload_id="<id>", teams=[
{
"id": "<id>",
"name": "<value>",
"datasource_profiles": [
{
"datasource": "github",
"handle": "<value>",
},
],
"members": [
{
"email": "Nina_Erdman16@gmail.com",
},
],
},
])
# Use the SDK ...| Parameter | Type | Required | Description |
|---|---|---|---|
upload_id |
str | ✔️ | Unique id that must be used for this bulk upload instance |
teams |
List[models.TeamInfoDefinition] | ✔️ | Batch of team information |
is_first_page |
Optional[bool] | ➖ | true if this is the first page of the upload. Defaults to false |
is_last_page |
Optional[bool] | ➖ | true if this is the last page of the upload. Defaults to false |
force_restart_upload |
Optional[bool] | ➖ | Flag to discard previous upload attempts and start from scratch. Must be specified with isFirstPage=true |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GleanError | 4XX, 5XX | */* |