Loyi API Reference
  1. User
Loyi API Reference
  • Getting Started
  • Architecture
  • User
    • Users Overview
    • Create user
      POST
    • Get users
      GET
    • Get user
      GET
    • Update user
      PUT
    • Delete user
      DELETE
  • Reward
    • Rewards Overview
    • Create reward
      POST
    • Get rewards
      GET
    • Delete reward
      DELETE
    • Create entry pass code
      POST
    • Get entry pass code
      GET
    • Airdrop reward
      PUT
    • Award reward
      POST
    • Redeem rewards
      GET
  • Collection
    • Collection Overview
    • Create collection
      POST
    • Get collections
      GET
    • Get collection
      GET
    • Update collection
      PUT
    • Delete collection
      DELETE
    • Get rewards
      GET
  • Collectible
    • Claim collectible
      POST
    • Get collectibles
      GET
  • Quest
    • Quest Overview
    • Create quest
    • Get quests
    • Get quest
    • Update quest
    • Delete quest
    • Get participants
    • Accept quest
    • Submit answers
    • Get answers
  • Leaderboard
    • Leaderboard Overview
    • Get leaderboard
  • Leveling
    • Get leveling configuration
    • Configure leveling
    • Get milestone levels
    • Create milestone level
    • Get milestone level
    • Update milestone level
    • Delete milestone level
  1. User

Create user

Staging
https://testserver.loyi.io/public/api
Staging
https://testserver.loyi.io/public/api
POST
/user
User
Creates and returns a user. This endpoint returns the private key of the user. This is a secret key that should not be shared with anyone. We do not store users' private keys, so you need to store it somewhere safe.

Request

Authorization
Add parameter in header
x-api-key
Example:
x-api-key: ********************
Header Params
Origin
string 
required
The value must be one of the whitelisted domains. You can whitelist domain URLs on your Loyi dashboard.
Default:
<WHITELISTED_URL>
Example:
https://example.com
Body Params application/json
email
string <email>
required
Email of the user.
Example
{
    "email": "testuser@example.com"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://testserver.loyi.io/public/api/user' \
--header 'Origin;' \
--header 'Content-Type: application/json' \
--header 'x-api-key;' \
--data-raw '{
    "email": "testuser@example.com"
}'

Responses

🟢201Created
application/json
Created
Body
id
string <uuid>
required
email
string <email>
required
Email of the user.
wallet
string 
required
Wallet address of the user.
createdAt
string <date-time>
required
updatedAt
string <date-time>
required
levelingProgress
object 
required
currentLevel
number 
required
The current level of the user.
pointsCount
number 
required
The number of points the user has.
currentLevelStart
number 
required
The number of points the user needed to reach the current level.
nextLevelStart
number 
required
The number of points the user needs to reach the next level.
privateKey
string 
optional
The private key of the user. This is a secret key that should not be shared with anyone. We do not store users' private keys, so you need to store it somewhere safe.
Example:
0x664747255fb63a87f89b16042c9bc62166673b371751e0fe6238996b1b0a5b25
Example
{
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "email": "testuser@example.com",
    "wallet": "0x1234567890123456789012345678901234567890",
    "createdAt": "2022-01-01T00:00:00.000Z",
    "updatedAt": "2022-01-01T00:00:00.000Z",
    "levelingProgress": {
        "currentLevel": 1,
        "pointsCount": 220,
        "currentLevelStart": 200,
        "nextLevelStart": 250
    },
    "privateKey": "0x664747255fb63a87f89b16042c9bc62166673b371751e0fe6238996b1b0a5b25"
}
🟠400Bad Request
🟠401Unauthorized
Modified at 2025-06-19 21:23:41
Previous
Users Overview
Next
Get users
Built with