1. Referral
Returning.AI
  • Getting Started
  • Users
    • Get user
      GET
    • Get Users with Filters
      POST
    • Create New User
      POST
    • Get User Data
      POST
    • Manage User Account
      POST
    • List mini-game logs by user email
      POST
    • Get current mini-game and streak state
      POST
    • Get User Milestones
      POST
    • Update User Data, Identifier, And Roles
      POST
    • Update User XP and Currency
      POST
  • Messaging
    • Agent messaging workflow
    • Get Messages
      GET
    • Send Message
      POST
    • Reply Message
      POST
    • React Message
      POST
    • Upload message images
      POST
  • Gamification
    • Leaderboards
      • List leaderboards with pagination
      • Create a new leaderboard
      • Update an existing leaderboard
      • Get a single leaderboard by ID
      • Delete a leaderboard
    • Streaks & Mini Games
      • List user streak logs
      • Update user spin-wheel information
    • Referral
      • Referral Program Integration
      • Mini-game State and History
      • Get referral programs
        GET
      • Get user's referral summary
        POST
    • Rolling Data
      • Get Daily Calculation Data
      • Get Rolling Calculation Data
    • Match Predictions
    • Get tier configuration
      GET
    • Get daily user XP and coin changes
      POST
    • Search user gamification logs
      POST
    • Get user activity stats
      POST
  • Rewards & Redemptions
    • Update redemption order status or refund
    • List redemption orders by user email
    • List redemption statuses
    • Get redemption status by ID
    • List redemption orders by community
    • Create redemption order status
    • Get redemption order status history
  • Chart Analysis
    • Create Analysis
    • Get Analysis
    • Update Analysis
    • Delete Analysis
    • List Analyses
    • Append Drawings
  • Bulk Operations
    • List bulk update jobs
    • Get bulk update job status
    • Get bulk update job details
    • Bulk update users from CSV
    • Bulk update premium currency from CSV
  • Channels
    • Iframe
    • List integration channels
  • Events
    • Outgoing webhooks
      • Encryption
      • User Joins Server
      • User Visits server
      • New Message Posted Anywhere
      • New Message Posted To channel
      • Purchased Store Item
    • Incoming webhooks
      • API Keys & Encryption
      • Send message into channels
      • Update Custom User Fields
      • Update In-game currency
  • Widgets
    • Authenticated Widgets
    • Public widgets
  • Community Analytics
    • Get Loyalty Overview
    • Get Phone Verification Contacts
  • Store
    • Purchase History
      • Update redemption instructions or voucher details
    • Categories
      • List Store categories
      • Create Store category
      • Get Store category by ID
      • Update Store category
      • Delete Store category
    • Products
      • List products
      • Update products in bulk
      • Create products in bulk
      • Create product with vouchers
      • Read product
      • Update product and append vouchers
      • Delete product
    • Redemption-transaction
      • Get redemption transaction detail
    • Get Store configuration
    • Update Store configuration
  • Community
    • Appearance
      • Update community theme colors
      • Update community bot profile
      • Update community URL metadata
      • Update community name and URL
    • Community Users
      • Get community users
      • Get user
    • Create community
  • API Keys
    • Community API Keys
      • Create API key
      • Read API keys
      • Delete API key
      • Update API key
    • User API Keys
      • List user API keys
      • Create user API key
      • Update user API key
      • Delete user API key
      • Get current API key information
  • User Fields
    • User Field History
      • Get all user field histories in a community
      • Get user field histories for a specific field
      • Get user field histories for a specific user
      • Get user field histories of specific user field and user
      • Update A User Field Value
      • Deprecated Field-First History Write
      • Deprecated Field-First History Read
    • Get A User Field Definition
    • Update A User Field Definition
    • Create A User Field Definition
    • Delete A User Field Definition
    • List User Field Definitions
    • Delete user field
    • Update user field
    • Get specific user field
  • Legacy
    • Servers
      • Create server
      • List servers
      • Update server metadata
    • Bulk Operations
      • Bulk import users from CSV
    • Authentication
      • Secure Auth
      • Register user with password
      • Verify user email
      • Log in user with password
    • Badges
      • List badges
      • Create badge
      • Update badge
      • Delete badge
      • Remove badge from user
      • Award badge to user
    • Messaging
    • Roles & Permissions
      • List server roles
      • Create role
      • Update role
      • Delete role
      • List user roles
      • Add role to user
      • Remove role from user
    • Users
      • Upload user avatar
    • Channels
      • Create channel
      • Update channel
      • Delete channel
    • API Keys
      • List integration API keys
      • Create integration API key
      • Delete integration API key
      • Update integration API key
  • Schemas
    • Sample Schemas
    • Schemas
    • Outgoing webhooks
    • Analysis
    • Pet
    • Category
    • Tag
    • ValidationError
    • NotFoundError
    • InternalServerError
    • NotImplementedError
    • CreateUserFieldHistoryResponse
    • CreateUserFieldHistorySuccessResponse
    • UserFieldHistoryItem
    • GetUserFieldHistoriesResponse
    • UserFieldHistoriesValidationError
    • UserFieldHistoriesMetaWithValidation
    • UserFieldHistoriesMetaWithPagination
    • GetUserFieldHistoriesSuccessResponse
    • CreateUserFieldResponse
    • CreateUserFieldSuccessResponse
    • DeleteUserFieldResponse
    • DeleteUserFieldSuccessResponse
    • UserFieldCreator
    • GetUserFieldResponse
    • GetUserFieldSuccessResponse
    • ValidationErrorItem
    • GetUserFieldsMetaResponse
    • CreatorInfo
    • UserFieldResponse
    • GetUserFieldsSuccessResponse
    • UpdateUserFieldResponse
    • UpdateUserFieldPayload
    • UpdateUserFieldSuccessResponse
    • MetaResponse
    • GetUserResponse
    • GetUserSuccessResponse
    • Purchased store item
    • ErrorResponse
    • New message posted to channel
    • UpdateAnalysisRequest
    • User visits server
    • AppendDrawingsRequest
    • User join server
    • CreateAnalysisResponse
    • GetAnalysisResponse
    • UpdateAnalysisResponse
    • AppendDrawingsResponse
    • AnalysisMetadata
    • Expiry
    • Levels
    • LevelEntry
    • Drawing
    • HorizontalLineDrawing
    • LineDrawing
    • RectangleDrawing
    • ParallelDrawing
    • FibonacciRetracementDrawing
    • Coordinate
    • DrawingStyle
    • AnalysisDetail
    • AnalysisSummary
    • CreateAnalysisRequest
    • ListAnalysesResponse
    • StandardApiError
    • StandardSuccessEnvelope
    • PurchasedStoreItemEvent
    • ChannelMessagePostedEvent
    • UserVisitedCommunityEvent
    • UserJoinedCommunityEvent
  1. Referral

