1. Community Logs
Returning.AI
  • Getting Started
  • Bulk Operations
    • Bulk user updates
    • List bulk update jobs
      GET
    • Get bulk update job status
      GET
    • Get bulk update job details
      GET
    • Bulk update users from CSV
      POST
    • Bulk update premium currency from CSV
      POST
  • Chart Analysis
    • Create Analysis
      POST
    • Get Analysis
      GET
    • Update Analysis
      PATCH
    • Delete Analysis
      DELETE
    • List Analyses
      GET
    • Append Drawings
      POST
  • Rewards & Redemptions
    • Redemption lifecycle
    • Store catalog to redemptions
    • Update redemption order status or refund
      PUT
    • List redemption orders by user email
      POST
    • List redemption statuses
      POST
    • Get redemption status by ID
      POST
    • List redemption orders by community
      POST
    • Create redemption order status
      POST
    • Get redemption order status history
      POST
    • List redemption orders by custom-field identifier
      POST
  • Gamification
    • Leaderboards
      • Leaderboards
      • List leaderboards with pagination
      • Create a new leaderboard
      • Update an existing leaderboard
      • Get a single leaderboard by ID
      • Delete a leaderboard
    • Streaks & Mini Games
      • Mini-game State and History
      • List user streak logs
      • List mini-game logs by user email
      • Get current mini-game and streak state
      • Update user spin-wheel information
    • Referral
      • Referral Program Integration
      • Get referral programs
      • Get user's referral summary
    • Rolling Data
    • Match Predictions
      • Create match prediction
      • List match predictions
      • Get match prediction
      • Patch match prediction
      • Publish match prediction
      • Settle match prediction
      • Get settlement results
      • Void match prediction
      • Bulk update match predictions
      • Get bulk job status
      • Get bulk job results
    • Loyalty Points
      • Create loyalty points export
      • Get loyalty points export status
      • Get loyalty points export download link
    • Quizzes
      • Create quiz
      • List quizzes
      • Get quiz
      • Update quiz
      • Delete quiz
      • Add quiz question
      • Update quiz question
      • Delete quiz question
    • Get tier configuration
      GET
    • Get daily user XP and coin changes
      POST
    • Search user gamification logs
      POST
    • Get user activity stats
      POST
  • Messaging
    • Agent messaging workflow
    • Get Messages
    • Send Message
    • Reply Message
    • React Message
    • Upload message images
  • Users
    • User directory and provisioning
    • Get Users with Filters
    • Create New User
    • Get User Data
    • Manage User Account
    • Get User Milestones
    • Update User Data, Identifier, And Roles
  • Channels
    • Iframe
    • List integration channels
  • Events
    • Outgoing webhooks
      • Encryption
      • User Joins Server
      • User Visits server
      • New Message Posted Anywhere
      • New Message Posted To channel
      • Purchased Store Item
    • Incoming webhooks
      • API Keys & Encryption
      • Send message into channels
      • Update Custom User Fields
      • Update In-game currency
  • Widgets
    • Authenticated Widgets
    • Public widgets
    • Channels
    • Leaderboard
    • Milestone
    • Socials
    • Store
  • Community Analytics
    • Get Loyalty Overview
    • Get Phone Verification Contacts
  • Store
    • Store journey
    • Store catalog
    • Purchase History
      • Archive or restore an order
      • Update redemption instructions or voucher details
    • Categories
      • List Store categories
      • Create Store category
      • Get Store category by ID
      • Update Store category
      • Delete Store category
    • Products
      • List products
      • Create products in bulk
      • Create product with vouchers
      • Update products in bulk
      • Read product
      • Update product and append vouchers
      • Delete product
    • Redemption-transaction
      • Get redemption transaction detail
    • Get Store configuration
    • Update Store configuration
  • Community
    • Community directory and appearance
    • Appearance
      • Update community theme colors
      • Update community bot profile
      • Update community URL metadata
      • Update community name and URL
    • Community Users
      • Get community users
      • Get user
    • Create community
  • User Fields
    • User field definitions and history
    • User Field History
      • List Community User-Field History
      • List One Field Across Users
      • List One User Across Fields
      • List One User's One Field
      • Update A User Field Value
      • Deprecated Field-First History Write
      • Deprecated Field-First History Read
    • Create A User Field Definition
    • Get A User Field Definition
    • Update A User Field Definition
    • Delete A User Field Definition
    • List User Field Definitions
  • API Keys
    • API key lifecycle
    • Community API Keys
      • Create API key
      • Read API keys
      • Delete API key
      • Update API key
    • User API Keys
      • List user API keys
      • Create user API key
      • Update user API key
      • Delete user API key
      • Get current API key information
  • Legacy
    • Servers
      • Create server
      • List servers
      • Update server metadata
    • Bulk Operations
      • Bulk import users from CSV
    • Authentication
      • Register user with password
      • Verify user email
      • Log in user with password
      • Secure Auth
    • Badges
      • List badges
      • Create badge
      • Update badge
      • Delete badge
      • Remove badge from user
      • Award badge to user
    • Messaging
    • Roles & Permissions
      • List server roles
      • Create role
      • Update role
      • Delete role
      • List user roles
      • Add role to user
      • Remove role from user
    • Users
      • Get user
      • Upload user avatar
    • Channels
      • Create channel
      • Update channel
      • Delete channel
    • API Keys
      • List integration API keys
      • Create integration API key
      • Delete integration API key
      • Update integration API key
  • Community Logs
    • Retrieve and export community logs
      GET
  1. Community Logs

