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 또는 워크로드 ID 페더레이션 규칙에서 얻을 수 있으며, Admin API 키는 허용되지 않습니다. Admin API로 WIF 관리를 참조하세요.

서비스 계정이 멤버로 속한 워크스페이스를 나열합니다.

각 항목에는 해당 워크스페이스에서의 서비스 계정 workspace_role이 포함됩니다. 페이지를 나누려면 limit과 next_page 커서를 사용하세요. 서비스 계정에 명시적인 기본 워크스페이스 멤버십이 없는 경우, 암묵적(implicit: true) 멤버십이 첫 페이지의 첫 번째 항목으로 반환됩니다. limit=1인 경우 페이지네이션 커서를 도출할 수 있도록 첫 페이지에서 최대 2개의 항목(암묵적 항목과 명시적 멤버십 하나)이 반환될 수 있습니다. 멤버십은 서비스 계정이 활성 상태인 동안에만 반환됩니다. 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"
}