Claude Platform Docs

Update User

BetaOrganizationUser beta().organization().users().update(UserUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/organizations/users/{user_id}

Update a member's organization role.

Parameters
UserUpdateParams params
Optional<String> userId

ID of the User.

Role role

New role for the User.

The accepted values depend on the organization type. Console and API organizations accept user, developer, billing, and claude_code_user; admin cannot be assigned through the API. Claude Enterprise organizations accept user and managed.

BILLING("billing")
CLAUDE_CODE_USER("claude_code_user")
DEVELOPER("developer")
MANAGED("managed")
USER("user")
Returns
class BetaOrganizationUser:
String id

ID of the User.

LocalDateTime addedAt

RFC 3339 datetime string indicating when the User joined the Organization.

formatdate-time
String email

Email of the User.

String name

Name of the User.

Organization role of the User.

One of the following:
ADMIN("admin")
BILLING("billing")
CLAUDE_CODE_USER("claude_code_user")
DEVELOPER("developer")
MANAGED("managed")
MEMBERSHIP_ADMIN("membership_admin")
OWNER("owner")
PRIMARY_OWNER("primary_owner")
USER("user")
JsonValue type "user"constant

Object type.

For Users, this is always "user".

Update User

package com.anthropic.example;

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.beta.organization.users.BetaOrganizationUser;
import com.anthropic.models.beta.organization.users.UserUpdateParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        AnthropicClient client = AnthropicOkHttpClient.fromEnv();

        UserUpdateParams params = UserUpdateParams.builder()
            .userId("user_id")
            .role(UserUpdateParams.Role.USER)
            .build();
        BetaOrganizationUser betaOrganizationUser = client.beta().organization().users().update(params);
    }
}
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "added_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "name": "Jane Doe",
  "role": "admin",
  "type": "user"
}
Returns Examples
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "added_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "name": "Jane Doe",
  "role": "admin",
  "type": "user"
}