Claude Platform Docs

サービスアカウントのワークスペース一覧を取得

WorkspaceListPage organization().serviceAccounts().workspaces().list(params = WorkspaceListParams.none(), requestOptions = RequestOptions.none())
GET/v1/organizations/service_accounts/{service_account_id}/workspaces

org:adminスコープを持つOAuthアクセストークンが必要です。このトークンはant auth login --scope org:adminまたはワークロードアイデンティティフェデレーションルールから取得します。Admin APIキーは受け付けられません。Admin APIでWIFを管理するを参照してください。

サービスアカウントがメンバーとなっているワークスペースを一覧表示します。

各エントリには、そのワークスペースにおけるサービスアカウントのworkspace_roleが含まれます。 ページネーションにはlimitとnext_pageカーソルを使用してください。サービスアカウントに 明示的なデフォルトワークスペースのメンバーシップがない場合、暗黙的な(implicit: true) メンバーシップが最初のページの最初のエントリとして返されます。limit=1の場合、 ページネーションカーソルを導出できるよう、最初のページは最大2つのエントリ(暗黙的なエントリと 1つの明示的なメンバーシップ)を返すことがあります。メンバーシップは、サービスアカウントが アクティブな間のみ返されます。pageカーソルがない場合、アーカイブされたサービスアカウントは 空のリストを返します。アクティブなメンバーシップと一致しないpageカーソルは、 400 invalid-requestエラーを返します。メンバーシップが削除された場合、ワークスペースが 削除された場合、またはサービスアカウントがアーカイブされた場合、カーソルは一致しなくなります。 回復するには、最初のページからページネーションをやり直してください。

Parameters
WorkspaceListParams params
Optional<String> serviceAccountId⁠Path parameter

ID of the service account.

Optional<Long> limit⁠Query parameter

Number of results per page.

minimum1
maximum100
Optional<String> page⁠Query parameter

Opaque cursor from a previous response's next_page.

Returns
class ServiceAccountWorkspaceMember { type = "service_account_workspace_member"; createdByActorId; implicit; /* 3 more */ }
JsonValue type = "service_account_workspace_member"
Optional<String> createdByActorId

Tagged ID (user_.../svac_...) of the actor who created this membership.

Optional<Boolean> implicit

True when this is the implicit default-workspace membership every service account has when no explicit membership exists. Implicit memberships have role workspace_user and cannot be removed.

String serviceAccountId

Tagged service account ID (svac_...).

String workspaceId

Tagged workspace ID (wrkspc_...).

WorkspaceRole workspaceRole

Role of the service account in this workspace. Service accounts cannot hold the workspace_billing role.

One of the following:
WORKSPACE_ADMIN("workspace_admin")
WORKSPACE_BILLING("workspace_billing")
WORKSPACE_DEVELOPER("workspace_developer")
WORKSPACE_RESTRICTED_DEVELOPER("workspace_restricted_developer")
WORKSPACE_USER("workspace_user")
サービスアカウントのワークスペース一覧を取得
package com.anthropic.example;

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.organization.serviceaccounts.workspaces.WorkspaceListPage;
import com.anthropic.models.organization.serviceaccounts.workspaces.WorkspaceListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        AnthropicClient client = AnthropicOkHttpClient.fromEnv();

        WorkspaceListPage page = client.organization().serviceAccounts().workspaces().list("service_account_id");
    }
}
Returns Examples
Response 200
{
  "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"
}