Claude Platform Docs

Удалить сервисный аккаунт из рабочего пространства

ServiceAccountRemoveResponse organization().workspaces().serviceAccounts().remove(params, requestOptions = RequestOptions.none())
DELETE/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}

Требуется токен доступа OAuth с областью org:admin, полученный с помощью ant auth login --scope org:admin или правила федерации удостоверений рабочих нагрузок; ключи Admin API не принимаются. См. Управление WIF с помощью Admin API.

Удаление сервисного аккаунта из рабочего пространства.

Удаление идемпотентно (возвращает 200, даже если членство уже было удалено). Запрос DELETE к неявному членству в рабочем пространстве по умолчанию возвращает 200, но не выполняет никаких действий, и членство сохраняется; удаление явной записи рабочего пространства по умолчанию возвращает к неявному членству workspace_user. Для архивированных рабочих пространств возвращается 400.

Parameters
ServiceAccountRemoveParams params
String workspaceId⁠Path parameter

ID of the workspace.

Optional<String> serviceAccountId⁠Path parameter

ID of the service account.

Returns
class ServiceAccountRemoveResponse { type = "service_account_workspace_member_deleted"; serviceAccountId; workspaceId; }
JsonValue type = "service_account_workspace_member_deleted"
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.

Удалить сервисный аккаунт из рабочего пространства
package com.anthropic.example;

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.organization.workspaces.serviceaccounts.ServiceAccountRemoveParams;
import com.anthropic.models.organization.workspaces.serviceaccounts.ServiceAccountRemoveResponse;

public final class Main {
    private Main() {}

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

        ServiceAccountRemoveParams params = ServiceAccountRemoveParams.builder()
            .workspaceId("workspace_id")
            .serviceAccountId("service_account_id")
            .build();
        ServiceAccountRemoveResponse serviceAccount = client.organization().workspaces().serviceAccounts().remove(params);
    }
}
Returns Examples
Response 200
{
  "service_account_id": "service_account_id",
  "type": "service_account_workspace_member_deleted",
  "workspace_id": "workspace_id"
}