Skip to main content

Referrals API

Retrieve your referral code, referral link, credit balance, and referral statistics.

Get referral data

GET /api/referrals
Requires session authentication. Returns the authenticated user’s referral code, generated referral link, accumulated credits, and conversion statistics.

Response

{
  "referralCode": "abc123",
  "referralLink": "https://agentbot.raveculture.xyz/register?ref=abc123",
  "credits": 30,
  "stats": {
    "successfulReferrals": 3,
    "creditEarned": 30,
    "totalReferrals": 5,
    "pendingReferrals": 2
  }
}

Response fields

FieldTypeDescription
referralCodestring | nullYour referral code, or null if not set.
referralLinkstring | nullFull referral URL for sharing. null when no referral code exists.
creditsnumberAccumulated referral credits balance.
stats.successfulReferralsnumberNumber of referrals where the referrer reward has been granted.
stats.creditEarnednumberTotal credit earned from successful referrals (£10 per referral).
stats.totalReferralsnumberTotal number of referrals (successful and pending).
stats.pendingReferralsnumberReferrals that have not yet converted (total minus successful).

Errors

CodeDescription
401Unauthorized — no valid session
404User not found
500Failed to fetch referrals
Referral credits are also included in the dashboard data and dashboard bootstrap responses. Use this endpoint when you need the full referral breakdown including conversion statistics.