Get daily user XP and coin changes
Get the net XP and coin change for up to 100 traders on one UTC day.
- Method
- POST
- Path
https://api.returning.ai / v1/ users/ activity/ daily - Permission
- getUserStats
- Retries
- Read-only; exact retries are safe
When to use this
- Pay out or report on what traders earned yesterday, in one request per day.
- Check a trader's XP and coin movement on the day they raised a support case.
- Reconcile your own reward records against Returning.AI for a given date.
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: totals only count XP and coins earned in your community.
Behaviour#
This read changes nothing. Each total is the sum of every XP and coin change the trader had in your community between 00:00 and 23:59:59 UTC on date, positive and negative. It is not the trader's balance; read that with Get User Data.
An overwrite that sets a trader's balance directly can be counted as the full new balance for that day rather than the difference. For example, a trader who earned 150 XP, was set to 200 XP, then had 200 XP subtracted on the same day shows xp: 150, although their balance moved from 0 back to 0. Check days with overwrites against Search user gamification logs.
Request#
Headers#
Body#
Send identifier, identifier_type and date. Email lookups ignore case. Platform user IDs match any account; a trader from outside your community comes back with 0 for both totals. A trader with no changes that day also returns 0, which is a real result, not a missing trader.
To check more than 100 traders, send separate requests. page and limit only split the identifiers you send in one request.
identifier_type.RuleString, or array of 1-100 strings
Eg["trader@example.com"]
email or userId (platform user ID). userID is rejected.Ruleemail or userId
Eg"email"
31/02/2026, returns 500.RuleDD/MM/YYYY
Eg"26/09/2026"
limit.RuleJSON number, 1 or more; default 1
Eg1
RuleDefault 100
Eg100
curl --request POST \
--url https://api.returning.ai/v1/users/activity/daily \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"identifier": ["trader@example.com"],
"identifier_type": "email",
"date": "26/09/2026"
}'
Response#
A 200 returns one row per matched identifier in data.results. Compare data.pagination.found with the number of identifiers you sent to spot ones that matched no trader. This endpoint has no top-level code; branch on the HTTP status.
Rulesuccess
RuleUser gamification stats fetched successfully
Eg{ ... }
Rule^\d{2}/\d{2}/\d{4}$
Eg"26/09/2026"
Eg{ ... }
RuleMin 1
Eg1
Rule1-100
Eg100
RuleMin 0
Eg1
limit.RuleMin 0
Eg1
RuleMin 0
Eg1
Eg[ ... ]
Eg"trader@example.com"
Rule^[a-fA-F0-9]{24}$
Eg"<userObjectId>"
Rule^\d{2}/\d{2}/\d{4}$
Eg"26/09/2026"
Eg25
Eg150
{
"status": "success",
"message": "User gamification stats fetched successfully",
"data": {
"date": "26/09/2026",
"pagination": {
"page": 1,
"limit": 100,
"total": 1,
"total_pages": 1,
"found": 1
},
"results": [
{
"identifier": "trader@example.com",
"user_id": "<userObjectId>",
"date": "26/09/2026",
"coins": 25,
"xp": 150
}
]
}
}
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 validation 400 names each field in detail, and a 500 carries the reason in detail.
Fix the request03
identifier_type isn't email or userId, date isn't DD/MM/YYYY, more than 100 identifiers, or page or limit out of range or sent as a string. detail names each field. An empty identifier returns 400 with message At least one identifier is required and no detail.AUTHENTICATION_REQUIREDFix the requestAuthorization: Bearer <API_KEY> with a current Community API key.API_KEY_PERMISSION_DENIEDFix the requestgetUserStats, or it is a personal key. Use a Community API key and add Get User Stats in Settings > Integration > API Keys.Fix the data01
COMMUNITY_NOT_FOUNDFix the dataRetry with backoff02
detail mentions Invalid Date, the date doesn't exist; fix it rather than retrying. Otherwise retry the same request with exponential backoff.AUTHENTICATION_FAILEDRetry with backoff{
"meta": {
"status": "error",
"statusCode": 400
},
"message": "Get user gamification stats endpoint validation error.",
"detail": {
"date": "Date must be in DD/MM/YYYY format"
},
"solution": "Check your body in request and try again"
}