start - Beginning of the analytics period (ISO 8601)
end - End of the analytics period (ISO 8601)
Metrics
Aggregated metrics across all transactions:
Field
Description
totalTransactions
Total number of transactions in the period
byType
Breakdown of transaction counts by type (points, xp, coins)
totalAmount
Sum of all amounts by type
averagePerTransaction
Average transaction amount by type
uniqueUsers
Number of unique users with transactions
Top Campaigns
List of campaigns with the most transaction activity (limited to top 5):
campaignId - Campaign identifier
transactions - Number of transactions for this campaign
Recent Activity
The 10 most recent transactions, including:
transactionId - Transaction identifier
userId - User identifier
type - Transaction type
amount - Transaction amount
createdAt - Transaction timestamp
Use Cases
Performance Dashboard
Display key metrics on your admin dashboard:
Campaign Performance
Identify your best-performing campaigns:
User Engagement Tracking
Monitor user engagement over time:
Transaction Type Analysis
Understand which reward types are most popular:
Performance Considerations
Analytics are calculated in real-time from transaction data
Large date ranges may take longer to process
Results are limited to 1000 transactions for performance
Consider caching analytics data for frequently accessed date ranges
Error Responses
400 Bad Request:
500 Internal Server Error:
Best Practices
Date Ranges: Use reasonable date ranges (1-90 days) for optimal performance
Caching: Cache analytics data for 15-30 minutes to reduce API calls
Pagination: For detailed analysis, use the Transactions API with pagination
Trending: Track metrics over time to identify trends
Alerts: Set up alerts for unusual metric changes
Reporting: Export analytics data regularly for long-term analysis
Recent Activity Endpoint
Get a detailed, multi-source activity feed for your organisation's loyalty program. Perfect for powering admin dashboards, activity timelines, and audit logs.
Get Recent Activity
Retrieve recent activities across all loyalty program components.
Endpoint:GET /v1/activity/recent
Query Parameters:
Parameter
Type
Required
Description
limit
number
No
Number of activities to return (default: 50, max: 100)
type
string
No
Filter by activity type (see types below)
userId
string
No
Filter activities for a specific user
cursor
string
No
Pagination cursor for fetching older activities
Activity Types:
transaction_created - Points, XP, or coins awarded/deducted
campaign_created - New campaign created
campaign_activated - Campaign went live
segment_created - New user segment created
product_created - New reward product added
user_tier_upgraded - User moved to a higher tier
webhook_triggered - Webhook delivery sent
code_redeemed - Individual code redeemed by user
Example Request:
Example Response:
Activity Object Structure
Each activity contains:
Field
Type
Description
activityId
string
Unique identifier for this activity
type
string
Activity type (see types above)
timestamp
string
ISO 8601 timestamp when activity occurred
data
object
Activity-specific data (varies by type)
user
object|null
Enriched user details if activity has userId
User Enrichment
Activities that involve a user automatically include enriched user data:
User details are batch-fetched for performance (up to 100 users per request).
Pagination
Use the nextCursor to fetch older activities:
The cursor is base64-encoded and represents the timestamp of the last activity in the current page.
Filtering Examples
Get only transactions:
Get activity for specific user:
Get tier upgrades only:
Use Cases
1. Admin Activity Dashboard
Display real-time activity across your loyalty program:
# First request
curl "https://api.monterosa.cloud/loyalty/v1/activity/recent?limit=50"
# Use nextCursor from response for next page
curl "https://api.monterosa.cloud/loyalty/v1/activity/recent?limit=50&cursor=MjAyNS0xMC0wNlQxMDoxMDowMFo="