Skip to content

GET referral_codes/[code]/referrals

Retrieve a list of users who signed up using a specific referral code that you own.

Endpoint

GET /api/v1/referral-codes/{code}/referrals

Authentication

Requires a valid API key in the Authorization header:

Authorization: Bearer <your-api-key>

Path Parameters

ParameterTypeRequiredDescription
codestringYesThe referral code

Example Request

bash
curl -X GET https://portal.eprospera.com/api/v1/referral-codes/MYCODE123/referrals \
  -H "Authorization: Bearer <your-api-key>"

Response

Success Response (200 OK)

FieldTypeDescription
codestringThe referral code
naturalPersonsarrayList of natural persons referred with this code

Natural Person Object Fields

FieldTypeDescription
fullNamestring | nullFull name of the referred person. Can be null if the user has not yet applied or been approved for residency
referredAtstring | nullTimestamp when the user was referred (ISO 8601)

Example Response

json
{
  "code": "MYCODE123",
  "naturalPersons": [
    {
      "fullName": "John Doe",
      "referredAt": "2024-03-15T14:30:00.000Z"
    },
    {
      "fullName": null,
      "referredAt": "2024-03-20T09:15:00.000Z"
    }
  ]
}

Error Responses

401 Unauthorized

Invalid or missing API key:

json
{
  "error": "Invalid API key"
}

404 Not Found

Referral code not found or you don't have access:

json
{
  "error": "Referral code not found"
}

500 Internal Server Error

Server error:

json
{
  "error": "Internal server error"
}

Access Control

You can only access referral codes that belong to you. This includes:

  • Referral codes associated with your natural person account
  • Referral codes associated with legal entities where you are a representative