Claude Platform Docs

Hapus Anggota Workspace Akun Layanan

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

Memerlukan token akses OAuth dengan cakupan org:admin, dari ant auth login --scope org:admin atau aturan workload identity federation; kunci API Admin tidak diterima. Lihat Mengelola WIF dengan Admin API.

Menghapus service account dari sebuah workspace.

Penghapusan bersifat idempoten (mengembalikan 200 meskipun keanggotaan sudah dihapus sebelumnya). DELETE terhadap keanggotaan workspace default yang implisit mengembalikan 200 tetapi tidak melakukan apa pun (no-op) dan keanggotaan tetap ada; menghapus baris workspace default yang eksplisit akan mengembalikannya ke keanggotaan workspace_user implisit. Workspace yang diarsipkan mengembalikan 400.

Parameters
workspaceID: string

ID of the workspace.

serviceAccountID: string

ID of the service account.

betas?:optional list<AnthropicBeta>

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

Returns
class ServiceAccountRemoveResponse { $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.

Hapus Anggota Workspace Akun Layanan
<?php

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

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

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

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