Claude Platform Docs

서비스 계정에서 워크스페이스 제거

$client->beta->organization->serviceAccounts->workspaces->remove(string workspaceID, string serviceAccountID, ?list<AnthropicBeta> betas): WorkspaceRemoveResponse
DELETE/v1/organizations/service_accounts/{service_account_id}/workspaces/{workspace_id}

org:admin 범위의 OAuth 액세스 토큰이 필요합니다. 이 토큰은 ant auth login --scope org:admin 또는 워크로드 ID 페더레이션 규칙을 통해 얻을 수 있으며, Admin API 키는 허용되지 않습니다. Admin API로 WIF 관리를 참조하세요.

워크스페이스에서 서비스 계정을 제거합니다.

서비스 계정 측에서 접근하는 DELETE /workspaces/{workspace_id}/service_accounts/{service_account_id}의 미러입니다. 제거는 멱등적입니다(멤버십이 이미 제거된 경우에도 200을 반환). 암묵적 기본 워크스페이스 멤버십에 대한 DELETE는 200을 반환하지만 아무 작업도 수행하지 않으며 멤버십은 유지됩니다. 명시적 기본 워크스페이스 행을 삭제하면 암묵적 workspace_user 멤버십으로 되돌아갑니다. 보관된 워크스페이스는 400을 반환합니다.

Parameters
serviceAccountID: string

ID of the service account.

workspaceID: string

ID of the workspace.

betas?:optional list<AnthropicBeta>

Optional header to specify the beta version(s) you want to use.

Returns
class WorkspaceRemoveResponse { $type = 'service_account_workspace_member_deleted'; $serviceAccountID; $workspaceID; }
"service_account_workspace_member_deleted" type
string serviceAccountID

Tagged service account ID (svac_...) named in the delete request. Removal is idempotent; see the endpoint description for the implicit-membership no-op.

string workspaceID

Tagged workspace ID (wrkspc_...) named in the delete request.

서비스 계정에서 워크스페이스 제거
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'my-anthropic-api-key');

$workspace = $client->beta->organization->serviceAccounts->workspaces->remove(
  'workspace_id',
  serviceAccountID: 'service_account_id',
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
);

var_dump($workspace);
Returns Examples
Response 200
{
  "service_account_id": "service_account_id",
  "type": "service_account_workspace_member_deleted",
  "workspace_id": "workspace_id"
}