Skip to main content

Rewards API

Endpoints for the CROPS rewards program - eligibility/onboarding, earning summary, leaderboard, and admin stage management.

Base paths: /rewards (user + onboarding) and /admin/rewards (admin only). See the Rewards feature page for how the program works.

User Endpoints

Authenticated unless marked Public. Wallet ownership is validated against the JWT.

Get My Rewards Summary

GET /rewards/me

Returns the wallet's CROPS total, current stage and rank, a category breakdown, and earned badges.

Query ParamTypeRequiredDescription
walletAddressstringYesWallet to summarize

Get Eligibility

GET /rewards/eligibility

Returns the wallet's eligibility flags (emailVerified, captchaPassed, minBalanceVerified, walletAgeVerified) and overall eligible state.

Query ParamTypeRequiredDescription
walletAddressstringYesWallet to check

Run On-Chain Check

POST /rewards/onchain-check

Re-runs the minimum-balance and wallet-age checks on demand and updates the corresponding eligibility flags.

FieldTypeRequiredDescription
walletAddressstringYesWallet to check

Share Code

POST /rewards/share-code

Records a public referral-code share - awards the social bonus and the Voice badge.

FieldTypeRequiredDescription
walletAddressstringYesWallet sharing the code

Get Award History

GET /rewards/history

Paginated list of individual CROPS awards for a wallet.

Query ParamTypeRequiredDescription
walletAddressstringYesWallet to query
stageIdnumberNoFilter by stage
limitnumberNoPage size
offsetnumberNoPage offset

Get Leaderboard

GET /rewards/leaderboard

Public. Anonymized CROPS leaderboard. Entries show a stable pseudonym, never the wallet address.

Query ParamTypeRequiredDescription
modestringNocurrent (active stage) or all (lifetime).
limitnumberNoPage size (1-200, default 50)
offsetnumberNoPage offset (default 0)
walletAddressstringNoIf provided, the response also includes your own rank and pseudonym

Response (abridged):

{
"items": [
{ "rank": 1, "pseudonym": "elegant-sword-quick-planet", "totalPoints": 124500 }
],
"me": { "rank": 47, "pseudonym": "brave-river-cool-leaf", "totalPoints": 12500 }
}

Get Weekly Risers

GET /rewards/weekly-risers

Public. Users who climbed the most current-stage ranks over the last 7 days.

Query ParamTypeRequiredDescription
limitnumberNoMax entries (max 50, default 10)

Get Stages

GET /rewards/stages

Public. Lists all reward stages and their configuration (order, window, pool allocation, multipliers).

Onboarding Endpoints

All public (used before a wallet is eligible).

Start Email Verification

POST /rewards/email/start

Sends a 6-digit OTP to the email. Rate-limited to one send per minute per wallet.

FieldTypeRequiredDescription
walletAddressstringYesWallet linking the email
emailstringYesEmail to verify

Verify Email

POST /rewards/email/verify

Verifies the OTP and flips emailVerified. Code expires in 10 minutes; max 5 attempts.

FieldTypeRequiredDescription
walletAddressstringYesWallet
codestringYes6-digit OTP

Verify CAPTCHA

POST /rewards/captcha/verify

Validates a CAPTCHA token (Turnstile / hCaptcha / reCAPTCHA v3) and flips captchaPassed.

FieldTypeRequiredDescription
walletAddressstringYesWallet
tokenstringYesCAPTCHA token from the widget

Admin Endpoints

Base path /admin/rewards. Require an admin token.

MethodPathPurpose
GET/admin/rewards/stagesList all stages
POST/admin/rewards/stagesCreate a stage (name, order, startAt, endAt, poolAllocation, baseEarnRate, stageMultiplier, config)
PATCH/admin/rewards/stages/:idUpdate a stage
DELETE/admin/rewards/stages/:idDelete a stage (blocked if it has awards)
GET/admin/rewards/eligibility/:userIdFetch a user's eligibility state
PATCH/admin/rewards/eligibility/:userId/flagManually set a flag (flag, value)
PATCH/admin/rewards/eligibility/:userId/sybilMark/clear sybil flag (flagged, optional reason)
PATCH/admin/rewards/eligibility/:userId/overrideForce eligible/block/auto (override: true/false/null)