Retrieve and export community logs

Developing
GET
https://sgtr-integration.returning.ai/apis/v1/community-logs

Overview#

Retrieve community logs as paginated JSON or export CSV. Implemented log types: gamification, milestone, api, miniGames, raffles, streaks, audit, referral, email, misconduct.

Authentication#

Send Authorization: Bearer <COMMUNITY_API_KEY> with readCommunityLogs permission. Community is derived from the API key; do not send communityId. Personal API keys are rejected.

Dates and pagination#

Required: logType, startDate, endDate. Dates are inclusive UTC ISO-8601 timestamps ending in Z; endDate must be on or after startDate. No maximum date span. JSON defaults to page=1 and limit=100 (maximum 500), newest first. API logs use receivedAt, wheel and raffle logs createdAt, quiz logs completedAt. Concurrent changes can shift page boundaries.

Shared filters#

All implemented log types support filters[action], filters[location], filters[userId], filters[email], filters[customFieldIdentifier]. Filters intersect; values within an array are alternatives. Each accepts a string or array, up to 100 values of 500 characters. Example: filters[action][]=Create New User. Email is an exact case-insensitive match; userId is the numeric platform user ID. customFieldIdentifier matches the configured community identifier. Unknown filters and nested operators are rejected. Broad identity lookups can return FILTER_TOO_BROAD.

Gamification logs#

logType=gamification. One row per XP or coin change: earned, deducted, adjusted, or expired. action matches the action label; location matches action location. JSON fields: id, userId, createdAt, user (display-name string), identifier (only when the community has an active identifier), email, action, action_details, action_location, roles (names), xp, currency, premiumCurrency, coinExpiry, date, time. Dates and times are UTC.
premiumCurrency is present only when the community's earning cap awards premium currency. coinExpiry is present only when coin expiry is enabled: it is TRUE on rows whose coins have expired and on the expiry deduction row itself (negative currency), otherwise empty. To total expired coins, sum the negative currency values on rows where coinExpiry is TRUE.
CSV columns: Ref ID, User, configured identifier, Email (omitted when the identifier is email), Action, Action Details, Action Location, Role, XP activity, coin activity, premium currency activity (when enabled), Coin Expiry (when enabled), Date, Time. Activity column headings use the community's configured unit names.
Rows do not include trade, campaign, or earning-cap details.

API logs#

logType=api. action matches API name (for example Create New User or Bulk Update Users); location matches request path. Identity filters select recorded request user identities. JSON/CSV fields: id, name, receivedAt, apiKeyName, duration, status, progress, statusCode, error. Missing values are null/empty; progress is numeric in JSON and a percentage in CSV.