Get referral programs

GET
/v1/referral/programs

What this endpoint does#

Returns the active referral programs configured for the community associated with the API key. Programs are returned in configured display order and include public stage requirements plus XP and coin rewards.
Use this before rendering referral UI or validating a launch. It tells your integration what is configured; it does not return one user's invite link, referral activity, or stage progress.
INFO
Community scope
Do not send a communityId. The community API key supplies community scope and must include getUserData.

Quick start#

Authentication and permission#

Send a community API key as Authorization: Bearer <COMMUNITY_API_KEY>. Keep it server-side. Missing, invalid, or expired keys return 401; a valid key without getUserData returns 403.

Query parameter#

FieldRequiredMeaning
langNoOptional response language code, for example en. Returned copy falls back according to community configuration.

Understanding programs and stages#

programId is the public identifier accepted by the summary endpoint's optional programId filter.
stages are returned in their configured display order. Do not sort by names or infer a universal number of stages.
mainConditionOperator, mainConditions, and nestedConditions describe configured milestone logic. Field keys and values differ by community.
rewards is the reward for one stage; totalRewards is the configured sum for the program.
A program response is configuration, not proof that a particular user or referee completed anything.

Complete examples#

The structured 200 examples show one synthetic configured program and the valid empty state. Treat their IDs, labels, conditions, and rewards as illustrative only.

Success and readback#

On 200, read data as the current public configuration snapshot. Confirm the expected programId, stage order, conditions, and rewards before treating a launch as configured. Re-read after an administrator changes the program; this endpoint does not report user progress.

Errors and recovery#

StatusRecovery
401 AUTH_API_KEY_REQUIREDAdd the server-side Bearer key.
401 AUTH_API_KEY_INVALIDReplace an invalid or expired key.
403Grant getUserData or use the intended community key.
500 / 502Retry with bounded backoff and escalate if persistent.

Empty and changed configurations#

A valid community can return data: [] when no public referral program is active. Re-read this endpoint during launch checks and after referral administrators change program configuration.

Retry safety#

This is a read-only request. Retrying after a timeout does not create users, referrals, progress, or rewards. Use bounded exponential backoff for 500, 502, and transient network failures; do not retry 400, 401, or 403 without correcting the request or key.

Gotchas#

WARNING
Do not hard-code program names, condition keys, reward amounts, or stage counts from the example. Always render or map the current response.

Next steps#

Follow the Referral program integration guide to wire identity capture, registration, milestones, summary readback, and launch tests. Then call Get user's referral summary for the signed-in member.

Request

Query Params

Header Params

Responses

🟢200Success
application/json
Active programs in configured order; data may be empty.
Bodyapplication/json

🟠401Unauthorized
🟠403Forbidden
🔴500Internal Server Error
🔴502Bad Gateway
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.returning.ai/v1/referral/programs?lang=en' \
--header 'Authorization: Bearer <COMMUNITY_API_KEY>'
Response Response Example
200 - Success Example
{
  "meta": {
    "status": "success",
    "statusCode": 200
  },
  "message": "Get referral programs success.",
  "data": [
    {
      "enabled": true,
      "programId": "64b7f3a2c8d4e6f102938471",
      "name": "Invite and earn",
      "description": "Earn configured rewards as invited members reach milestones.",
      "color": "#4F46E5",
      "icon": "users",
      "stages": [
        {
          "stageId": "64b7f3a2c8d4e6f102938472",
          "stageNumber": 1,
          "name": "Member joins",
          "description": "The invited member creates an eligible account.",
          "displaySetting": "Show progress",
          "mainConditionOperator": "AND",
          "mainConditions": [
            {
              "groupId": "64b7f3a2c8d4e6f102938473",
              "operator": "AND",
              "nestedConditions": [
                {
                  "conditionId": "64b7f3a2c8d4e6f102938474",
                  "key": "registration_status",
                  "type": "string",
                  "condition": "equals",
                  "value": "registered",
                  "enableUserFacingCondition": true,
                  "userFacingCondition": "Account created",
                  "valueLabel": "Registered",
                  "isDeletedValue": false
                }
              ],
              "enableUserFacingCondition": true,
              "userFacingCondition": "Invited member joins"
            }
          ],
          "rewards": {
            "xp": 250,
            "coins": 25
          }
        }
      ],
      "totalRewards": {
        "xp": 250,
        "coins": 25
      }
    }
  ]
}
Modified at 2026-08-17 15:23:38
Previous
Mini-game State and History
Next
Get user's referral summary
Built with