Create User

You should create a user in your MirrorFly application to initiate conversations. A user is identified by its unique user identifier, and additionally have a changeable nickname, profile image, and so on. Users are at the core of all conversations. MirrorFly applications are made up of users who can chat in directly to other users or Group. With the Create User API, it is possible to create a user.


{your-domain-name} can be obtained from the MirrorFly console.

HTTP request#

curl --location --request POST 'https://{your-domain-name}/api/v1/users/createUser' \
--header 'accept: */*' \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: :AuthToken' \
--form 'deviceType=":deviceType"' \
--form 'licenseKey=":licenseKey"' \
--form 'userIdentifier=":userIdentifier"' \
--form 'deviceOsVersion=":deviceOsVersion"' \
--form 'deviceToken=":deviceToken"' \
--form 'voipDeviceToken=":voipDeviceToke"' \
--form 'mode=":mode"' \
--form 'nickname=":nickName"' \
--form 'mobileNumber=":mobileNumber"' \
--form 'email=":emailId"' \
--form 'profileUrl=":profileUrl"' \
--form 'profileFile=@":profileFile"

Request Params#

deviceTypeStringYesDevice type where the user is creating. Accepted values (web/ios/android).
licenseKeyStringYesYour license key.
userIdentifierStringYesUnique user identifier. Max of 191 chars allowed.
deviceOsVersionStringNoDevice os version.
deviceTokenStringNoDevice token to receive the push notification for android/ios devices.
voipDeviceTokenStringNoVoip device token to receive the call related push notification for the ios devices.
modeIntNoMode to denote the ios sandbox/production mode to receive the push notifications. 0 - production, 1 - sandbox/debug
nicknameStringNoNickname of the user. Max of 30 chars allowed.
mobileNumberStringNoMobile number of the user. Max of 15 chars allowed.
emailStringNoEmail Id of the user.
profileUrlStringNoIf you already having the profile image url, then you can use this param to store the data. Max of 2048 chars allowed.
profileFileFileNoIf you need to upload the image, then you can use this param to upload the image and retrieve the profile url which will be access via the Mirrorfly SDK’s and API’s only. Accepted files are png, jpeg and jpg.


If successful, this action returns a user resource in the response body.

"status": 200,
"data": {
"token": "",//Auth token for this user
"username": "XXXXXXX",//Username of this user which should be used to generate the Auth token
"password": "XXXXXXX",//Password of this user which should be used to generate the Auth token
"isProfileUpdated": true,//To denote whether the user is newly registered or registered already.
"mobileNumber": "XXXXXXX",
"nickname": "User A",
"profileUrl": "",
"email": ""
"message": "User created successfully"


In the case of an error, an error object like below is returned.

When the token passed in Headers is not given or expired

"status": 401,
"message": "Token Expired"

In the case of a Bad Request, an error message is returned

"status": 400,
"message": "Error Message"