Claude Platform Docs

Excluir membro do workspace

client.Beta.Organization.Workspaces.Members.Remove(ctx, userID, body) (*BetaOrganizationWorkspaceMemberRemoveResponse, error)
DELETE/v1/organizations/workspaces/{workspace_id}/members/{user_id}

Excluir membro do workspace

Parameters
userID string⁠Path parameter

ID of the User.

body BetaOrganizationWorkspaceMemberRemoveParams
WorkspaceID string⁠Path parameter

ID of the Workspace.

Returns
type BetaOrganizationWorkspaceMemberRemoveResponse struct { Type: "workspace_member_deleted"; UserID; WorkspaceID }
Type WorkspaceMemberDeleted

Deleted object type.

For Workspace Members, this is always "workspace_member_deleted".

defaultworkspace_member_deleted
UserID string

ID of the User.

WorkspaceID string

ID of the Workspace.

Errors

Any method can also return the general HTTP errors.

ErrorCodeSandboxEgressRestrictedHTTP status 403error code sandbox_egress_restricted

The request came from a Claude sandbox with restricted network access, which is not allowed to make this request. Send it from outside the sandbox, or from a sandbox with unrestricted network access.

Excluir membro do workspace
package main

import (
	"context"
	"fmt"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	member, err := client.Beta.Organization.Workspaces.Members.Remove(
		context.TODO(),
		"user_id",
		anthropic.BetaOrganizationWorkspaceMemberRemoveParams{
			WorkspaceID: "workspace_id",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", member.UserID)
}
Returns Examples
Response 200
{
  "type": "workspace_member_deleted",
  "user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu",
  "workspace_id": "wrkspc_01AbCdEfGhJkLmNpQrStUvWx"
}