1. Community Analytics
Returning.AI
  • Getting Started
  • Users
    • User directory and provisioning
    • Get Users with Filters
      POST
    • Create New User
      POST
    • Get User Data
      POST
    • Manage User Account
      POST
    • Get User Milestones
      POST
    • Update User Data, Identifier, And Roles
      POST
    • Update User XP and Currency
      POST
  • Messaging
    • Agent messaging workflow
    • Get Messages
      GET
    • Send Message
      POST
    • Reply Message
      POST
    • React Message
      POST
    • Upload message images
      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
      • Get Daily Calculation Data
      • Get Rolling Calculation Data
    • Match Predictions
    • Get tier configuration
      GET
    • Get daily user XP and coin changes
      POST
    • Search user gamification logs
      POST
    • Get user activity stats
      POST
  • Rewards & Redemptions
    • Store catalog to redemptions
    • Update redemption order status or refund
    • List redemption orders by user email
    • List redemption statuses
    • Get redemption status by ID
    • List redemption orders by community
    • Create redemption order status
    • Get redemption order status history
  • Chart Analysis
    • Create Analysis
    • Get Analysis
    • Update Analysis
    • Delete Analysis
    • List Analyses
    • Append Drawings
  • Bulk Operations
    • Bulk user updates
    • List bulk update jobs
    • Get bulk update job status
    • Get bulk update job details
    • Bulk update users from CSV
    • Bulk update premium currency from CSV
  • 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
    • Get Phone Verification Contacts
      GET
  • Store
    • Store catalog
    • Purchase History
      • 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
      • Update products in bulk
      • Create products in bulk
      • Create product with vouchers
      • 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
  • 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
  • User Fields
    • User field definitions and history
    • User Field History
      • Get all user field histories in a community
      • Get user field histories for a specific field
      • Get user field histories for a specific user
      • Get user field histories of specific user field and user
      • Update A User Field Value
      • Deprecated Field-First History Write
      • Deprecated Field-First History Read
    • Get A User Field Definition
    • Update A User Field Definition
    • Create A User Field Definition
    • Delete A User Field Definition
    • List User Field Definitions
  • Legacy
    • Servers
      • Create server
      • List servers
      • Update server metadata
    • Bulk Operations
      • Bulk import users from CSV
    • Authentication
      • Secure Auth
      • Register user with password
      • Verify user email
      • Log in user with password
    • 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
  1. Community Analytics

Get Loyalty Overview

GET
/v1/community-analytics/loyalty-overview

What this endpoint does#

Returns a read-only, paginated loyalty summary for the whole community associated with the Bearer API key. It returns one row per matching client on the requested page; it is not a single-user lookup.
Use it for:
customer-success and loyalty reporting;
scheduled community exports;
reconciliation of XP, coin balances, redemptions, roles, and loyalty visits.
The API key determines the community automatically. Do not send a community ID. This endpoint does not change balances, users, roles, or redemption records.

Quick start#

Authentication and permission#

Use a community API key in the Authorization header:
The key must be active, scoped to the intended community, and include the customerSuccess permission. Missing, invalid, expired, or under-permissioned keys currently return HTTP 401.

Pagination and date filtering#

page is 1-based and defaults to 1.
limit defaults to 100 and cannot exceed 500.
from and to are optional ISO 8601 date-times. They filter by the client's community membership join timestamp, inclusively.
The endpoint does not currently support filtering by email or client_id.
Example with an inclusive date window:
Follow data.pagination until page reaches totalPages. An empty result is successful and returns HTTP 200 with data.data: [].

Response fields#

FieldMeaning
client_idReturning.AI platform client ID.
emailClient email when available. Treat as personal data.
current_xp_balanceCurrent XP balance.
current_coin_balanceCurrent loyalty coin balance.
lifetime_coins_redeemedLifetime number of coins redeemed through the Returning.AI store.
rolesCommunity role titles currently resolved for the client.
login_countCount of recorded daily loyalty visits.
first_loyalty_loginCommunity membership join timestamp used by from and to; may be null.
last_loyalty_loginMost recent recorded application login timestamp; may be null.

Errors and recovery#

400: Fix invalid pagination or date-time query values. page must be at least 1; limit must be between 1 and 500.
401: Check that the Bearer key is present, valid, active, scoped to the correct community, and has customerSuccess permission. Do not retry unchanged credentials repeatedly.
429: The community request limit was exceeded. Inspect the RateLimit response header and retry after the indicated window resets.
500: Retry with bounded backoff. If the error persists, contact Returning.AI support with the request time and non-sensitive request details.

Retry safety and privacy#

This is a read-only request, so retrying the same page is safe. Export pages sequentially and use the pagination metadata rather than assuming a fixed community size. Responses contain client identifiers, emails, balances, roles, and activity timestamps; store and transmit them according to your customer-data controls.

Gotchas#

from and to filter the community membership join timestamp, not the last login or redemption date.
A range where from is later than to currently returns an empty successful result; validate the range in your client.
Balances and lifetime redemption values are numeric and may contain decimals even when an example contains whole numbers.

Request

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

Header Params

Responses

🟢200Success
application/json
Returns a populated or empty page of community loyalty summaries.
Bodyapplication/json

🟠400Invalid Query
🟠401Authentication or Permission Error
🟠429Rate Limit Exceeded
🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://adss-integration.returning.ai/apis/v1/community-analytics/loyalty-overview?page=1&limit=100&from=2026-01-01T00%3A00%3A00.000Z&to=2026-01-31T23%3A59%3A59.999Z' \
--header 'Authorization: Bearer <token>'
Response Response Example
200 - Populated page
Synthetic example; no real client data.
{
  "status": "success",
  "message": "Loyalty overview fetched successfully",
  "data": {
    "data": [
      {
        "client_id": "123456",
        "email": "client@example.com",
        "current_xp_balance": 2450.5,
        "current_coin_balance": 380.25,
        "lifetime_coins_redeemed": 1250,
        "roles": [
          "Client"
        ],
        "login_count": 42,
        "first_loyalty_login": "2026-01-05T08:30:00.000Z",
        "last_loyalty_login": "2026-08-16T14:22:10.000Z"
      }
    ],
    "pagination": {
      "total": 224,
      "page": 1,
      "limit": 100,
      "totalPages": 3
    }
  }
}
Modified at 2026-08-17 07:03:34
Previous
Store
Next
Get Phone Verification Contacts
Built with