Retrieve and export community logs
Read your community's gamification, milestone, streak, mini-game, raffle, referral, API, email or audit 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
- Retry failed reads with backoff
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. Filters that accept multiple text values take up to 100 values of up to 500 characters each. 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). For miniGames, you can also send gameType and miniGameId. For milestone, use milestones to filter by milestone name. An unsupported filter for a log type returns 400.
Add one of these examples to GET /v1/community-logs along with startDate and endDate.
| Log type | Example query parameters | What they select |
|---|---|---|
| Streaks | logType=streaks&filters[location]=Welcome | Streak entries from the Welcome channel. |
| Raffles | logType=raffles&filters[miniGameId]=66f000000000000000000201 | Entries for one raffle. Raffles use miniGameId; sending gameType returns 400. |
| Referral | logType=referral&filters[action]=Referred%20User | Entries for the Referred User action. |
logType=email&filters[batchId]=66f000000000000000000501 | Recipients from one email batch. | |
| Audit | logType=audit&filters[ip]=192.0.2.1 | Entries from one IP address. You can also filter by category or actor. |
Request#
Query parameters#
misconduct is accepted but returns 501 until it is available.Rulegamification, milestone, streaks, miniGames, raffles, referral, api, email or audit
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. Streaks: the record's action or streakAction. Raffles: the record's action, such as Tickets Purchased or Prize Claimed. Referral: Referred User, Referral Stage Cleared or Referral Cleared, optionally followed by - and the stage or program name. Email: Sent, Failed or Queued. Audit: the record's action.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. Raffles: the raffle name. Streaks: the channel name. Referral: the referral program name. Email: the sender's email. Audit: the IP address. 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 and raffles only. One game's or raffle's ID.Rule24 hex characters
Eg"66f000000000000000000201"
milestone only. Only these milestones, by exact name.RuleString or array
Eg"Welcome journey"
email only. Only recipients of one email batch, by the record's batchId.Rule24 hex characters
Eg"66f000000000000000000501"
audit only. Only these categories, by exact value, not case-sensitive.RuleString or array
audit only. Only these actors, by the record's actor, not case-sensitive.RuleString or array
audit only. Only these IP addresses, by exact value.RuleString or array
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).raffles:id,userId(a string),createdAt,occurredAt(the same time ascreatedAt),user,identifierValue,email,action(such asTickets Purchased,Mission CompletedorPrize Claimed),actionDetails,awardSummary,raffleName,ticketCount,ticketCodes,roles,dateandtime.streaks:id,userId(a string),streakId,createdAt,user,email,identifierValue,action,streakAction,actionDetails,streakName,streakActivity(such asStreak Broken),totalStreakActivity,roles,dateandtime.referral:id,refId(such as#12),referrerUserId,referrerEmail,referrerIdentifierValue,refereeUserId,refereeEmail,refereeIdentifierValue,action(such asReferral Stage Cleared - <stage name>),actionCode,actionDetail,xp,coins,createdAt,dateandtime.email: one record per recipient:id,batchId,userId(nullwhen no trader matches the recipient),email,senderEmail,roles,tags,status(Sent,FailedorQueued),statusCode,details,createdAt,dateandtime.audit:id,userId(the user who acted, ornull),createdAt,user,email,actor,roles,category,action,ipAddress,dateandtime.
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. Identifier columns depend on your community's identifier setup and use the name of its active identifier field. XP and coin columns use 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.raffles: User, your identifier, Email, Action, Action Details, Award Summary, Raffle Name, Ticket Count, Ticket Code, Roles, Date, Time.streaks: User, your identifier, Streak Action, Action Details, Streak Name, Streak Activity, Total Streak, Role, Date, Time.referral: Ref ID, Email (Referrer), the referrer's identifier, Referred User (Referee), the referee's identifier, Action, Action Details, then your XP and coin unit names, Date, Time.email: No., Email, Roles, Tags, Status, Details.audit: Date, Time, Email, User, Actor, Role, Category, Action, IP Address.
For gamification, milestone, api and miniGames, a CSV that exceeds the inline limits (10,000 rows, 10 MiB or the processing time limit) can be queued. A 202 with meta.code EXPORT_ACCEPTED and data.exportId confirms it was queued. Download the finished file from Settings > Logs > Export Histories. Only one large export per log type runs at a time.
For streaks, raffles, referral, email and audit, CSV is available within the inline limits. A request that exceeds those limits returns 503 EXPORT_QUEUE_UNAVAILABLE. Export a shorter date range or add filters and retry.
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 backoffstreaks, raffles, referral, email and audit, narrow the date range or add filters so the CSV fits within the inline limits. For other supported types, check Settings > Logs > Export Histories before retrying.INTERNAL_ERRORRetry with backoffAUTHENTICATION_FAILEDRetry with backoffDo not retry01
NOT_IMPLEMENTEDDo not retrymisconduct is not available yet. Use another log type.Retries
After a network error or 500, retry with bounded exponential backoff. For 503, follow the action for the returned code. A CSV request can create a file or queue an export. Repeating a request for an export that is still pending returns the same exportId. New entries arrive at the top, so pages can shift while you page through a busy log. Match records by ID to skip ones you've already read. Over the rate limit, requests return 429. Wait for the window to reset, then retry.
{
"status": "fail",
"code": "VALIDATION_FAILED",
"message": "Invalid community log request.",
"detail": {
"endDate": "endDate must be on or after startDate"
}
}