Retrieve and export community logs
Read your community's gamification, milestone, API or mini-game logs for a date range, as JSON pages or as a CSV file to download.
- Method
- GET
- Path
https://api.returning.ai / v1/ community-logs - Permission
- readCommunityLogs
- Retries
- Read-only; exact retries are safe
When to use this
- Pull the XP and coin activity for a period into your own reporting or data warehouse.
- Check which API calls your integration made, which failed and why, without opening the dashboard.
- Export milestone completions or Spin the Wheel and quiz history as CSV for a campaign review.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- readCommunityLogsShown in the dashboard as “Get Community Logs”
Use a Community API key with the readCommunityLogs permission, and keep it on your server. The key decides the community, so never send a communityId; an unknown query key returns 400. Personal API keys are refused with 403.
Behaviour#
Records come newest first. Filters combine: a record must match every filter you send, and any one of the values within a filter. Each filter takes up to 100 values of up to 500 characters. Send one value as filters[userId]=3247779, or several by repeating filters[userId][]=.
action and location filters match the values stored when the entry was recorded. For most entries these are the labels in the response, but some gamification entries show a different label, so a filter can return more or fewer records than the labels suggest.
Each log type takes the five shared filters (action, location, userId, email, customFieldIdentifier). miniGames also takes gameType and miniGameId, and milestone also takes milestones. Any other filter returns 400.
Request#
Query parameters#
streaks, raffles, referral, email, misconduct and audit are accepted but return 501 until they are available.Rulegamification, milestone, api or miniGames
Eg"gamification"
RuleUTC timestamp ending in Z
Eg"2026-09-01T00:00:00Z"
RuleUTC timestamp ending in Z; not before startDate
Eg"2026-09-30T23:59:59Z"
json returns one page of records. csv returns a link to a CSV file with every match, and ignores page and limit.Rulejson (default) or csv
Eg"json"
1. A page past the end returns an empty records list.RuleWhole number from 1; default 1
Eg1
RuleDefault 100; max 500
Eg100
name, such as Create New User. Gamification: the action as recorded, usually the record's action. Milestones: Stage Completed or stage_completed and the other milestone actions. Spin the Wheel: Spin Earned, Spin Claimed and the other wheel actions. Quiz: Completed, Passed or Failed.RuleString, or repeat filters[action][]= for several
Eg"Create New User"
/apis prefix, such as /apis/v1/users for Create User. Gamification: the location as recorded, usually the record's action_location. Spin the Wheel: the game or channel name. Quiz: the game name. Milestone logs have no location, so any value returns no records.RuleString or array
Eg"/apis/v1/users"
RuleDigits; string or array
Eg"3247779"
RuleString or array
Eg"trader@example.com"
RuleString or array
Eg"<brokerCustomerId>"
miniGames only. Sending it with another log type returns 400.Rulespin_the_wheel (default) or quiz
Eg"quiz"
miniGames only. One game's ID.Rule24 hex characters
Eg"66f000000000000000000201"
milestone only. Only these milestones, by exact name.RuleString or array
Eg"Welcome journey"
Headers#
readCommunityLogs. The key decides the community.RuleBearer <API_KEY>
curl --request GET \
--url 'https://api.returning.ai/v1/community-logs?logType=gamification&startDate=2026-09-01T00:00:00Z&endDate=2026-09-30T23:59:59Z&page=1&limit=100' \
--header 'Authorization: Bearer <API_KEY>'
Response#
With format=json, a 200 returns one page in data.records. To read everything, start at page=1 and ask for the next page while data.hasNextPage is true. Dates in date and time are UTC (DD/MM/YYYY and HH:MM); the dashboard shows the same entries in your local time zone. Records by logType:
gamification:id,userId(a number),createdAt,user(display name),email,action,action_details,action_location,roles(role names),xp,currency,dateandtime.identifierappears when your community has an active identifier field (nullwhen the trader has no value),premiumCurrencywhen premium currency awards are on, andcoinExpiry(TRUEor empty) when coin expiry is on.milestone:_id,milestoneId,milestoneName,userId(a string),user,email(-when unknown),identifierValue,action(such asStage Completed),actionDetails,createdAt,updatedAt,dateandtime, plus the rewards given:xps,currencies,multiplier,multiplierAwarded,rolesandtags(names underadd,removeandoverwrite),badgesandcustomRewards.api:id,name(the operation, or the name you gave a bulk job),receivedAt,apiKeyName,duration(such as0.70 seconds, or empty),status(Queued,In progress,Complete,Complete with errors,ErrororCancelled),progress(0 to 100 for bulk jobs, otherwisenull),statusCode(nullwhen none was recorded) anderror.miniGameswithspin_the_wheel:id,userId(a string),createdAt,user,identifier,email,gameName,roles,date,time,action(such asSpin EarnedorSpin Claimed),actionDetailsandspinCount.miniGameswithquiz: the same first ten fields, withcreatedAtset to when the attempt was completed, plusattemptNumber,score(such as3/5) andresult(Passed,Failed, orCompletedfor quizzes without a pass mark).
With format=csv, a 200 returns a link instead of records. page and limit are ignored, and the file holds every match:
{
"meta": { "status": "success", "statusCode": 200 },
"message": "Get community logs success.",
"data": {
"downloadUrl": "https://media-cdn.returning.ai/community-logs/66f000000000000000000010/<fileId>_gamification-logs.csv" ,
"fileName": "gamification-logs.csv",
"fileSizeBytes": 6429,
"totalRecords": 55
}
}
The file is UTF-8 with a byte-order mark, so spreadsheet apps open it correctly. Text cells that start with =, +, - or @ get a leading ', so @all reads '@all. With no matches, the file holds the header row only. Treat downloadUrl as confidential and keep it on your server.
CSV columns follow the dashboard's own log exports. The identifier column is headed with your identifier field's name, and the XP and coin columns with your community's unit names:
gamification: Ref ID (#1is the oldest row), User, your identifier, Email, Action, Action Details, Action Location, Role, XP Activity, Coins Activity, then Premium Activity and Coin Expiry when those are on, Date, Time.milestone: User, your identifier, Email, Milestone Name, Action, Action Details, Rewards, Date, Time. Rewards lists roles, tags and custom rewards by ID.api: Request ID, Request received, Received at (UTC), API key name, Duration, Status, Progress (as a percentage), Status code, Error.miniGames: Ref ID, User, your identifier, Email, then Action, Action Details and Spin Count for the wheel or Attempt, Score and Result for quizzes, Game Name, Roles, Date, Time.
A CSV export over 10,000 rows or 10 MB, or one that takes too long to build, returns 202 with meta.code EXPORT_ACCEPTED and data.exportId. The file is then prepared in the background, and you download it from Settings > Logs > Export Histories in the dashboard. Only one large export per log type runs at a time.
Eg{"status": "success", "statusCode": 200}
success.Eg"success"
200.Eg200
Eg"Get community logs success."
json, or the download link for csv.Eg{ ... }
Eg"66f000000000000000000010"
logType you sent.Rulegamification, milestone, api, miniGames, raffles
Eg"gamification"
startDate you sent.Eg"2026-09-01T00:00:00Z"
endDate you sent.Eg"2026-09-30T23:59:59Z"
{}. For miniGames it includes gameType, even when you left it out.Eg{}
csv, the rows in the file.Eg55
Eg1
limit used.Eg100
limit. 0 when nothing matches.Eg1
true when there are more records after this page. Ask for page + 1.Egfalse
true on any page after the first, when something matches.Egfalse
logType; see Response below.Eg[ ... ]
GET; it needs no API key.gamification-logs.csv.{
"meta": {
"status": "success",
"statusCode": 200
},
"message": "Get community logs success.",
"data": {
"communityId": "66f000000000000000000010",
"logType": "gamification",
"startDate": "2026-09-01T00:00:00Z",
"endDate": "2026-09-30T23:59:59Z",
"filters": {},
"totalRecords": 55,
"currentPage": 1,
"pageSize": 100,
"totalPages": 1,
"hasNextPage": false,
"hasPreviousPage": false,
"records": [
{
"id": "66f000000000000000000301",
"userId": 3247779,
"createdAt": "2026-09-20T12:30:00.000Z",
"user": "Sample Trader",
"identifier": "<brokerCustomerId>",
"email": "trader@example.com",
"action": "Adjusted by admin",
"action_details": "Added 10 XP",
"action_location": "User List",
"roles": ["Gold Tier", "@all"],
"xp": 10,
"currency": 0,
"date": "20/09/2026",
"time": "12:30"
}
]
}
}
Errors#
A request that fails validation returns 400 with code VALIDATION_FAILED at the top level and a detail object naming each field, and no meta. Every other error carries its code in meta.code, with a readable detail.
Fix the request06
VALIDATION_FAILEDFix the requestZ, endDate before startDate, limit over 500, an unknown query key or a filter this log type doesn't take. detail names each field.VALIDATION_ERRORFix the requestpage × limit is too large, or customFieldIdentifier isn't a number when your identifier field is numeric. Lower page, or send numeric identifiers.FILTER_TOO_BROADFix the requestemail or customFieldIdentifier matches more than 1,000 traders, or on milestone logs userId and email together select more than 100. Send fewer or more specific values.AUTHENTICATION_REQUIREDFix the requestAuthorization: Bearer <API_KEY> with a current Community API key.API_KEY_PERMISSION_DENIEDFix the requestreadCommunityLogs, or it is a personal API key. Use a Community API key and add Get Community Logs in Settings > Integration > API Keys.COMMUNITY_ACCESS_DENIEDFix the requestreadCommunityLogs or expired. Check the key, then request the export again.Fix the data02
CUSTOM_IDENTIFIER_UNAVAILABLEFix the datauserId or email instead, or set up the identifier field.COMMUNITY_NOT_FOUNDFix the dataRetry with backoff07
EXPORT_IN_PROGRESSRetry with backoffQUERY_TIMEOUTRetry with backoffEXPORT_UPLOAD_FAILEDRetry with backoffEXPORT_STORAGE_UNAVAILABLERetry with backoffformat=json, or retry later and contact Returning.AI support if it persists.EXPORT_QUEUE_UNAVAILABLERetry with backoffINTERNAL_ERRORRetry with backoffAUTHENTICATION_FAILEDRetry with backoffDo not retry01
NOT_IMPLEMENTEDDo not retrygamification, milestone, api or miniGames.{
"status": "fail",
"code": "VALIDATION_FAILED",
"message": "Invalid community log request.",
"detail": {
"endDate": "endDate must be on or after startDate"
}
}