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.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN"),
) as glean:
res = glean.admin.oauth.clients.list(page_size=50)
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
page_size |
Optional[int] | ➖ | Maximum number of clients to return. Defaults to 50. Maximum is 100. |
cursor |
Optional[str] | ➖ | Opaque pagination cursor from a previous response. Send the same filters that the previous request used. |
filters |
List[models.PlatformOAuthClientFilter] | ➖ | JSON-encoded filters that choose which clients are returned. The supported fields are is_enabled, name, client_id, usage_client_id, has_ai_gateway, and supported_app, with the operator EQUALS. Multiple values OR within a filter. Multiple filters AND together. Each field can appear in only one filter. Without an is_enabled filter, only enabled clients are returned. To return enabled and disabled clients, send [{"field":"is_enabled","values":["true","false"]}]. To find the Claude Code clients, send [{"field":"supported_app","values":["CLAUDE_CODE"]}]. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.PlatformListOAuthClientsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json |
| errors.PlatformProblemDetailError | 500, 503 | application/problem+json |
| errors.GleanError | 4XX, 5XX | */* |
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.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN"),
) as glean:
res = glean.admin.oauth.clients.get(client_id="{client_id}")
# Handle response
print(res)| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
client_id |
str | ✔️ | The OAuth client_id of the client. | {client_id} |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.PlatformGetOAuthClientResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json |
| errors.PlatformProblemDetailError | 500, 503 | application/problem+json |
| errors.GleanError | 4XX, 5XX | */* |