Claude Platform Docs

フェデレーションルールのワークスペースを削除

client.Organization.Federation.Rules.Workspaces.Remove(ctx, workspaceID, body) (*OrganizationFederationRuleWorkspaceRemoveResponse, error)
DELETE/v1/organizations/federation_rules/{federation_rule_id}/workspaces/{workspace_id}

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

ワークスペースに対するフェデレーションルールを無効にします。

べき等です。有効化がすでに削除されている場合でも成功します。OAuth呼び出し元が管理できるのは、 oauth_scopeがworkspace:developerまたはworkspace:inferenceであるルールのみです。 その他のスコープにはConsoleセッションが必要です。

Parameters
workspaceID string⁠Path parameter

ID of the workspace to disable for.

body OrganizationFederationRuleWorkspaceRemoveParams
FederationRuleID string⁠Path parameter

ID of the federation rule.

Returns
type OrganizationFederationRuleWorkspaceRemoveResponse struct { Type: "federation_rule_workspace_deleted"; FederationRuleID; WorkspaceID }
Type FederationRuleWorkspaceDeleted
defaultfederation_rule_workspace_deleted
FederationRuleID string

Tagged ID of the federation rule.

WorkspaceID string

Tagged ID of the workspace named in the delete request. Removal is idempotent.

フェデレーションルールのワークスペースを削除
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	workspace, err := client.Organization.Federation.Rules.Workspaces.Remove(
		context.TODO(),
		"workspace_id",
		anthropic.OrganizationFederationRuleWorkspaceRemoveParams{
			FederationRuleID: "federation_rule_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", workspace.FederationRuleID)
}
Returns Examples
Response 200
{
  "federation_rule_id": "federation_rule_id",
  "type": "federation_rule_workspace_deleted",
  "workspace_id": "workspace_id"
}