Claude Platform Docs

워크스페이스 멤버 생성

beta.organization.workspaces.members.add(workspace_id, **kwargs) -> BetaWorkspaceMember
POST/v1/organizations/workspaces/{workspace_id}/members

워크스페이스 멤버 생성

Parameters
workspace_id: str⁠Path parameter

ID of the Workspace.

user_id: str

ID of the User.

Role of the new Workspace Member. Cannot be workspace_billing.

One of the following:
"workspace_admin"
"workspace_developer"
"workspace_restricted_developer"
"workspace_user"
Returns
class BetaWorkspaceMember: type: "workspace_member"; user_id; workspace_id; workspace_role
type: Literal["workspace_member"]

Object type.

For Workspace Members, this is always "workspace_member".

defaultworkspace_member
user_id: str

ID of the User.

workspace_id: str

ID of the Workspace.

workspace_role: BetaWorkspaceRole

Role of the Workspace Member.

One of the following:
"workspace_admin"
"workspace_billing"
"workspace_developer"
"workspace_restricted_developer"
"workspace_user"
Errors

Any method can also return the general HTTP errors.

WorkspaceMemberLimitExceededErrorHTTP status 400error code workspace_member_limit_exceeded

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

SandboxEgressRestrictedErrorHTTP 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.

워크스페이스 멤버 생성
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ.get(
        "ANTHROPIC_API_KEY"
    ),  # This is the default and can be omitted
)
beta_workspace_member = client.beta.organization.workspaces.members.add(
    workspace_id="workspace_id",
    user_id="user_01WxYzAbCdEfGhJkMnPqRsTu",
    workspace_role="workspace_admin",
)
print(beta_workspace_member.user_id)
Returns Examples
Response 200
{
  "type": "workspace_member",
  "user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu",
  "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  "workspace_role": "workspace_admin"
}