Claude Platform Docs

Rimuovi utente

beta.organization.users.remove(user_id) -> UserRemoveResponse
DELETE/v1/organizations/users/{user_id}

Rimuovi un membro dall'organizzazione.

Parameters
user_id: str⁠Path parameter

ID of the User.

Returns
class UserRemoveResponse: type: "user_deleted"; id
type: Literal["user_deleted"]

Deleted object type.

For Users, this is always "user_deleted".

defaultuser_deleted
id: str

ID of the User.

Errors

Any method can also return the general HTTP errors.

CannotRemoveLastMemberErrorHTTP status 400error code cannot_remove_last_member

The user is the organization's only member. Add another member before removing this one.

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.

ConcurrentMembershipChangeErrorHTTP status 409error code concurrent_membership_change

Another change to the organization's members is in progress. Retry the request once it completes.

Rimuovi utente
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ.get(
        "ANTHROPIC_API_KEY"
    ),  # This is the default and can be omitted
)
user = client.beta.organization.users.remove(
    "user_id",
)
print(user.id)
Returns Examples
Response 200
{
  "id": "user_01WxYzAbCdEfGhJkMnPqRsTu",
  "type": "user_deleted"
}