Mini Games history#

logType=miniGames. filters[gameType]=spin_the_wheel (default) or quiz. Optional filters[miniGameId] selects one game by Mongo ID. Wheel action examples: Spin Earned, Spin Claimed; location matches game name or channel name. Quiz action is Completed, Passed or Failed; location matches game name.
Wheel columns: Ref ID, User, configured identifier, Email, Action, Action Details, Spin Count, Game Name, Roles, Date, Time. Quiz uses Result and Score instead of wheel action/spin columns. User is a display-name string; roles contain names. API dates/times are UTC; the settings UI may display local timezone.

Raffle logs#

logType=raffles. Optional filters[miniGameId] selects a raffle by its 24-character Mongo ID. Do not send filters[gameType]. All five shared filters are supported. location matches raffle name (exact, case-insensitive). email matches the displayed current profile email, with stored log email fallback.
Actions accept these labels or their codes: Tickets Purchased (raffle-ticket-purchased), Mission Completed (raffle-mission-completed), Mystery Prize Won (raffle-mystery-prize-won), Grand Prize Won (raffle-grand-prize-won), Prize Claimed (raffle-prize-claimed), Updated by Admin (raffle-admin-updated).
JSON fields: id, userId, createdAt, occurredAt, user (display-name string), identifierValue, email, action, actionDetails, awardSummary, raffleName, ticketCount, ticketCodes, roles (names), date, time. CSV follows the raffle table columns and includes all ticket codes. Dates/times are UTC.

Audit logs#

logType=audit. All five shared filters are supported. action matches recorded action text; location matches the recorded IP address. Optional filters[category], filters[actor], and filters[ip] accept a string or array (up to 100 values); values match exactly, case-insensitively. Filters intersect, including location and ip when both are supplied. Identity filters select the recorded actor.
JSON fields: id, userId, createdAt, user (display-name string), email, actor, roles (names), category, action, ipAddress, date, time. CSV columns: Date, Time, Email, User, Actor, Role, Category, Action, IP Address. Dates/times are UTC.

Referral logs#

logType=referral. All five shared filters are supported. userId, email and customFieldIdentifier select the referrer; email matches the stored referrer email shown in the table. location matches the recorded referral program name exactly (case-insensitive). action accepts referred_user, stage_cleared, program_cleared or the labels Referred User, Referral Stage Cleared, Referral Cleared; full labels with stage/program names are also supported.
JSON contains flat referrer/referee emails and identifiers, action display text, actionCode, actionDetail, xp, coins, date and time. CSV includes both identifier columns when configured and uses community XP/coin labels. Date/time values are UTC.
Example: logType=referral, startDate=2026-09-01T00:00:00Z, endDate=2026-09-30T23:59:59Z, format=json, filters[action]=Referred User. Use format=csv for a CDN download URL or queued Export History.

Email recipient logs#

logType=email returns recipient rows from email_logs. JSON uses flat email, senderEmail, named roles/tags, status display text, statusCode, details and UTC timestamps.
Shared filters select the recipient: userId is the legacy user ID; email matches stored recipient email; customFieldIdentifier matches the active custom field identifier. action selects Sent/success, Failed/failed, or Queued (pending and queued). location matches the sender email. These string/array filters intersect and use exact case-insensitive text matching.
Optional filters[batchId] is a 24-character MongoDB batch ID to select the recipient detail view.
CSV columns: No., Email, Roles, Tags, Status, Details. Small exports return a CDN download URL; large exports use Email Logs in Export Histories.

Misconduct logs#

logType=misconduct returns the Misconduct table selection from misconducts, excluding revoked and report-message entries. The date range selects createdAt inclusively. JSON uses flat user, penalty, reason, assignedBy, penaltyStartAt, penaltyEndAt, joinDate and joinTime fields; timestamps and CSV times are UTC.
All five shared filters intersect. action matches stored penalty codes exactly (case-insensitive), such as banned/Banned, suspended/Suspended and warned/Warned. userId, email and customFieldIdentifier select the affected user; email matches the current profile email. location matches exact stored location text when present (the current UI hides that column). String or array values are supported.
CSV columns: User, Penalty, Reason, Penalty Start, Penalty End, Assigned By, Join Date, Join Time. Small exports return a CDN URL; larger exports queue under Misconduct Logs in Export Histories.

