# Referral

A Referral tracks who has referred whom.

## List referrals

> List all of the referrals in your Referral SaaSquatch by impact.com tenant. This method supports pagination and filtering.<br>

```json
{"openapi":"3.1.0","info":{"title":"SaaSquatch by impact.com API - Referral","version":"1.0.0"},"tags":[{"name":"Referral","description":"A Referral tracks who has referred whom."}],"servers":[{"url":"https://app.referralsaasquatch.com/api/v1","description":"SaaSquatch Production Server"}],"security":[{"APIKey":[]},{"UserJWT":[]}],"components":{"securitySchemes":{"APIKey":{"type":"http","scheme":"basic","description":"Authorize your requests using a tenant's API Key."},"UserJWT":{"type":"apiKey","in":"header","name":"X-SaaSquatch-User-Token","description":"Authorize your requests using a JWT for a given user."}},"parameters":{"tenant_alias":{"name":"tenant_alias","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant being referenced. E.g. `\"aboih12h16t\"`"},"limit":{"name":"limit","in":"query","schema":{"type":"integer","default":10},"description":"A limit on the number of results returned."},"offset":{"name":"offset","in":"query","schema":{"type":"integer","default":0},"description":"Offsets the first result to return in the list for pagination."}},"schemas":{"ReferralList":{"type":"object","properties":{"count":{"type":"integer"},"totalCount":{"type":"integer"},"referrals":{"type":"array","items":{"$ref":"#/components/schemas/Referral"}}}},"Referral":{"description":"A link between the user/account of the referrer and the new referred user/account.","properties":{"id":{"type":"string"},"referredUser":{"$ref":"#/components/schemas/User"},"referrerUser":{"$ref":"#/components/schemas/User"},"referredReward":{"$ref":"#/components/schemas/Reward"},"referrerReward":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Reward"}]},"referralCodeUsed":{"type":"string","nullable":true},"shareLinkUsed":{"type":"string","nullable":true},"moderationStatus":{"type":"string","enum":["PENDING","ACTIONED"]},"referredModerationStatus":{"type":"string","enum":["PENDING","APPROVED","DENIED"]},"referrerModerationStatus":{"type":"string","enum":["PENDING","APPROVED","DENIED"]},"fraudSignals":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/FraudSignals"}]},"dateReferralStarted":{"type":"integer","format":"int64"},"dateReferralPaid":{"type":"integer","format":"int64","nullable":true},"dateReferralEnded":{"type":"integer","format":"int64","nullable":true},"dateModerated":{"type":"integer","format":"int64","nullable":true},"dateConverted":{"type":"integer","format":"int64","nullable":true,"description":"Unix timestamp (milliseconds) when the referral converted."},"dateModified":{"type":"integer","format":"int64","description":"Unix timestamp (milliseconds) when the referral was last modified."},"dateUserModified":{"type":"integer","format":"int64","nullable":true,"description":"Unix timestamp (milliseconds) when the referred user was last modified."},"programId":{"type":"string","nullable":true,"description":"The ID of the program this referral belongs to."}}},"User":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"lastInitial":{"type":"string"},"email":{"type":"string","format":"email"},"emailHash":{"type":"string","description":"An MD5 hash of the user's email address."},"imageUrl":{"type":"string","description":"URL of the user's profile image. Empty string if not set."},"referralCode":{"type":"string"},"cookieId":{"type":"string","nullable":true},"paymentProviderId":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"referralSource":{"type":"string","nullable":true},"firstSeenIP":{"type":"string","nullable":true},"lastSeenIP":{"type":"string","nullable":true},"dateCreated":{"type":"integer","format":"int64"},"dateBlocked":{"type":"integer","format":"int64","nullable":true},"shareLinks":{"type":"object","description":"The user's share links, organised by share medium and engagement medium."}}},"Reward":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"uniqueId":{"type":"string","nullable":true},"dateCreated":{"type":"integer","format":"int64"},"dateScheduledFor":{"type":"integer","format":"int64","nullable":true},"dateGiven":{"type":"integer","format":"int64","nullable":true},"dateExpires":{"type":"integer","format":"int64","nullable":true},"dateCancelled":{"type":"integer","format":"int64","nullable":true},"accountId":{"type":"string"},"userId":{"type":"string"},"cancellable":{"type":"boolean"},"rewardSource":{"type":"string"},"programId":{"type":"string","nullable":true},"programRewardKey":{"type":"string","nullable":true},"globalRewardKey":{"type":"string","nullable":true},"referralId":{"type":"string","nullable":true},"unit":{"type":"string"},"assignedCredit":{"type":"integer"},"redeemedCredit":{"type":"integer"},"name":{"type":"string"},"currency":{"type":"string","nullable":true},"redemptions":{"type":"object","nullable":true}}},"FraudSignals":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/FraudSignal"},"ip":{"$ref":"#/components/schemas/FraudSignal"},"email":{"$ref":"#/components/schemas/FraudSignal"},"rate":{"$ref":"#/components/schemas/FraudSignal"}}},"FraudSignal":{"type":"object","properties":{"message":{"type":"string"},"score":{"type":"integer"}}},"Error":{"properties":{"statusCode":{"type":"integer","format":"int32"},"message":{"type":"string","description":"The human-readable description of what went wrong. Use this to help you debug."},"apiErrorCode":{"type":"string","description":"A machine-readable error code."},"rsCode":{"type":"string","nullable":true,"description":"A secondary machine-readable error code."}}}},"responses":{"GeneralError":{"description":"Unexpected Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/{tenant_alias}/referrals":{"get":{"summary":"List referrals","description":"List all of the referrals in your Referral SaaSquatch by impact.com tenant. This method supports pagination and filtering.\n","operationId":"listReferrals","tags":["Referral"],"parameters":[{"$ref":"#/components/parameters/tenant_alias"},{"name":"referringAccountId","in":"query","description":"When included, filters the results to only referrals that were referred by users with this `AccountId`","schema":{"type":"string"}},{"name":"referringUserId","in":"query","description":"When included, filters the results to only referrals that were referred by users with this `UserId`","schema":{"type":"string"}},{"name":"dateReferralPaid","in":"query","description":"When included, filters the results by an exact timestamp or a comma-separated range for when the referral was paid.","schema":{"type":"string"}},{"name":"dateReferralEnded","in":"query","description":"When included, filters the results by an exact timestamp or a comma-separated range for when the referral ended.","schema":{"type":"string"}},{"name":"referredModerationStatus","in":"query","description":"Filters the result to only include referred users with that status: `PENDING`, `APPROVED` or `DENIED`.","schema":{"type":"string","enum":["PENDING","APPROVED","DENIED"]}},{"name":"referrerModerationStatus","in":"query","description":"Filters the result to only include referrers with that status: `PENDING`, `APPROVED` or `DENIED`.","schema":{"type":"string","enum":["PENDING","APPROVED","DENIED"]}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"A list of referrals.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralList"}}}},"default":{"$ref":"#/components/responses/GeneralError"}}}}}}
```

## Lookup a Referral

> Looks up a single Referral object by its associated \`id\`.

```json
{"openapi":"3.1.0","info":{"title":"SaaSquatch by impact.com API - Referral","version":"1.0.0"},"tags":[{"name":"Referral","description":"A Referral tracks who has referred whom."}],"servers":[{"url":"https://app.referralsaasquatch.com/api/v1","description":"SaaSquatch Production Server"}],"security":[{"APIKey":[]},{"UserJWT":[]}],"components":{"securitySchemes":{"APIKey":{"type":"http","scheme":"basic","description":"Authorize your requests using a tenant's API Key."},"UserJWT":{"type":"apiKey","in":"header","name":"X-SaaSquatch-User-Token","description":"Authorize your requests using a JWT for a given user."}},"parameters":{"tenant_alias":{"name":"tenant_alias","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant being referenced. E.g. `\"aboih12h16t\"`"}},"schemas":{"Referral":{"description":"A link between the user/account of the referrer and the new referred user/account.","properties":{"id":{"type":"string"},"referredUser":{"$ref":"#/components/schemas/User"},"referrerUser":{"$ref":"#/components/schemas/User"},"referredReward":{"$ref":"#/components/schemas/Reward"},"referrerReward":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Reward"}]},"referralCodeUsed":{"type":"string","nullable":true},"shareLinkUsed":{"type":"string","nullable":true},"moderationStatus":{"type":"string","enum":["PENDING","ACTIONED"]},"referredModerationStatus":{"type":"string","enum":["PENDING","APPROVED","DENIED"]},"referrerModerationStatus":{"type":"string","enum":["PENDING","APPROVED","DENIED"]},"fraudSignals":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/FraudSignals"}]},"dateReferralStarted":{"type":"integer","format":"int64"},"dateReferralPaid":{"type":"integer","format":"int64","nullable":true},"dateReferralEnded":{"type":"integer","format":"int64","nullable":true},"dateModerated":{"type":"integer","format":"int64","nullable":true},"dateConverted":{"type":"integer","format":"int64","nullable":true,"description":"Unix timestamp (milliseconds) when the referral converted."},"dateModified":{"type":"integer","format":"int64","description":"Unix timestamp (milliseconds) when the referral was last modified."},"dateUserModified":{"type":"integer","format":"int64","nullable":true,"description":"Unix timestamp (milliseconds) when the referred user was last modified."},"programId":{"type":"string","nullable":true,"description":"The ID of the program this referral belongs to."}}},"User":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"lastInitial":{"type":"string"},"email":{"type":"string","format":"email"},"emailHash":{"type":"string","description":"An MD5 hash of the user's email address."},"imageUrl":{"type":"string","description":"URL of the user's profile image. Empty string if not set."},"referralCode":{"type":"string"},"cookieId":{"type":"string","nullable":true},"paymentProviderId":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"referralSource":{"type":"string","nullable":true},"firstSeenIP":{"type":"string","nullable":true},"lastSeenIP":{"type":"string","nullable":true},"dateCreated":{"type":"integer","format":"int64"},"dateBlocked":{"type":"integer","format":"int64","nullable":true},"shareLinks":{"type":"object","description":"The user's share links, organised by share medium and engagement medium."}}},"Reward":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"uniqueId":{"type":"string","nullable":true},"dateCreated":{"type":"integer","format":"int64"},"dateScheduledFor":{"type":"integer","format":"int64","nullable":true},"dateGiven":{"type":"integer","format":"int64","nullable":true},"dateExpires":{"type":"integer","format":"int64","nullable":true},"dateCancelled":{"type":"integer","format":"int64","nullable":true},"accountId":{"type":"string"},"userId":{"type":"string"},"cancellable":{"type":"boolean"},"rewardSource":{"type":"string"},"programId":{"type":"string","nullable":true},"programRewardKey":{"type":"string","nullable":true},"globalRewardKey":{"type":"string","nullable":true},"referralId":{"type":"string","nullable":true},"unit":{"type":"string"},"assignedCredit":{"type":"integer"},"redeemedCredit":{"type":"integer"},"name":{"type":"string"},"currency":{"type":"string","nullable":true},"redemptions":{"type":"object","nullable":true}}},"FraudSignals":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/FraudSignal"},"ip":{"$ref":"#/components/schemas/FraudSignal"},"email":{"$ref":"#/components/schemas/FraudSignal"},"rate":{"$ref":"#/components/schemas/FraudSignal"}}},"FraudSignal":{"type":"object","properties":{"message":{"type":"string"},"score":{"type":"integer"}}},"Error":{"properties":{"statusCode":{"type":"integer","format":"int32"},"message":{"type":"string","description":"The human-readable description of what went wrong. Use this to help you debug."},"apiErrorCode":{"type":"string","description":"A machine-readable error code."},"rsCode":{"type":"string","nullable":true,"description":"A secondary machine-readable error code."}}}},"responses":{"GeneralError":{"description":"Unexpected Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/{tenant_alias}/referrals/{referralId}":{"get":{"summary":"Lookup a Referral","description":"Looks up a single Referral object by its associated `id`.","operationId":"getReferral","tags":["Referral"],"parameters":[{"$ref":"#/components/parameters/tenant_alias"},{"name":"referralId","in":"path","description":"The `id` of the referral to look up","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Referral found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Referral"}}}},"404":{"description":"Referral NOT found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"$ref":"#/components/responses/GeneralError"}}}}}}
```

## Moderate referrals

> Moderates one or several referrals by either approving or denying.

```json
{"openapi":"3.1.0","info":{"title":"SaaSquatch by impact.com API - Referral","version":"1.0.0"},"tags":[{"name":"Referral","description":"A Referral tracks who has referred whom."}],"servers":[{"url":"https://app.referralsaasquatch.com/api/v1","description":"SaaSquatch Production Server"}],"security":[{"APIKey":[]},{"UserJWT":[]}],"components":{"securitySchemes":{"APIKey":{"type":"http","scheme":"basic","description":"Authorize your requests using a tenant's API Key."},"UserJWT":{"type":"apiKey","in":"header","name":"X-SaaSquatch-User-Token","description":"Authorize your requests using a JWT for a given user."}},"schemas":{"ReferralModerationBulkRequest":{"description":"A request to perform one or several moderation actions.","required":["actions"],"properties":{"actions":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/ReferralModerationRequest"}}}},"ReferralModerationRequest":{"description":"A request to moderate a single referral.","required":["referralId","action"],"properties":{"referralId":{"type":"string"},"action":{"type":"string","enum":["APPROVED","DENIED","REFERRER_APPROVED","REFERRED_APPROVED","REFERRER_DENIED","REFERRED_DENIED"]}}},"Error":{"properties":{"statusCode":{"type":"integer","format":"int32"},"message":{"type":"string","description":"The human-readable description of what went wrong. Use this to help you debug."},"apiErrorCode":{"type":"string","description":"A machine-readable error code."},"rsCode":{"type":"string","nullable":true,"description":"A secondary machine-readable error code."}}}},"parameters":{"tenant_alias":{"name":"tenant_alias","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant being referenced. E.g. `\"aboih12h16t\"`"}},"responses":{"GeneralError":{"description":"Unexpected Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/{tenant_alias}/referrals/moderate":{"post":{"summary":"Moderate referrals","description":"Moderates one or several referrals by either approving or denying.","operationId":"moderateReferrals","tags":["Referral","Classic Only"],"requestBody":{"description":"Details of the referrals to be moderated.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralModerationBulkRequest"}}}},"parameters":[{"$ref":"#/components/parameters/tenant_alias"}],"responses":{"200":{"description":"Success"},"default":{"$ref":"#/components/responses/GeneralError"}}}}}}
```

## List referrals (Open Endpoint)

> Lists all of the referrals involving the given user. This is an Open Endpoint and is disabled by default.

```json
{"openapi":"3.1.0","info":{"title":"SaaSquatch by impact.com API - Referral","version":"1.0.0"},"tags":[{"name":"Referral","description":"A Referral tracks who has referred whom."}],"servers":[{"url":"https://app.referralsaasquatch.com/api/v1","description":"SaaSquatch Production Server"}],"security":[{"APIKey":[]},{"UserJWT":[]}],"components":{"securitySchemes":{"APIKey":{"type":"http","scheme":"basic","description":"Authorize your requests using a tenant's API Key."},"UserJWT":{"type":"apiKey","in":"header","name":"X-SaaSquatch-User-Token","description":"Authorize your requests using a JWT for a given user."}},"parameters":{"tenant_alias":{"name":"tenant_alias","in":"path","required":true,"schema":{"type":"string"},"description":"Tenant being referenced. E.g. `\"aboih12h16t\"`"},"limit":{"name":"limit","in":"query","schema":{"type":"integer","default":10},"description":"A limit on the number of results returned."},"offset":{"name":"offset","in":"query","schema":{"type":"integer","default":0},"description":"Offsets the first result to return in the list for pagination."}},"schemas":{"ReferralList":{"type":"object","properties":{"count":{"type":"integer"},"totalCount":{"type":"integer"},"referrals":{"type":"array","items":{"$ref":"#/components/schemas/Referral"}}}},"Referral":{"description":"A link between the user/account of the referrer and the new referred user/account.","properties":{"id":{"type":"string"},"referredUser":{"$ref":"#/components/schemas/User"},"referrerUser":{"$ref":"#/components/schemas/User"},"referredReward":{"$ref":"#/components/schemas/Reward"},"referrerReward":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/Reward"}]},"referralCodeUsed":{"type":"string","nullable":true},"shareLinkUsed":{"type":"string","nullable":true},"moderationStatus":{"type":"string","enum":["PENDING","ACTIONED"]},"referredModerationStatus":{"type":"string","enum":["PENDING","APPROVED","DENIED"]},"referrerModerationStatus":{"type":"string","enum":["PENDING","APPROVED","DENIED"]},"fraudSignals":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/FraudSignals"}]},"dateReferralStarted":{"type":"integer","format":"int64"},"dateReferralPaid":{"type":"integer","format":"int64","nullable":true},"dateReferralEnded":{"type":"integer","format":"int64","nullable":true},"dateModerated":{"type":"integer","format":"int64","nullable":true},"dateConverted":{"type":"integer","format":"int64","nullable":true,"description":"Unix timestamp (milliseconds) when the referral converted."},"dateModified":{"type":"integer","format":"int64","description":"Unix timestamp (milliseconds) when the referral was last modified."},"dateUserModified":{"type":"integer","format":"int64","nullable":true,"description":"Unix timestamp (milliseconds) when the referred user was last modified."},"programId":{"type":"string","nullable":true,"description":"The ID of the program this referral belongs to."}}},"User":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"lastInitial":{"type":"string"},"email":{"type":"string","format":"email"},"emailHash":{"type":"string","description":"An MD5 hash of the user's email address."},"imageUrl":{"type":"string","description":"URL of the user's profile image. Empty string if not set."},"referralCode":{"type":"string"},"cookieId":{"type":"string","nullable":true},"paymentProviderId":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"referralSource":{"type":"string","nullable":true},"firstSeenIP":{"type":"string","nullable":true},"lastSeenIP":{"type":"string","nullable":true},"dateCreated":{"type":"integer","format":"int64"},"dateBlocked":{"type":"integer","format":"int64","nullable":true},"shareLinks":{"type":"object","description":"The user's share links, organised by share medium and engagement medium."}}},"Reward":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"uniqueId":{"type":"string","nullable":true},"dateCreated":{"type":"integer","format":"int64"},"dateScheduledFor":{"type":"integer","format":"int64","nullable":true},"dateGiven":{"type":"integer","format":"int64","nullable":true},"dateExpires":{"type":"integer","format":"int64","nullable":true},"dateCancelled":{"type":"integer","format":"int64","nullable":true},"accountId":{"type":"string"},"userId":{"type":"string"},"cancellable":{"type":"boolean"},"rewardSource":{"type":"string"},"programId":{"type":"string","nullable":true},"programRewardKey":{"type":"string","nullable":true},"globalRewardKey":{"type":"string","nullable":true},"referralId":{"type":"string","nullable":true},"unit":{"type":"string"},"assignedCredit":{"type":"integer"},"redeemedCredit":{"type":"integer"},"name":{"type":"string"},"currency":{"type":"string","nullable":true},"redemptions":{"type":"object","nullable":true}}},"FraudSignals":{"type":"object","properties":{"name":{"$ref":"#/components/schemas/FraudSignal"},"ip":{"$ref":"#/components/schemas/FraudSignal"},"email":{"$ref":"#/components/schemas/FraudSignal"},"rate":{"$ref":"#/components/schemas/FraudSignal"}}},"FraudSignal":{"type":"object","properties":{"message":{"type":"string"},"score":{"type":"integer"}}},"Error":{"properties":{"statusCode":{"type":"integer","format":"int32"},"message":{"type":"string","description":"The human-readable description of what went wrong. Use this to help you debug."},"apiErrorCode":{"type":"string","description":"A machine-readable error code."},"rsCode":{"type":"string","nullable":true,"description":"A secondary machine-readable error code."}}}},"responses":{"GeneralError":{"description":"Unexpected Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/{tenant_alias}/open/referrals":{"get":{"summary":"List referrals (Open Endpoint)","description":"Lists all of the referrals involving the given user. This is an Open Endpoint and is disabled by default.","operationId":"openListReferrals","tags":["Referral","Open Endpoint"],"parameters":[{"$ref":"#/components/parameters/tenant_alias"},{"name":"referringAccountId","in":"query","description":"Filters for referrals where this `AccountId` was the Referrer.","schema":{"type":"string"}},{"name":"referringUserId","in":"query","description":"Filters for referrals where this `UserId` was the Referrer.","schema":{"type":"string"}},{"name":"referredAccountId","in":"query","description":"Filters for referrals where this `AccountId` was the Referred User.","schema":{"type":"string"}},{"name":"referredUserId","in":"query","description":"Filters for referrals where this `UserId` was the Referred User.","schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"A list of referrals.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralList"}}}},"default":{"$ref":"#/components/responses/GeneralError"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integrations.impact.com/brand-api-reference/advocate-api-reference-v1/reference/referral-overview/referral.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
