Skip to content

Update User Object

User property values of the logged in users can be updated with an API operation described below. This operation is useful if an application needs to provide to the users the functionality for updating user profiles and registration properties. A user must be logged in in order to update his registration properties.

Non-Blocking API

public void Backendless.UserService.Update( BackendlessUser user, 
                                            AsyncCallback<BackendlessUser> callback );

Blocking API

public BackendlessUser Backendless.UserService.Update( BackendlessUser user );


Argument                Description
user an instance of the BackendlessUser class which contains property values to update the user account with.
callback an object which receives either a return value or an error from the server. The return value from the server is an updated instance of the BackendlessUser class.


The following errors may occur during the Update User Properties API call. See the Error Handling section for details on how to retrieve the error code when the server returns an error.

Error Code
Version is disabled or provided wrong application info (application id or secret key)
The property marked as "identity" is being updated and another user already has the specified value which must be unique.
General "update registration" error. Error message should contain additional details.
User is not logged in.
Cannot modify properties of another user. Returned when one user is logged and the call attempts to modify properties of another user.
Unable to locate user account - invalid user id.
A new "dynamic" property is being added, but dynamic property definition is disabled.
Required properties in the provided object do not contain values.


// do not forget to call Backendless.initApp in the app initialization code

AsyncCallback<BackendlessUser> updateCallback = new AsyncCallback<BackendlessUser>(
        user =>
          System.Console.WriteLine( "User account has been updated" );
          Dictionary<string, object> props = user.Properties;
          foreach( KeyValuePair<string, object> pair in props )
            System.Console.WriteLine( String.Format( "Property: {0} - {1}", pair.Key, pair.Value ) );
        fault =>
          System.Console.WriteLine( fault.ToString() );
        } );

BackendlessUser user = // user object retrieval is out of scope of this example
user.SetProperty( "phoneNumber", "5551212" );
Backendless.UserService.Update( user, updateCallback );