List Service Account Workspace Members
ServiceAccountListPage beta().organization().workspaces().serviceAccounts().list(ServiceAccountListParamsparams = ServiceAccountListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())GET/v1/organizations/workspaces/{workspace_id}/service_accounts
Requires an OAuth access token with the org:admin scope, from ant auth login --scope org:admin or a workload identity federation rule; Admin API keys are not accepted. See Manage WIF with the Admin API.
List the service accounts that are members of a workspace.
Each entry includes the service account's workspace_role. Use limit
and the next_page cursor to paginate. Archived workspaces return 400;
use GET /service_accounts/{id}/workspaces to audit memberships of an
archived workspace. The implicit default-workspace membership is not
included in this list. Memberships of archived service accounts are
omitted from the results.
Parameters
Returns
List Service Account Workspace Members
package com.anthropic.example;
import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.beta.organization.workspaces.serviceaccounts.ServiceAccountListPage;
import com.anthropic.models.beta.organization.workspaces.serviceaccounts.ServiceAccountListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
AnthropicClient client = AnthropicOkHttpClient.fromEnv();
ServiceAccountListPage page = client.beta().organization().workspaces().serviceAccounts().list("workspace_id");
}
}{
"data": [
{
"created_by_actor_id": "created_by_actor_id",
"implicit": true,
"service_account_id": "service_account_id",
"type": "service_account_workspace_member",
"workspace_id": "workspace_id",
"workspace_role": "workspace_admin"
}
],
"next_page": "next_page"
}Returns Examples
{
"data": [
{
"created_by_actor_id": "created_by_actor_id",
"implicit": true,
"service_account_id": "service_account_id",
"type": "service_account_workspace_member",
"workspace_id": "workspace_id",
"workspace_role": "workspace_admin"
}
],
"next_page": "next_page"
}