Skip to content
Primary navigation

Modify user

OrganizationUser admin().organization().users().update(UserUpdateParamsparams = UserUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/organization/users/{user_id}

Modifies a user’s role in the organization.

ParametersExpand Collapse
UserUpdateParams params
Optional<String> userId
Optional<String> developerPersona

Developer persona metadata.

Optional<String> role

owner or reader

Optional<String> roleId

Role ID to assign to the user.

Optional<String> technicalLevel

Technical level metadata.

ReturnsExpand Collapse
class OrganizationUser:

Represents an individual user within an organization.

String id

The identifier, which can be referenced in API endpoints

long addedAt

The Unix timestamp (in seconds) of when the user was added.

formatunixtime
JsonValue; object_ "organization.user"constant"organization.user"constant

The object type, which is always organization.user

Optional<Long> apiKeyLastUsedAt

The Unix timestamp (in seconds) of the user’s last API key usage.

formatunixtime
Optional<Long> created

The Unix timestamp (in seconds) of when the user was created.

formatunixtime
Optional<String> developerPersona

The developer persona metadata for the user.

Optional<String> email

The email address of the user

Optional<Boolean> isDefault

Whether this is the organization’s default user.

Optional<Boolean> isScaleTierAuthorizedPurchaser

Whether the user is an authorized purchaser for Scale Tier.

Optional<Boolean> isScimManaged

Whether the user is managed through SCIM.

Optional<Boolean> isServiceAccount

Whether the user is a service account.

Optional<String> name

The name of the user

Optional<Projects> projects

Projects associated with the user, if included.

List<Data> data
Optional<String> id
Optional<String> name
Optional<String> role
JsonValue; object_ "list"constant"list"constant
Optional<String> role

owner or reader

Optional<String> technicalLevel

The technical level metadata for the user.

Optional<User> user

Nested user details.

String id
JsonValue; object_ "user"constant"user"constant
Optional<Boolean> banned
Optional<Long> bannedAt
formatunixtime
Optional<String> email
Optional<Boolean> enabled
Optional<String> name
Optional<String> picture

Modify user

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.admin.organization.users.OrganizationUser;
import com.openai.models.admin.organization.users.UserUpdateParams;

public final class Main {
    private Main() {}

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

        OrganizationUser organizationUser = client.admin().organization().users().update("user_id");
    }
}
{
    "object": "organization.user",
    "id": "user_abc",
    "name": "First Last",
    "email": "user@example.com",
    "role": "owner",
    "added_at": 1711471533
}
Returns Examples
{
    "object": "organization.user",
    "id": "user_abc",
    "name": "First Last",
    "email": "user@example.com",
    "role": "owner",
    "added_at": 1711471533
}