Returning.AIDocs
v1

API reference / Community Logs

.md

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.

Last updated 30 Sep 2026API v1

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#

logType#stringREQUIRED
The log to read. streaks, raffles, referral, email, misconduct and audit are accepted but return 501 until they are available.

Rulegamification, milestone, api or miniGames

Eg"gamification"

startDate#stringREQUIRED
Start of the range, inclusive. API logs are matched on when the request arrived, quiz attempts on when they were completed, and everything else on when the entry was created.

RuleUTC timestamp ending in Z

Eg"2026-09-01T00:00:00Z"

endDate#stringREQUIRED
End of the range, inclusive. There is no maximum span.

RuleUTC timestamp ending in Z; not before startDate

Eg"2026-09-30T23:59:59Z"

format#stringOPTIONAL
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"

page#integerOPTIONAL
JSON only. The page to return, starting at 1. A page past the end returns an empty records list.

RuleWhole number from 1; default 1

Eg1

limit#integerOPTIONAL
JSON only. Records per page.

RuleDefault 100; max 500

Eg100

filters[action]#stringOPTIONAL
Only these actions. API logs: the record's 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"

filters[location]#stringOPTIONAL
Only these locations. API logs: the request path with an /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"

filters[userId]#stringOPTIONAL
Only these traders, by platform user ID.

RuleDigits; string or array

Eg"3247779"

filters[email]#stringOPTIONAL
Only traders with these emails. Exact match, not case-sensitive. API logs also match an email sent in the request body.

RuleString or array

Eg"trader@example.com"

filters[customFieldIdentifier]#stringOPTIONAL
Only traders with these values in your community's active identifier field, usually the broker customer ID. Text values match exactly, not case-sensitive.

RuleString or array

Eg"<brokerCustomerId>"

filters[gameType]#stringOPTIONAL
miniGames only. Sending it with another log type returns 400.

Rulespin_the_wheel (default) or quiz

Eg"quiz"

filters[miniGameId]#stringOPTIONAL
miniGames only. One game's ID.

Rule24 hex characters

Eg"66f000000000000000000201"

filters[milestones]#stringOPTIONAL
milestone only. Only these milestones, by exact name.

RuleString or array

Eg"Welcome journey"

Headers#

