C3 AI Documentation Home

Update users

Updating a user in the C3 Agentic AI Platform is a process of modifying existing user details, roles, or permissions. This is essential for keeping user information relevant and aligned with the evolving roles and responsibilities within the organization.

A User is an entity who intends to consume services offered by the C3 AI Server. The functionality of this entity is mapped to a User Type in C3 Agentic AI Platform. Users may be part of different UserGroups, and inherit the roles that are associated with each UserGroup.

Note: Only users with C3.UserAdmin group and above can modify users. Regular security level restrictions apply.

Pre-requisites for updating a user

Ensure you have administrative privileges and understand the user’s current roles and necessary updates.

Fetching and modifying the user object

To update a user, first retrieve the existing user object from the database, and then update the necessary fields such as name, email, or any custom attributes.

JavaScript
User.forId("<user id>").withLastName('<last_name>').withFirstName('<first_name>').upsert();

Updating user roles and groups

Modify the user's roles and group memberships to reflect the current needs or organizational changes.

Granting access to actions can be accomplished by adding a User to an UserGroup. This can be done in the C3 AI Console using the following command:

JavaScript
User.forId("<user's id>").addToGroup("<group id>");

The user id is the user's unique ID and must be case-sensitive.

The group id is the name of the group, for example C3.EnvAdmin.

Was this page helpful?