Returning.AIDevelopers
v1

API reference / Gamification / Streaks & Mini Games

.md

List mini-game logs by user email

List one trader's spin-the-wheel history in your community, newest first, one page at a time.

Last updated 26 Sep 2026API v1

Method
POST
Path
https://api.returning.ai/v1/mini-game-logs/by-email
Permission
customerSuccess
Retries
Read-only; exact retries are safe

When to use this

  • A trader says a spin disappeared, and support needs to see when it was earned, used or expired.
  • Check how a trader's wheel streak grew or broke, and which prize each spin paid.
  • Confirm that a spin or streak correction was recorded.

Authentication#

Header
Authorization: Bearer <API_KEY>
Permission
customerSuccessShown in the dashboard as “Customer Success”

Use a Community API key with customerSuccess, shown in the dashboard as Customer Success, and keep it on your server. The key decides the community: you only see entries from your own community. Entries can include a trader's email and prize claim details, so never call this endpoint from a browser or app.

Behaviour#

This read changes nothing. Each event writes one entry, so a trader's history reads as a timeline: a spin-earned entry is later followed by spin-used or spin-expired with the same spinInventoryId. Fields depend on action, so don't expect every field on every entry.

New events push older entries down while you page. To copy history, start at page 1 and use _id to skip entries you already have.

Request#

Headers#

Authorization#stringREQUIRED
Community API key with customerSuccess.

RuleBearer <API_KEY>

Content-Type#stringREQUIRED
Request body format.

Ruleapplication/json

Body#

Send the trader's email. The email lookup isn't limited to your community: an email that belongs to someone outside your community returns 200 with an empty list, not 404. limit and page also accept numbers sent as strings.

email#stringREQUIRED
The trader's email. Matched without regard to case.

RuleEmail format

Eg"trader@example.com"

limit#integerOPTIONAL
Entries per page.

RuleDefault 10; max 100

Eg20

page#integerOPTIONAL
Page number, starting at 1.

RuleWhole number, 1 or more; default 1

Eg1

curl --request POST \
  --url https://api.returning.ai/v1/mini-game-logs/by-email \
  --header 'Authorization: Bearer <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "trader@example.com",
    "limit": 20,
    "page": 1
  }'

Response#

A 200 returns the page in data.logs and the totals in data.pagination. An empty data.logs means the trader has no mini-game history in your community. It says nothing about whether they can spin now; read Get mini-game and streak state for that. This endpoint has no top-level code; branch on the HTTP status.

status#stringALWAYS
Result of the request.

Rulesuccess

message#stringALWAYS
Human-readable summary. Do not branch on it.

RuleMini game logs fetched successfully

data#objectALWAYS
The page of entries and the paging totals.

Eg{ ... }

logs#object[]ALWAYS
Entries on this page, newest first. Empty when the trader has no history in your community.

Eg[ ... ]

_id#stringALWAYS
The entry's ID.

Rule^[a-fA-F0-9]{24}$

Eg"66f000000000000000000701"

createdAt#stringALWAYS
When the event happened, ISO 8601 UTC. Use it for the timeline.

RuleDate-time

Eg"2026-09-26T08:30:00.000Z"

action#stringALWAYS
What happened: spin-earned, spin-used, spin-expired, spin-claimed, mission-progress, streak-earned, streak-broken, admin-updated, or a quiz-... value. Communities with raffles also see raffle-... values. Ignore values you don't recognise.

Eg"spin-earned"

actionDetails#string
A readable summary, such as Complete 3 trades Completed, Prize earned: 50 XP 10 Coins, streak: 4 days or Streak broken. Wording can change; don't parse it.

Eg"Complete 3 trades Completed"

miniGameType#stringALWAYS
The kind of game: spin_the_wheel or quiz, or raffle in communities with raffles.

Eg"spin_the_wheel"

gameName#stringALWAYS
The game's name when the entry was written. Names can change.

Eg"Daily Spin the Wheel"

miniGameId#stringALWAYS
The game's ID.

Rule^[a-fA-F0-9]{24}$

Eg"66f000000000000000000702"

userId#stringALWAYS
The trader's platform user ID, as a string.

RuleDecimal digits

Eg"3247779"

user#object
A copy of the trader's id, username, displayName, avatar and email when the entry was written. Personal data: match on userId instead, and don't store it.

Eg{ ... }

communityId#stringALWAYS
Your community ID.

Rule^[a-fA-F0-9]{24}$

Eg"66f000000000000000000010"

missionId#string
The mission that earned the spin, on spin-earned and mission-progress entries.

Eg"66f000000000000000000704"

missionName#string
The mission's name, on the same entries.

Eg"Complete 3 trades"

missionTimeframe#string
How often the mission resets.

Ruledaily, weekly or monthly

Eg"daily"

spinCount#number
Spins the trader had available after the event.

Eg1

expiresAt#string
When the earned spin expires, ISO 8601 UTC.

RuleDate-time

Eg"2026-09-26T23:59:59.999Z"

expiredAt#string
When the spin was marked expired, on spin-expired entries.

RuleDate-time

Eg"2026-08-26T09:30:00.000Z"

