Claude Platform Docs

移除使用者

$ ant organization:users remove
DELETE/v1/organizations/users/{user_id}

從組織中移除成員。

Parameters
--user-id: string⁠Path parameter

ID of the User.

Returns
OrganizationUserRemoveResponse: object{ type: "user_deleted", id }
type: "user_deleted"

Deleted object type.

For Users, this is always "user_deleted".

id: string

ID of the User.

Errors

Any method can also return the general HTTP errors.

Each code below is the value of error.details.error_code in the response body.

error code cannot_remove_last_member⁠HTTP status 400

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

error code api_key_requester_unconfirmed⁠HTTP status 403

The API could not confirm that this request came from your organization, so it refused a change to an API key. If you were updating an API key, the key did not change. If you were archiving a service account, it is archived, but some of its API keys are not. If you were removing a user, they are still a member, but they may be signed out and some of their API keys may be turned off. It is safe to send the same request again. If the error continues, contact Anthropic support and give them the request_id from this response.

error code sandbox_egress_restricted⁠HTTP status 403

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.

error code concurrent_membership_change⁠HTTP status 409

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

移除使用者
ant organization:users remove \
  --user-id user_id
Returns Examples
Response 200
{
  "id": "user_01WxYzAbCdEfGhJkMnPqRsTu",
  "type": "user_deleted"
}