Search user gamification logs
List one trader's XP and coin changes in your community, newest first, with optional date, time and action filters.
- Method
- POST
- Path
https://api.returning.ai / v1/ gamifications/ logs - Permission
- getUserStats
- Retries
- Read-only; exact retries are safe
When to use this
- A trader asks why their coins went down, and support needs every change with its reason.
- Explain a day's total from Get daily user XP and coin changes, one entry at a time.
- Copy a trader's XP and coin history into your CRM.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- getUserStatsShown in the dashboard as “Get User Stats”
Use a Community API key with getUserStats, shown in the dashboard as Get User Stats, and keep it on your server. The key decides the community: user only matches traders in it, and you only see changes made in it.
Behaviour#
This read changes nothing. Changes to a trader's XP and coins add entries here, including corrections made through Update User XP and Currency. An XP and coin change made in the same request can share one entry, with both xp and currency set.
Filters combine, and every date and time is UTC. date bounds take whole days. time bounds compare the time of day on every date, so gte 22:00 with lte 02:00 matches nothing. Other keys inside date or time are ignored.
A trader's history stays readable after they are deleted with Manage User Account.
New entries push older ones down while you page. To copy history, page through one finished day at a time and use _id to skip entries you already have.
Request#
Headers#
Body#
Send user, plus any filters. page and limit must be JSON numbers; strings such as "1" are rejected. A date value that isn't a date returns 500, so check dates before you send them.
RuleEmail or platform user ID
Eg"trader@example.com"
Eg{"gte": "2026-09-01", "lte": "2026-09-30"}
RuleYYYY-MM-DD
Eg"2026-09-01"
RuleYYYY-MM-DD
Eg"2026-09-30"
RuleYYYY-MM-DD
Eg"2026-08-31"
RuleYYYY-MM-DD
Eg"2026-10-01"
RuleHH:MM, 24-hour
Eg"08:59"
RuleHH:MM, 24-hour
Eg"09:00"
RuleHH:MM, 24-hour
Eg"17:00"
RuleHH:MM, 24-hour
Eg"17:00"
action labels, such as Add or Adjusted by admin. Matched exactly, including case.RuleArray of labels
Eg["Add"]
RuleJSON number, 1 or more; default 1
Eg1
RuleDefault 100
Eg50
curl --request POST \
--url https://api.returning.ai/v1/gamifications/logs \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"user": "trader@example.com",
"date": {
"gte": "2026-09-01",
"lte": "2026-09-30"
},
"limit": 50,
"page": 1
}'
Response#
A 200 returns the page in data.data and the totals in data.pagination. The body has no message or code; branch on the HTTP status. xp, action and action_details are left out of an entry that doesn't have them.
Rulesuccess
Eg{ ... }
Eg{ ... }
RuleMin 0
Eg2
RuleMin 1
Eg1
limit. 0 when nothing matches.RuleMin 0
Eg1
true when a later page has entries.Egfalse
true when page is above 1.Egfalse
Eg[ ... ]
Eg"66f000000000000000000741"
RuleEmail format
Eg"trader@example.com"
Add, Subtract or Adjusted by admin. Can be missing on older entries.Eg"Adjusted by admin"
Added 150 XP or Overwrite 200 XP. Can be missing on older entries.RuleNullable
Eg"Overwrite 200 XP"
Eg200
0 when only XP changed.Eg0
YYYY-MM-DD.RuleDate
Eg"2026-09-26"
HH:MM.Rule^([01]\d|2[0-3]):[0-5]\d$
Eg"08:45"
{
"status": "success",
"data": {
"pagination": {
"total": 2,
"currentPage": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
},
"data": [
{
"_id": "66f000000000000000000741",
"email": "trader@example.com",
"action": "Adjusted by admin",
"action_details": "Overwrite 200 XP",
"xp": 200,
"currency": 0,
"date": "2026-09-26",
"time": "08:45"
},
{
"_id": "66f000000000000000000740",
"email": "trader@example.com",
"action": "Add",
"action_details": "Added 150 XP",
"xp": 150,
"currency": 25,
"date": "2026-09-26",
"time": "08:30"
}
]
}
}
Errors#
Errors on this endpoint have no machine-readable code; branch on the HTTP status. A key without getUserStats gets 401, not 403, with only a message. A validation 400 names each field in detail.
Fix the request02
user, date or time not an object, action not an array, limit outside 1-100, or page or limit sent as a string. detail names each field.getUserStats (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 Get User Stats in Settings > Integration > API Keys.Fix the data01
user matches no trader in your community. Check the email or platform user ID. A trader with no changes returns 200 with an empty list, not 404.Retry with backoff01
date value isn't a date, or the key could not be checked (Authentication failed). Check the dates, then retry with exponential backoff.{
"meta": {
"status": "error",
"statusCode": 400
},
"message": "Get gamification logs endpoint validation error.",
"detail": {
"user": "Required"
},
"solution": "Check your body in request and try again"
}