Get mini-game and streak state
Read one trader's spin-wheel and streak state right now, by email.
- Method
- POST
- Path
https://api.returning.ai / v1/ users/ mini-game-streak-stats - Permission
- customerSuccess
- Retries
- Read-only; exact retries are safe
When to use this
- A trader asks why they can't spin a wheel, and support needs their current spins.
- Check whether a trader has cleared a wheel's mission or already spun today.
- Show a trader's current streak counts in your own support tool.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- customerSuccessShown in the dashboard as “Customer Success”
Use a Community API key with customerSuccess, and keep it on your server. The key decides which community's wheels and streaks you read.
Behaviour#
This read is worked out fresh on every request and changes nothing: it doesn't use spins or touch streaks. Values can differ between two calls if a spin is earned, used or expires in between. spinToday uses the UTC day, not the trader's or your time zone. spins, missionCleared, spinToday and currentStreak are separate signals; one doesn't imply another.
Request#
Headers#
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 your wheels and streaks at zero or false, not 404. Confirm the trader with Get User Data first if that matters.
RuleEmail format
Eg"trader@example.com"
curl --request POST \
--url https://api.returning.ai/v1/users/mini-game-streak-stats \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"email": "trader@example.com"
}'
Response#
A 200 returns data.wheels and data.streaks. Both can be empty when your community has no active wheels or streaks, and a trader can have every value at zero or false. That is a successful read, not an error. This endpoint has no top-level code; branch on the HTTP status.
Rulesuccess
RuleUser mini game and streak stats fetched successfully
Eg{ ... }
name.Eg[ ... ]
Eg"Daily Spin the Wheel"
RuleMin 0
Eg1
true when the trader has completed the wheel's mission for the current period.Egtrue
true when the trader has spun this wheel today, in UTC.Egfalse
0 when they have none.RuleMin 0
Eg3
name.Eg[ ... ]
Eg"Login Streak"
0 when they have none.RuleMin 0
Eg5
true when the trader has completed the streak's current, unexpired mission.Egtrue
{
"status": "success",
"message": "User mini game and streak stats fetched successfully",
"data": {
"wheels": [
{
"name": "Daily Spin the Wheel",
"spins": 1,
"missionCleared": true,
"spinToday": false,
"currentStreak": 3
}
],
"streaks": [
{
"name": "Login Streak",
"currentStreak": 5,
"missionCleared": true
}
]
}
}
Errors#
401 and 403 responses, and the authentication errors 404 COMMUNITY_NOT_FOUND and 500 AUTHENTICATION_FAILED, carry the code in meta.code. Other errors have no code: a 400 has detail.email explaining the problem, and 404 means no account uses that email.
Fix the request03
email is missing or isn't a valid email. detail.email says which. Correct it and send again.AUTHENTICATION_REQUIREDFix the requestAuthorization: Bearer <API_KEY> with a current Community API key.API_KEY_PERMISSION_DENIEDFix the requestcustomerSuccess, or it is a personal key. Use a Community API key and add the permission in Settings > Integration > API Keys.Fix the data02
COMMUNITY_NOT_FOUNDFix the dataRetry with backoff02
AUTHENTICATION_FAILEDRetry with backoff{
"meta": {
"status": "error",
"statusCode": 400
},
"message": "Get user mini game and streak stats endpoint validation error.",
"detail": {
"email": "Invalid email format"
},
"solution": "Check your body in request and try again"
}