Skip to content

Latest commit

 

History

History
116 lines (79 loc) · 16.3 KB

README.md

File metadata and controls

116 lines (79 loc) · 16.3 KB

Admin.Oauth.Clients

Overview

Available Operations

  • list - List OAuth clients
  • get - Get an OAuth client

list

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.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformAdminOauthClientsListResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws PlatformProblemDetailException, Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        PlatformAdminOauthClientsListResponse res = sdk.admin().oauth().clients().list()
                .pageSize(50L)
                .call();

        if (res.platformListOAuthClientsResponse().isPresent()) {
            System.out.println(res.platformListOAuthClientsResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
pageSize Optional<Long> ➖ Maximum number of clients to return. Defaults to 50. Maximum is 100.
cursor Optional<String> ➖ Opaque pagination cursor from a previous response. Send the same filters that the previous request used.
filters List<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"]}].

Response

PlatformAdminOauthClientsListResponse

Errors

Error Type Status Code Content Type
models/errors/PlatformProblemDetailException 400, 401, 403, 404, 408, 429 application/problem+json
models/errors/PlatformProblemDetailException 500, 503 application/problem+json
models/errors/APIException 4XX, 5XX */*

get

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.

Example Usage

package hello.world;

import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.errors.PlatformProblemDetailException;
import com.glean.api_client.glean_api_client.models.operations.PlatformAdminOauthClientsGetResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws PlatformProblemDetailException, Exception {

        Glean sdk = Glean.builder()
                .apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
            .build();

        PlatformAdminOauthClientsGetResponse res = sdk.admin().oauth().clients().get()
                .clientId("{client_id}")
                .call();

        if (res.platformGetOAuthClientResponse().isPresent()) {
            System.out.println(res.platformGetOAuthClientResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description Example
clientId String ✔️ The OAuth client_id of the client. {client_id}

Response

PlatformAdminOauthClientsGetResponse

Errors

Error Type Status Code Content Type
models/errors/PlatformProblemDetailException 400, 401, 403, 404, 408, 429 application/problem+json
models/errors/PlatformProblemDetailException 500, 503 application/problem+json
models/errors/APIException 4XX, 5XX */*