Change the details of the currently signed in Player.

View interactive version here

Request Parameters

Parameter Required Type Description
displayName No string The new display name to set in the player data.
language No string The new language code to set in the player data.
newPassword No string The new password to set in the player data.
oldPassword No string The player's existing password. If supplied it will be checked against the password stored in the player data. This allows you re-authenticate the player making the change.
userName No string The new userName with which this player will sign in. If the player currently authenticates using device authentication this will upgrade their account and require them to use username and password authentication from now on.

Response Parameters

A response to a change user details request

Parameter Type Description
scriptData ScriptData A JSON Map of any data added either to the Request or the Response by your Cloud Code

Nested types


A collection of arbitrary data that can be added to a message via a Cloud Code script.

Parameter Type Description
myKey string An arbitrary data key
myValue JSON An arbitrary data value.

Error Codes

Key Value Description
DETAILS UNRECOGNISED The oldPassword did not match the one stored against the player.
USERNAME TAKEN The userName supplied is already in use.

Code Samples


    using GameSparks.Api;
    using GameSparks.Api.Requests;
    using GameSparks.Api.Responses;
    new ChangeUserDetailsRequest()
        .Send((response) => {
        GSData scriptData = response.ScriptData;

ActionScript 3

    import com.gamesparks.*;
    import com.gamesparks.api.requests.*;
    import com.gamesparks.api.responses.*;
    import com.gamesparks.api.types.*;

        .send(function(response:com.gamesparks.api.responses.ChangeUserDetailsResponse):void {
        var scriptData:ScriptData = response.getScriptData(); 


    #import "GS.h"
    #import "GSAPI.h"
    GSChangeUserDetailsRequest* request = [[GSChangeUserDetailsRequest alloc] init];
    [request setDisplayName:displayName;
    [request setLanguage:language;
    [request setNewPassword:newPassword;
    [request setOldPassword:oldPassword;
    [request setUserName:userName;
    [request setCallback:^ (GSChangeUserDetailsResponse* response) {
    NSDictionary* scriptData = [response getScriptData]; 
    [gs send:request];


    #include <GameSparks/generated/GSRequests.h>
    using namespace GameSparks::Core;
    using namespace GameSparks::Api::Responses;
    using namespace GameSparks::Api::Requests;

    void ChangeUserDetailsRequest_Response(GS& gsInstance, const ChangeUserDetailsResponse& response) {
    GSData scriptData = response.getScriptData(); 

    ChangeUserDetailsRequest request(gsInstance);


import com.gamesparks.sdk.api.autogen.GSRequestBuilder.ChangeUserDetailsRequest;
import com.gamesparks.sdk.api.autogen.GSResponseBuilder.ChangeUserDetailsResponse;
import com.gamesparks.sdk.api.autogen.GSTypes.*;
import com.gamesparks.sdk.api.GSEventListener;

    .send(new GSEventListener<ChangeUserDetailsResponse>() {
        public void onEvent(ChangeUserDetailsResponse response) {

Cloud Code

    var request = new SparkRequests.ChangeUserDetailsRequest();
    request.displayName = ...;
    request.language = ...;
    request.newPassword = ...;
    request.oldPassword = ...;
    request.userName = ...;
    var response = request.Send();

var scriptData = response.scriptData;