- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
UpdateUserCommand
Updates data for the user. To have the latest information, it must be preceded by a DescribeUser call. The dataset in the request should be the one expected when performing another DescribeUser
call.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { WorkMailClient, UpdateUserCommand } from "@aws-sdk/client-workmail"; // ES Modules import
// const { WorkMailClient, UpdateUserCommand } = require("@aws-sdk/client-workmail"); // CommonJS import
const client = new WorkMailClient(config);
const input = { // UpdateUserRequest
OrganizationId: "STRING_VALUE", // required
UserId: "STRING_VALUE", // required
Role: "USER" || "RESOURCE" || "SYSTEM_USER" || "REMOTE_USER",
DisplayName: "STRING_VALUE",
FirstName: "STRING_VALUE",
LastName: "STRING_VALUE",
HiddenFromGlobalAddressList: true || false,
Initials: "STRING_VALUE",
Telephone: "STRING_VALUE",
Street: "STRING_VALUE",
JobTitle: "STRING_VALUE",
City: "STRING_VALUE",
Company: "STRING_VALUE",
ZipCode: "STRING_VALUE",
Department: "STRING_VALUE",
Country: "STRING_VALUE",
Office: "STRING_VALUE",
IdentityProviderUserId: "STRING_VALUE",
};
const command = new UpdateUserCommand(input);
const response = await client.send(command);
// {};
UpdateUserCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
OrganizationId Required | string | undefined | The identifier for the organization under which the user exists. |
UserId Required | string | undefined | The identifier for the user to be updated. The identifier can be the UserId, Username, or email. The following identity formats are available:
|
City | string | undefined | Updates the user's city. |
Company | string | undefined | Updates the user's company. |
Country | string | undefined | Updates the user's country. |
Department | string | undefined | Updates the user's department. |
DisplayName | string | undefined | Updates the display name of the user. |
FirstName | string | undefined | Updates the user's first name. |
HiddenFromGlobalAddressList | boolean | undefined | If enabled, the user is hidden from the global address list. |
IdentityProviderUserId | string | undefined | User ID from the IAM Identity Center. If this parameter is empty it will be updated automatically when the user logs in for the first time to the mailbox associated with WorkMail. |
Initials | string | undefined | Updates the user's initials. |
JobTitle | string | undefined | Updates the user's job title. |
LastName | string | undefined | Updates the user's last name. |
Office | string | undefined | Updates the user's office. |
Role | UserRole | undefined | Updates the user role. You cannot pass SYSTEM_USER or RESOURCE. |
Street | string | undefined | Updates the user's street address. |
Telephone | string | undefined | Updates the user's contact details. |
ZipCode | string | undefined | Updates the user's zip code. |
UpdateUserCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
DirectoryServiceAuthenticationFailedException | client | The directory service doesn't recognize the credentials supplied by WorkMail. |
DirectoryUnavailableException | client | The directory is unavailable. It might be located in another Region or deleted. |
EntityNotFoundException | client | The identifier supplied for the user, group, or resource does not exist in your organization. |
EntityStateException | client | You are performing an operation on a user, group, or resource that isn't in the expected state, such as trying to delete an active user. |
InvalidParameterException | client | One or more of the input parameters don't match the service's restrictions. |
OrganizationNotFoundException | client | An operation received a valid organization identifier that either doesn't belong or exist in the system. |
OrganizationStateException | client | The organization must have a valid state to perform certain operations on the organization or its members. |
UnsupportedOperationException | client | You can't perform a write operation against a read-only directory. |
WorkMailServiceException | Base exception class for all service exceptions from WorkMail service. |