Mission Log
Mission Logs are the activity events that drive mission progress. Every time an end user performs a qualifying action — completing a purchase, finishing a lesson, or leaving a review — your backend sends a Mission Log entry. The platform aggregates these entries according to the mission's aggregationPeriod, updating the user's Mission Progress automatically.
Mission Logs can only be created via the API (CREATE, GET, LIST). They cannot be updated or deleted. Once submitted, a log entry is permanent.
How it works
- User performs an action — a customer completes a purchase, registers, or finishes a mission task.
- Your backend sends a log — call
POST /schema/mission_log/recordwithmissionId,ownedById,activityId,activityAt,uniqueIdentifier, and optionalactivityValue. - Progress updated — the platform aggregates the entry into the user's
Mission Progress, updating the state and checking milestone thresholds. - Milestone triggered — if a milestone threshold is crossed, a
Reward Logis created and returned inachievedMilestoneRewardLog. - Mission completed — when all mission milestones or objectives are reached,
missionProgressStatustransitions tocompletedand the overallrewardLogis issued.
Fields
Required on create
| Field | Type | Required | Description |
|---|---|---|---|
missionId | UUID | ✅ | ID of the mission this log contributes to |
ownedById | UUID | ✅ (or use ownedBy) | Gamopanda member ID of the user performing the activity |
activityId | string | ✅ | Activity ID for this event — e.g. order_completed, registration_complete, referral_sign_up |
activityAt | datetime | ✅ | Datetime when the activity occurred |
uniqueIdentifier | string | ✅ | Unique identifier for this event — e.g., order_completed_123456789, registration_complete_987654321 |
Optional on create
| Field | Type | Description |
|---|---|---|
activityValue | number | The numeric value associated with the activity (e.g. spend amount, count) |
ownedBy | object | Inline member upsert payload. Use instead of ownedById to sync the member in the same request |
Status
| Field | Type | Default | Description |
|---|---|---|---|
status | enum | live | draft · live · paused. Only live logs are included in aggregation |
Extra fields returned in the response
After a log is created, the platform enriches the response with several computed fields:
| Field | Description |
|---|---|
mission | The full joined Mission object this log belongs to |
missionProgress | The user's updated Mission Progress record after this log was processed |
taskProgress | The associated task progress data |
achievedMilestone | The Milestone record crossed by this log entry, if any |
nextMilestone | The next Milestone the user is working toward, if any |
achievedMilestoneRewardLog | The Reward Log issued when a milestone was crossed |
rewardLog | The Reward Log issued when the overall mission is completed |
Handling achievedMilestoneRewardLog
When a milestone threshold is crossed, the platform creates a Reward Log record and returns it as achievedMilestoneRewardLog in the response.
Coupon generation and fulfillment depend on the handleCoupon flag configured on the associated Reward module:
- Gamopanda-handled coupons (
handleCoupon: trueon Reward): Gamopanda automatically assigns an available coupon code (or auto-generates one ifhandleCouponAutoGeneration: true) and setsrewardIssuedAtandrewardExpiryAton theReward Log. No client action is required. - Client-handled coupons (
handleCoupon: falseon Reward): TheReward Logis created with anullcouponCode. Your backend is responsible for generating the coupon in your system and updating theReward Logvia API.
Reward fulfilment workflow (Client-handled coupons)
- Check the response — after
POST /schema/mission_log/record, inspectachievedMilestoneRewardLogorrewardLog. If it is notnullandcouponCodeisnull, a milestone was crossed that requires client fulfillment. - Generate a coupon — call your coupon or voucher system to issue a reward code for this user.
- Update the reward log —
PATCHthe reward log with the coupon code and timestamps:
Code
Reward log lifecycle
| Step | Fields set | Who sets it |
|---|---|---|
| Milestone crossed | milestoneId, linkedSchemaRecordId, ownedById | Platform (automatic) |
| Coupon assigned | couponCode, rewardIssuedAt, rewardExpiryAt | Gamopanda (if handleCoupon: true) OR Your backend (if handleCoupon: false) |
Syncing a member inline
You can pass member details directly in the ownedBy field. The platform will create or update the member record automatically:
Code
The uniqueIdentifier — preventing duplicates
uniqueIdentifier is your system's unique identifier for the triggering event. The platform uses it to idempotently reject duplicate submissions.
Code
Real-world examples
🛍️ E-commerce — Purchase Cycle Mission Log
A user completes an order that contributes to a weekly purchase cycle mission:
Code
Response:
Code
Access & permissions
| Caller | Allowed operations | Notes |
|---|---|---|
| Admin / Backend | CREATE · GET · LIST | Non-editable, cannot be deleted |
| End user | (none) | No direct write access |
| Guest user | (none) | Not accessible |
Related resources
| Resource | Description |
|---|---|
| Mission | Parent mission configuration defining the mission rules |
| Mission Progress | Per-user progress state updated after each log |
| Milestone | Checkpoints attached to the mission |
| Reward Log | Reward entries automatically created when a milestone or mission is completed |
| Member | End user (ownedById) performing the mission activities |
API reference
See the API Reference for full request/response schemas and interactive examples for:
POST /schema/mission_log/record— create a mission logGET /schema/mission_log/record— list mission logsGET /schema/mission_log/record/{id}— get a mission log by ID