Skip to main content

Migrate account

Accounts within On3 are based on wallet addresses. You can use this API endpoint to migrate one account to another, e.g., if a user has lost access to their old wallet and wants to migrate their balances, XP, settings, etc.

danger

Calling this endpoint will COPY and DELETE all data from account fromAddress to account toAddress.

warning

Any open raffles or auctions the user has entered or bid on will not be transfered.

note

This command does not migrate users' historic data, i.e., previous quest completions, their notifications, or purchased shop items.

Request

HTTP POST to /accounts/migrate with Content-Type: application/json and a JSON body of:

{
"fromAddress": "0x435Cd3902d1b4f4E842F2C0fd5028EEE71dd099C",
"toAddress": "0xd03ea8624C8C5987235048901fB614fDcA89b117",
"withEmail": "george@on3.one",
"forceMerge": "true"
}

Fields

fromAddress

The wallet addresses of the account you want to migrate from. This wallet must already have an On3 account.

danger

After using this endpoint, the account attached to fromAddress will become "zero'd", having all of its data deleted.

Typestring
RequiredYes
LimitationsMust be a valid checksum address
Examples"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

toAddress

The wallet address you want to create a new account for and migrate to. If the account already exists, the API will return an error unless forceMerge is set.

Typestring
RequiredYes
LimitationsMust be a valid checksum address
Examples"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"

withEmail

If this parameter is set, the migration will only happen if the withEmail value matches (case insensitive) the email for the fromAddress account.

Typestring
RequiredNo
LimitationsMust be a valid email address
Examples"bill@gmail.com"

forceMerge

If set to true and an account for toAddress already exists then we will merge both accounts balances and XP instead of overwriting.

Typeboolean
RequiredNo
Limitations
Examplestrue

Response

You should appropriately handle any errors when wasSuccessful is false. The errors array will detail what went wrong, i.e., an account for toAddress already exists.

{
"newAccount": {
// .. full updated account object for `toAddress` (see https://docs.on3.one/api/routes/accounts/get#response)
},
"wasSuccessful": boolean, // true or false
"errors": [ // array of errors
"string"
]
}

Codes

CodeSuccessDescription
2XXYesYour request was accepted and the account was either updated or created.
4XXNoCheck the response body for details on what needs changing in the request. If the error continues and the request appears to be valid, please report this to the On3 support team.
5XXNoYour request failed due to a server-side error. If the error continues after several attempts, please report this to the On3 support team.