Authorization#stringREQUIRED
Community API key with 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, date and time. identifier appears when your community has an active identifier field (null when the trader has no value), premiumCurrency when premium currency awards are on, and coinExpiry (TRUE or empty) when coin expiry is on.
  • milestone: _id, milestoneId, milestoneName, userId (a string), user, email (- when unknown), identifierValue, action (such as Stage Completed), actionDetails, createdAt, updatedAt, date and time, plus the rewards given: xps, currencies, multiplier, multiplierAwarded, roles and tags (names under add, remove and overwrite), badges and customRewards.
  • api: id, name (the operation, or the name you gave a bulk job), receivedAt, apiKeyName, duration (such as 0.70 seconds, or empty), status (Queued, In progress, Complete, Complete with errors, Error or Cancelled), progress (0 to 100 for bulk jobs, otherwise null), statusCode (null when none was recorded) and error.
  • miniGames with spin_the_wheel: id, userId (a string), createdAt, user, identifier, email, gameName, roles, date, time, action (such as Spin Earned or Spin Claimed), actionDetails and spinCount.
  • miniGames with quiz: the same first ten fields, with createdAt set to when the attempt was completed, plus attemptNumber, score (such as 3/5) and result (Passed, Failed, or Completed for 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:

JSON
{
  "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 (#1 is 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.

meta#objectALWAYS
Result details.

Eg{"status": "success", "statusCode": 200}

status#stringALWAYS
success.

Eg"success"

statusCode#integerALWAYS
200.

Eg200

message#stringALWAYS
Human-readable summary. Do not branch on it.

Eg"Get community logs success."

data#objectALWAYS
A page of records for json, or the download link for csv.

Eg{ ... }

communityId#stringJSON ONLY
Your community's ID, taken from the API key.

Eg"66f000000000000000000010"

logType#stringJSON ONLY
The logType you sent.

Rulegamification, milestone, api, miniGames, raffles

Eg"gamification"

startDate#stringJSON ONLY
The startDate you sent.

Eg"2026-09-01T00:00:00Z"

endDate#stringJSON ONLY
The endDate you sent.

Eg"2026-09-30T23:59:59Z"

filters#objectJSON ONLY
The filters you sent, or {}. For miniGames it includes gameType, even when you left it out.

Eg{}

totalRecords#integerALWAYS
Records that match, across all pages. For csv, the rows in the file.

Eg55

currentPage#integerJSON ONLY
The page returned.

Eg1

pageSize#integerJSON ONLY
The limit used.

Eg100

totalPages#integerJSON ONLY
Pages at this limit. 0 when nothing matches.

Eg1

hasNextPage#booleanJSON ONLY
true when there are more records after this page. Ask for page + 1.

Egfalse

hasPreviousPage#booleanJSON ONLY
true on any page after the first, when something matches.

Egfalse

records#object[]JSON ONLY
This page of records, newest first. The fields depend on logType; see Response below.

Eg[ ... ]

downloadUrl#stringCSV ONLY
HTTPS link to the CSV file. Download it with a plain GET; it needs no API key.
fileName#stringCSV ONLY
The file name, such as gamification-logs.csv.
fileSizeBytes#integerCSV ONLY
The file size in bytes.
{
  "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

400VALIDATION_FAILEDFix the request
A query value is missing or breaks its rule, such as a date without Z, endDate before startDate, limit over 500, an unknown query key or a filter this log type doesn't take. detail names each field.
400VALIDATION_ERRORFix the request
page × limit is too large, or customFieldIdentifier isn't a number when your identifier field is numeric. Lower page, or send numeric identifiers.
400FILTER_TOO_BROADFix the request
email 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.
401AUTHENTICATION_REQUIREDFix the request
The key is missing, invalid or expired. Send Authorization: Bearer <API_KEY> with a current Community API key.
403API_KEY_PERMISSION_DENIEDFix the request
The key lacks readCommunityLogs, or it is a personal API key. Use a Community API key and add Get Community Logs in Settings > Integration > API Keys.
403COMMUNITY_ACCESS_DENIEDFix the request
A large CSV export was refused because the key lost readCommunityLogs or expired. Check the key, then request the export again.

Fix the data02

400CUSTOM_IDENTIFIER_UNAVAILABLEFix the data
Your community has no active custom identifier field. Filter by userId or email instead, or set up the identifier field.
404COMMUNITY_NOT_FOUNDFix the data
The community this key belongs to no longer exists. Contact Returning.AI support.

Retry with backoff07

429EXPORT_IN_PROGRESSRetry with backoff
Another large export of this log type is still running. Wait for it in Settings > Logs > Export Histories, then request again.
503QUERY_TIMEOUTRetry with backoff
The read took too long. Narrow the date range or add filters, then retry.
503EXPORT_UPLOAD_FAILEDRetry with backoff
The CSV file could not be stored. Retry the same request after a few seconds.
503EXPORT_STORAGE_UNAVAILABLERetry with backoff
CSV downloads are unavailable. Use format=json, or retry later and contact Returning.AI support if it persists.
503EXPORT_QUEUE_UNAVAILABLERetry with backoff
A large export may or may not have been queued. Check Settings > Logs > Export Histories before you request it again.
500INTERNAL_ERRORRetry with backoff
The logs could not be read. Retry the same request with exponential backoff.
500AUTHENTICATION_FAILEDRetry with backoff
The key could not be checked. Retry the same request with exponential backoff.

Do not retry01

501NOT_IMPLEMENTEDDo not retry
This log type is not available yet. Use gamification, milestone, api or miniGames.
{
  "status": "fail",
  "code": "VALIDATION_FAILED",
  "message": "Invalid community log request.",
  "detail": {
    "endDate": "endDate must be on or after startDate"
  }
}

Next step#

Get User DataPOST/v1/users/infoLook up the trader behind a record's userId or email.