Claude Platform Docs

Workspace-Mitglied aktualisieren

client.Organization.Workspaces.Members.Update(ctx, userID, params) (*WorkspaceMember, error)
POST/v1/organizations/workspaces/{workspace_id}/members/{user_id}

Workspace-Mitglied aktualisieren

Parameters
userID string⁠Path parameter

ID of the User.

params OrganizationWorkspaceMemberUpdateParams
WorkspaceID string⁠Path parameter

ID of the Workspace.

WorkspaceRole WorkspaceRole

New workspace role for the User.

Returns
type WorkspaceMember struct { Type: "workspace_member"; UserID; WorkspaceID; WorkspaceRole }
Type WorkspaceMember

Object type.

For Workspace Members, this is always "workspace_member".

defaultworkspace_member
UserID string

ID of the User.

WorkspaceID string

ID of the Workspace.

WorkspaceRole WorkspaceRole

Role of the Workspace Member.

One of the following:
const WorkspaceRoleWorkspaceAdmin WorkspaceRole = "workspace_admin"
const WorkspaceRoleWorkspaceBilling WorkspaceRole = "workspace_billing"
const WorkspaceRoleWorkspaceDeveloper WorkspaceRole = "workspace_developer"
const WorkspaceRoleWorkspaceRestrictedDeveloper WorkspaceRole = "workspace_restricted_developer"
const WorkspaceRoleWorkspaceUser WorkspaceRole = "workspace_user"
Errors

Any method can also return the general HTTP errors.

ErrorCodeWorkspaceMemberLimitExceededHTTP status 400error code workspace_member_limit_exceeded

The workspace has reached the member limit that Anthropic set for it.

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.

Workspace-Mitglied aktualisieren
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"),
	)
	workspaceMember, err := client.Organization.Workspaces.Members.Update(
		context.TODO(),
		"user_id",
		anthropic.OrganizationWorkspaceMemberUpdateParams{
			WorkspaceID:   "workspace_id",
			WorkspaceRole: anthropic.WorkspaceRoleWorkspaceAdmin,
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", workspaceMember.UserID)
}
Returns Examples
Response 200
{
  "type": "workspace_member",
  "user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu",
  "workspace_id": "wrkspc_01AbCdEfGhJkLmNpQrStUvWx",
  "workspace_role": "workspace_admin"
}