# Update user **PATCH /api/users/{userId}** Update user data for the given ID. This method performs a partial update. ## Servers - Logto endpoint address.: https://[tenant_id].logto.app (Logto endpoint address.) ## Authentication methods - O auth2 ## Parameters #### Path parameters - **userId** (string) The unique identifier of the user. ## Body parameters Content-type: application/json - **username** (string(regex) | null | string(empty)) Updated username for the user. It should be unique across all users. - **primaryEmail** (string(regex) | null | string(empty)) Updated primary email address for the user. It should be unique across all users. - **primaryPhone** (string(regex) | null | string(empty)) Updated primary phone number for the user. It should be unique across all users. - **name** (string | null | string(empty)) - **avatar** (string(url) | null | string(empty)) - **customData** (object) Custom data object to update for the given user ID. Note this will replace the entire custom data object. If you want to perform a partial update, use the `PATCH /api/users/{userId}/custom-data` endpoint instead. - **profile** (object) ## Responses ### 200: Updated user data for the given ID. #### Body Parameters: application/json (object) - **id** (string) - **username** (string | null) - **primaryEmail** (string | null) - **primaryPhone** (string | null) - **name** (string | null) - **avatar** (string | null) - **customData** (object) arbitrary - **identities** (object) - **lastSignInAt** (number | null) - **createdAt** (number) - **updatedAt** (number) - **profile** (object) - **applicationId** (string | null) - **isSuspended** (boolean) - **hasPassword** (boolean) - **ssoIdentities** (array[object]) ### 400: Bad Request ### 401: Unauthorized ### 403: Forbidden ### 404: Not Found ### 422: Unprocessable Content [Powered by Bump.sh](https://bump.sh)