Anonymous Accounts

Anonymous accounts are Ready Player Me accounts that can be created by anyone for your application. This means that your game doesn't need any backend service to generate users for your game.

If you want to have restorable sessions for the users and you are using the web integration, then you can check out the guest accounts.

The example below shows how to create an anonymous user with the access token for the user and also how to merge it to their existing Ready Player Me account. This token is not restorable, if it gets lost or deleted so it needs to be stored in the user side or in your own database.

1. Creating an Anonymous User

You have an endpoint to create a new user, which generates an access token. This token doesn't expire.

Create anonymous user

POST https://api.readyplayer.me/v1/users

Request Body

Name
Type
Description

data.applicationId*

string

The id of the application you wish to link the user to.

{
    "data": {
        "visitedAt": "2023-10-22T15:42:58.190Z",
        "campaigns": [],
        "assets": [],
        "wallets": [],
        "partners": [
            "asfas-nr3il4"
        ],
        "_id": "65366366362cd70266fc9959",
        "deleteAt": "2024-01-23T12:13:26.615Z",
        "createdAt": "2023-10-23T12:13:26.616Z",
        "updatedAt": "2023-10-23T12:13:26.616Z",
        "__v": 0,
        "isAnonymous": true,
        "isGuest": false,
        "id": "65366366362cd70266fc9959",
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc0Fub255bW91cyI6dHJ1ZSwidXNlcklkIjoiNjUzNjYzNjYzNjJjZDcwMjY2ZmM5OTU5IiwiYWJpbGl0eSI6W1sibWFuYWdlIiwiQXZhdGFyIix7InVzZXJJZCI6IjY1MzY2MzY2MzYyY2Q3MDI2NmZjOTk1OSJ9XSxbIm1hbmFnZSIsIlVzZXIiLHsiX2lkIjoiNjUzNjYzNjYzNjJjZDcwMjY2ZmM5OTU5In1dLFsicmVhZCIsIlBhcnRuZXIiXSxbInJlYWQsY3JlYXRlIiwiT3JnYW5pemF0aW9uIl0sWyJ1c2UiLCJUcmFja2luZyIseyJfaWQiOnsiJGluIjpbIjY1MzY1YmViODQ3YjUxMTVmNzY3ZTM3YiJdfX1dLFsicmVhZCIsIkFwcGxpY2F0aW9uIl0sWyJyZWFkIiwiQXNzZXQiXSxbInVzZSIsIkFzc2V0Iix7ImxvY2tlZCI6eyIkbmUiOnRydWV9fV0sWyJ1c2UiLCJBc3NldCIseyJpZCI6eyIkaW4iOltdfX1dLFsidXNlIiwiQXNzZXRMaXN0RmlsdGVyIix7InF1ZXJ5LmZpbHRlclVzZXJJZCI6IjY1MzY2MzY2MzYyY2Q3MDI2NmZjOTk1OSJ9XSxbInVzZSIsIkFzc2V0Iix7Imdyb3Vwcy5pZCI6eyIkaW4iOltdfX1dLFsicG9zdCIsIldlYmhvb2tFdmVudCIseyJyb3V0aW5nS2V5Ijoic3R1ZGlvLXVpLnYxLmdldHRpbmctc3RhcnRlZC5jb21wbGV0ZWQifV0sWyJwb3N0IiwiV2ViaG9va0V2ZW50Iix7InJvdXRpbmdLZXkiOiJzdHVkaW8tdWkudjEuYWRkLWFwcGxpY2F0aW9uLmNvbXBsZXRlZCJ9XSxbInJlYWQiLCJDYW1wYWlnbiIsMCwwLCJpZCxuYW1lLGNyZWF0ZWRBdCx1cGRhdGVkQXQiXSxbInJlYWQiLCJBc3NldCIsMCwxLCJtb2RlbFVybCxuZnRJZCJdXSwiaWF0IjoxNjk4MDYzMjA2fQ.loUw_SBj2YfjZZp783AKNR2mZLzXLHLe7YQ8McPBkUU"
    }
}

2. Merging Anonymous Account to the Ready Player Me Account

If a user wishes to merge their anonymous account with an existing Ready Player Me account, they need to follow a process:

Initially, you send a code to the user's email linked with Ready Player Me:

POST https://api.readyplayer.me/v1/auth/request-login-code

Request Body

Name
Type
Description

email*

String

Email of the user

The user then uses this code to log in, which returns a user token. In this call you can also pass the anonymous user id if the user wishes to merge their current account to their RPM account:

Log user into Ready Player Me account

POST https://api.readyplayer.me/v1/auth/login

Request Body

Name
Type
Description

id

String

User id you want to merge

code*

String

Use Anonymous/RPM account token to update user

This access token is essential for the following actions:

Last updated