Skip to main content

Referrals

Manage your referral code, track referral stats, and claim rewards. Share your referral code with others to earn bonus queries for both you and the person you refer.

API Playground

tip

Try this endpoint live in the API Playground.

How It Works

  1. Get your referral code — Each user gets a unique code (e.g., CDB-A1B2C3D4)
  2. Share it — Send the signup link https://app.crondb.com/signup?ref=YOUR_CODE to others
  3. They sign up — When someone registers using your code, the referral is tracked
  4. Both earn rewards — Referrer gets 500 bonus queries, referee gets 200 bonus queries
  5. Hit milestones — Earn additional bonuses at 5, 10, 25, and 50 successful referrals

Milestone Bonuses

ReferralsBonus Queries
51,000
102,500
255,000
5010,000

Maximum referrals per user: 50.

Endpoints

MethodEndpointAuthDescription
GET/v1/referrals/codeRequiredGet your referral code
GET/v1/referrals/statsRequiredReferral stats and earnings
GET/v1/referrals/historyRequiredReferral history
POST/v1/referrals/validate/{code}NoneValidate a referral code
POST/v1/referrals/claimRequiredClaim referral rewards
GET/v1/referrals/leaderboardNoneTop referrers

Get Referral Code

Returns your unique referral code. Generates one automatically if you don't have one yet.

GET /v1/referrals/code
curl -H "Authorization: Bearer cdb_your_api_key_here" \
"https://api.crondb.com/v1/referrals/code"

Response

{
"referral_code": "CDB-A1B2C3D4"
}
FieldTypeDescription
referral_codestringYour unique referral code (format: CDB-XXXXXXXX)

Referral Stats

Get your referral program statistics including total invites, conversions, and earnings.

GET /v1/referrals/stats
curl -H "Authorization: Bearer cdb_your_api_key_here" \
"https://api.crondb.com/v1/referrals/stats"

Response

{
"total_invites": 12,
"successful_signups": 8,
"rewards_claimed": 6,
"queries_earned": 4000,
"max_referrals": 50,
"next_milestone": 10,
"next_milestone_bonus": 2500
}
FieldTypeDescription
total_invitesintegerTotal people who used your referral code
successful_signupsintegerPeople who completed signup
rewards_claimedintegerReferrals where rewards have been claimed
queries_earnedintegerTotal bonus queries earned (including milestones)
max_referralsintegerMaximum referrals allowed (50)
next_milestoneinteger | nullNext milestone target, or null if all achieved
next_milestone_bonusinteger | nullBonus queries at next milestone

Referral History

List all your referrals with their status and timestamps.

GET /v1/referrals/history
curl -H "Authorization: Bearer cdb_your_api_key_here" \
"https://api.crondb.com/v1/referrals/history"

Response

[
{
"id": 42,
"referee_email": "j***n@gmail.com",
"status": "rewarded",
"reward_given": true,
"created_at": "2026-03-15 10:30:00",
"completed_at": "2026-03-16 14:22:00"
},
{
"id": 38,
"referee_email": "a***x@company.io",
"status": "completed",
"reward_given": false,
"created_at": "2026-03-10 09:15:00",
"completed_at": "2026-03-12 11:05:00"
}
]
FieldTypeDescription
idintegerReferral ID
referee_emailstring | nullMasked email of the referred user
statusstring"pending", "completed", or "rewarded"
reward_givenbooleanWhether the referrer bonus was applied
created_atstring | nullWhen the referral was created
completed_atstring | nullWhen the referee completed signup

Validate Referral Code

Check if a referral code is valid. This is a public endpoint used during signup — no authentication required.

POST /v1/referrals/validate/{code}
curl -X POST "https://api.crondb.com/v1/referrals/validate/CDB-A1B2C3D4"

Response — Valid Code

{
"valid": true,
"referrer_email": "j***n@gmail.com"
}

Response — Invalid Code

{
"valid": false,
"referrer_email": null
}
FieldTypeDescription
validbooleanWhether the code exists and is still usable
referrer_emailstring | nullMasked email of the referrer (only if valid)

A code is invalid if it doesn't exist or the referrer has reached the 50-referral maximum.


Claim Reward

Claim your referral reward as a referee. Call this after signing up with a referral code and making your first query.

POST /v1/referrals/claim
curl -X POST \
-H "Authorization: Bearer cdb_your_api_key_here" \
"https://api.crondb.com/v1/referrals/claim"

Response — Success

{
"queries_awarded": 200,
"message": "You earned 200 bonus queries!"
}

Error Responses

StatusDetailReason
404No claimable referral foundNo completed referral exists for this user, or already claimed

Leaderboard

Get the top 10 referrers (anonymized). This is a public endpoint — no authentication required.

GET /v1/referrals/leaderboard
curl "https://api.crondb.com/v1/referrals/leaderboard"

Response

[
{ "rank": 1, "name": "J***n", "referrals": 23 },
{ "rank": 2, "name": "S***a", "referrals": 18 },
{ "rank": 3, "name": "M***k", "referrals": 12 }
]
FieldTypeDescription
rankintegerPosition on the leaderboard
namestringAnonymized name from the referrer's email
referralsintegerNumber of completed referrals

Error Responses

All authenticated endpoints return standard error responses:

StatusDetailReason
401Not authenticatedMissing or invalid Bearer token
403ForbiddenInsufficient permissions

Next Steps