---
title: Users
url: https://platform.claude.com/docs/en/api/java/organization/users
---

# Users

## List Users

`UserListPage organization().users().list(params = UserListParams.none(), requestOptions = RequestOptions.none())`

**GET** `/v1/organizations/users`

List the organization's members.

### Parameters

- `UserListParams params`

  - `Optional<String> afterId` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

  - `Optional<String> beforeId` (query parameter)

    ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

  - `Optional<String> email` (query parameter)

    Filter by user email.

    format: email

  - `Optional<Long> limit` (query parameter)

    Number of items to return per page.

    Defaults to `20`. Ranges from `1` to `1000`.

    minimum: 1, maximum: 1000

  - `Optional<List<String>> roles` (query parameter)

    Filter to items whose `role` equals one of the supplied values. Repeatable; values are OR'ed together.

    Accepted values depend on the organization type: Console and API organizations accept `user`, `developer`, `billing`, `admin`, and `claude_code_user`; Claude Enterprise organizations accept `user`, `owner`, `primary_owner`, `membership_admin`, and `managed`.

### Returns

- `class OrganizationUser`

  - `JsonValue type = "user"`

    Object type.

    For Users, this is always `"user"`.

  - `String id`

    ID of the User.

  - `LocalDateTime addedAt`

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

    format: date-time

  - `String email`

    Email of the User.

  - `String name`

    Name of the User.

  - `OrganizationRole role`

    Organization role of the User.

    - `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")`

### Example

```java
package com.anthropic.example;

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.organization.users.UserListPage;
import com.anthropic.models.organization.users.UserListParams;

public final class Main {
    private Main() {}

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

        UserListPage page = client.organization().users().list();
    }
}
```

#### Response (200)

```json
{
  "data": [
    {
      "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
      "added_at": "2024-10-30T23:58:27.427722Z",
      "email": "user@emaildomain.com",
      "name": "Jane Doe",
      "role": "admin",
      "type": "user"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}
```

## Get User

`OrganizationUser organization().users().retrieve(params = UserRetrieveParams.none(), requestOptions = RequestOptions.none())`

**GET** `/v1/organizations/users/{user_id}`

Retrieve a member of the organization by user ID.

### Parameters

- `UserRetrieveParams params`

  - `Optional<String> userId` (path parameter)

    ID of the User.

### Returns

- `class OrganizationUser`

  - `JsonValue type = "user"`

    Object type.

    For Users, this is always `"user"`.

  - `String id`

    ID of the User.

  - `LocalDateTime addedAt`

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

    format: date-time

  - `String email`

    Email of the User.

  - `String name`

    Name of the User.

  - `OrganizationRole role`

    Organization role of the User.

    - `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")`

### Example

```java
package com.anthropic.example;

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.organization.users.OrganizationUser;
import com.anthropic.models.organization.users.UserRetrieveParams;

public final class Main {
    private Main() {}

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

        OrganizationUser organizationUser = client.organization().users().retrieve("user_id");
    }
}
```

#### Response (200)

```json
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "added_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "name": "Jane Doe",
  "role": "admin",
  "type": "user"
}
```

## Update User

`OrganizationUser organization().users().update(params, requestOptions = RequestOptions.none())`

**POST** `/v1/organizations/users/{user_id}`

Update a member's organization role.

### Parameters

- `UserUpdateParams params`

  - `Optional<String> userId` (path parameter)

    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`; changing a User's role to `managed` requires the `write:rbac_groups` scope in addition to `write:members`.

    - `BILLING("billing")`

    - `CLAUDE_CODE_USER("claude_code_user")`

    - `DEVELOPER("developer")`

    - `MANAGED("managed")`

    - `USER("user")`

### Returns

- `class OrganizationUser`

  - `JsonValue type = "user"`

    Object type.

    For Users, this is always `"user"`.

  - `String id`

    ID of the User.

  - `LocalDateTime addedAt`

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

    format: date-time

  - `String email`

    Email of the User.

  - `String name`

    Name of the User.

  - `OrganizationRole role`

    Organization role of the User.

    - `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")`

### Example

```java
package com.anthropic.example;

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.organization.users.OrganizationUser;
import com.anthropic.models.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();
        OrganizationUser organizationUser = client.organization().users().update(params);
    }
}
```

#### Response (200)

```json
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "added_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "name": "Jane Doe",
  "role": "admin",
  "type": "user"
}
```

## Remove User

`UserRemoveResponse organization().users().remove(params = UserRemoveParams.none(), requestOptions = RequestOptions.none())`

**DELETE** `/v1/organizations/users/{user_id}`

Remove a member from the organization.

### Parameters

- `UserRemoveParams params`

  - `Optional<String> userId` (path parameter)

    ID of the User.

### Returns

- `class UserRemoveResponse`

  - `JsonValue type = "user_deleted"`

    Deleted object type.

    For Users, this is always `"user_deleted"`.

  - `String id`

    ID of the User.

### Example

```java
package com.anthropic.example;

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.organization.users.UserRemoveParams;
import com.anthropic.models.organization.users.UserRemoveResponse;

public final class Main {
    private Main() {}

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

        UserRemoveResponse user = client.organization().users().remove("user_id");
    }
}
```

#### Response (200)

```json
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "type": "user_deleted"
}
```

## Domain types

### Organization User

- `class OrganizationUser`

  - `JsonValue type = "user"`

    Object type.

    For Users, this is always `"user"`.

  - `String id`

    ID of the User.

  - `LocalDateTime addedAt`

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

    format: date-time

  - `String email`

    Email of the User.

  - `String name`

    Name of the User.

  - `OrganizationRole role`

    Organization role of the User.

    - `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")`