prizeReward#object
The prize before any streak multiplier, as xp and currency (coins). On spin-used and spin-claimed entries.

Eg{}

currency#number
Coins.

Eg25

xp#number
XP.

Eg10

finalReward#object
What the trader received after the multiplier, as xp and currency (coins).

Eg{}

currency#number
Coins.

Eg25

xp#number
XP.

Eg10

multiplier#number
The streak multiplier applied to the prize.

Eg2

streakBefore#number
The trader's wheel streak before the event.

Eg2

streakAfter#number
The trader's wheel streak after the event. 0 on streak-broken.

Eg3

streakTimeframe#string
The streak period, on streak and correction entries: daily, weekly or monthly.
highestStreak#number
The trader's best streak on this wheel, on streak-earned entries.

Eg5

spinsBefore#number
Available spins before a correction, on admin-updated entries that changed spins.
spinsAfter#number
Available spins after the correction.
spinsAdded#number
Spins the correction added.
spinsRemoved#number
Spins the correction removed.
adminUser#object
Who made an admin-updated correction. Corrections made through the API show username API Admin.
spinInventoryId#string
ID of the spin the entry is about. Use it to pair a spin-earned entry with the later spin-used or spin-expired entry.

Rule^[a-fA-F0-9]{24}$

Eg"66f000000000000000000703"

updatedAt#stringALWAYS
When the entry last changed, ISO 8601 UTC.

RuleDate-time

Eg"2026-09-26T08:30:00.000Z"

actionArray#string[]
Extra detail about the actions behind a mission. Its shape can change; don't rely on it.

Eg["profile_completed"]

actionId#string
An identifier for the event behind the entry. Treat it as opaque text.

Eg"64b000000000000000000701"

actionLogs#object
Extra detail about the actions behind a mission. Its shape can change; don't rely on it.

Eg[{"action": "profile_completed"}]

customFieldResponses#object[]
Details the trader entered to claim a prize, on spin-claimed entries. Personal data.

Eg[{"field": "segment", "value": "starter"}]

spinResultId#string
ID of the spin's result, on spin-used and spin-claimed entries.

Rule^[a-fA-F0-9]{24}$

Eg"64b000000000000000000501"

pagination#objectALWAYS
Paging totals for all of the trader's entries in your community.

Eg{"total": 1, "page": 1, "limit": 20, "totalPages": 1}

total#integerALWAYS
Entries across all pages.

RuleMin 0

Eg1

page#integerALWAYS
The page you asked for.

RuleMin 1

Eg1

limit#integerALWAYS
The page size used.

Rule1-100

Eg20

totalPages#integerALWAYS
Pages at this limit. 0 when there are no entries.

RuleMin 0

Eg1

{
  "status": "success",
  "message": "Mini game logs fetched successfully",
  "data": {
    "logs": [
      {
        "_id": "66f000000000000000000701",
        "communityId": "66f000000000000000000010",
        "miniGameId": "66f000000000000000000702",
        "userId": "3247779",
        "user": {
          "id": "3247779",
          "username": "sample_trader",
          "displayName": "Sample Trader",
          "avatar": "",
          "email": "trader@example.com"
        },
        "gameName": "Daily Spin the Wheel",
        "miniGameType": "spin_the_wheel",
        "action": "spin-earned",
        "actionDetails": "Complete 3 trades Completed",
        "missionId": "66f000000000000000000704",
        "missionName": "Complete 3 trades",
        "missionTimeframe": "daily",
        "spinInventoryId": "66f000000000000000000703",
        "spinCount": 1,
        "expiresAt": "2026-09-26T23:59:59.999Z",
        "createdAt": "2026-09-26T08:30:00.000Z",
        "updatedAt": "2026-09-26T08:30:00.000Z"
      }
    ],
    "pagination": {
      "total": 1,
      "page": 1,
      "limit": 20,
      "totalPages": 1
    }
  }
}

Errors#

Errors on this endpoint have no machine-readable code; branch on the HTTP status. A key without customerSuccess gets 401, not 403, with only a message. A validation 400 names the field in detail.

Fix the request02

400Fix the request
email is missing or isn't an email, limit is outside 1-100, or page is below 1. detail names each field. Correct it and send again.
401Fix the request
The key is missing, invalid or expired, it's a personal key, or it lacks customerSuccess (message is then Your api key does not have permission to access this action). Send Authorization: Bearer <API_KEY> with a current Community API key, and add Customer Success in Settings > Integration > API Keys.

Fix the data01

404Fix the data
No account uses this email. Check the email, or look the trader up with Get User Data. A trader with no history returns 200 with an empty list, not 404.

Retry with backoff01

500Retry with backoff
The entries could not be read, or the key could not be checked (Authentication failed). Retry the same request with exponential backoff.
{
  "meta": {
    "status": "error",
    "statusCode": 400
  },
  "message": "Get mini game logs by email endpoint validation error.",
  "detail": {
    "limit": "Number must be less than or equal to 100"
  },
  "solution": "Check your body in request and try again"
}

Next step#

Get mini-game and streak statePOST/v1/users/mini-game-streak-statsRead the same trader's spins and streaks as they are right now.