CSV response#

format=csv exports all matches regardless of page/limit. HTTP 200 returns application/json with data.downloadUrl (CDN URL), fileName, fileSizeBytes and totalRecords. Download the URL to obtain CSV; the API does not return raw CSV or raw S3 URLs. Files use UTF-8 BOM, escaped cells and formula protection; empty results contain headers.

Large exports#

Exports exceeding the inline row/byte/time budget reuse the asynchronous Export Histories workflow and return HTTP 202 with a readable message and export history metadata. Check Export Histories for completion.

Examples#

API JSON: logType=api, startDate=2026-09-01T00:00:00Z, endDate=2026-09-24T23:59:59Z, format=json, page=1, limit=100.
Wheel CSV: same dates, logType=miniGames, format=csv, filters[gameType]=spin_the_wheel.
Quiz JSON: logType=miniGames, startDate=2023-09-01T00:00:00Z, endDate=2026-09-24T23:59:59Z, format=json, filters[gameType]=quiz.
Raffle JSON: logType=raffles, startDate=2026-09-01T00:00:00Z, endDate=2026-09-28T23:59:59Z, format=json, page=1, limit=100.
Raffle CSV: same selection with format=csv; HTTP 200 returns a CDN download URL, or HTTP 202 queues a Raffle Logs export.
Audit JSON: logType=audit, startDate=2026-09-01T00:00:00Z, endDate=2026-09-30T23:59:59Z, format=json, page=1, limit=10. Optional example: filters[actor]=Admin.
Audit CSV: same selection with format=csv; HTTP 200 returns an audit-logs.csv CDN download URL, or HTTP 202 queues an Audit Logs export.
See saved API cases for executable requests and recorded responses.

Errors#

400: invalid query/filter or FILTER_TOO_BROAD. 401/403: authentication, permission or community access failure. 503: query timeout or unable to confirm export handoff. Service errors include meta.code and detail.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Query Params

Responses

🟢200Success
application/json
Bodyapplication/json

🟢200CSV download
🟢202Export accepted
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --globoff 'https://sgtr-integration.returning.ai/apis/v1/community-logs?logType=audit&startDate=2026-09-01T00%3A00%3A00Z&endDate=2026-09-24T23%3A59%3A59Z&format=json&page=1&limit=100&filters[action]=&filters[location]=&filters[userId]=&filters[email]=&filters[customFieldIdentifier]=&filters[gameType]=&filters[miniGameId]=&filters[milestones]=&filters[category]=Login&filters[actor]=Admin&filters[ip]=192.0.2.1&filters[batchId]=507f1f77bcf86cd799439011' \
--header 'Authorization: Bearer <token>'
Response Response Example
200 - Gamification JSON page
{
  "meta": {
    "status": "success",
    "statusCode": 200
  },
  "message": "Get community logs success.",
  "data": {
    "communityId": "507f1f77bcf86cd799439011",
    "logType": "gamification",
    "startDate": "2026-09-01T00:00:00Z",
    "endDate": "2026-09-24T23:59:59Z",
    "filters": {},
    "totalRecords": 1,
    "currentPage": 1,
    "pageSize": 100,
    "totalPages": 1,
    "hasNextPage": false,
    "hasPreviousPage": false,
    "records": [
      {
        "id": "507f1f77bcf86cd799439099",
        "userId": 12345,
        "createdAt": "2026-09-20T12:30:00.000Z",
        "user": "Example Member",
        "email": "member@example.com",
        "action": "Edit",
        "action_details": "Added 10 XP",
        "action_location": "Admin",
        "roles": [
          "Member"
        ],
        "xp": 10,
        "currency": 0,
        "date": "20/09/2026",
        "time": "12:30"
      }
    ]
  }
}
Modified at 2026-10-02 04:58:40
Previous
Update integration API key
Built with