API Reference
This reference documents the GrowSurf REST API, including all available public methods and examples of each.
Last updated
This reference documents the GrowSurf REST API, including all available public methods and examples of each.
Last updated
Easily test these API methods dynamically by using our Postman Collection.
GET
https://api.growsurf.com/v2/campaign/:id
Retrieves a campaign for the given ID.
id*
string
The ID of the campaign to retrieve
GET
https://api.growsurf.com/v2/campaigns
Retrieves a list of your campaigns. Campaigns that have been deleted will not be returned in this response.
GET
https://api.growsurf.com/v2/campaign/:id/participant/:participantId
Retrieves a single participant from a campaign using the given participant ID.
id*
string
The ID of the campaign to retrieve the participant from
participantId*
string
The ID of the participant to retrieve
GET
https://api.growsurf.com/v2/campaign/:id/participant/:participantEmail
Retrieves a single participant from a campaign using the given participant email.
id*
string
The ID of the campaign to retrieve the participant from
participantEmail*
string
The email of the participant to retrieve
GET
https://api.growsurf.com/v2/campaign/:id/participants
Retrieves a list of participants in the campaign.
id*
string
The ID of the campaign
nextId
string
The ID of the participant to start the next result set with. This can be used to skip through the list or to page the list results. Each response will provide a nextId
value if there are more participants otherwise the nextId
value will be null
.
limit
integer
The number of participants to return. Must be a value less than or equal to 100 which is currently the maximum we allow with this request.
GET
https://api.growsurf.com/v2/campaign/:id/leaderboard
Retrieves a list of participants in the campaign ordered by referral count in ascending order.
Monthly Referral Count Leaderboard
You can retrieve the campaign leaderboard ordered by the monthly referral count by providing a query parameter leaderboardType
with a value of CURRENT_MONTH
. This will retrieve a list of participants ordered by monthly referral count.
Monthly referral counts are automatically reset at the end of each month for each participant within your campaign, therefore results of the monthly referral count may vary.
Previous Monthly Referral Count Leaderboard
Similar to the monthly campaign leaderboard, providing a query parameter of leaderboardType
with a value of PREV_MONTH
will retrieve a list of participants order by the previous monthly referral count.
Participants that did not exist within the campaign during the previous month will not be returned within the previous monthly leaderboard response.
id*
string
The ID of the campaign
nextId
string
The ID of the participant to start the next result set with. This can be used to skip through the list or to page the list of results. Each response will provide a nextId
value if there are more participants otherwise, nextId
will be null
.
limit
string
The number of participants to return. Must be a value less than or equal to 100 and greater than 1. 100 is currently the maximum limit per reach request.
isMonthly
boolean
If true will return the leaderboard for monthly referral counts. Default is false
.
Deprecated
This currently works but will be removed in future versions of the GrowSurf RESTful API. Please use leaderboardType
instead.
leaderboardType
string
Returns the leaderboard for the specified type if provided.
Options
ALL_TIME
- Returns the all-time leaderboard, based on all-time referral counts. Default
CURRENT_MONTH
- Returns the current month's leaderboard, based on the current month's referral counts.
PREV_MONTH
- Returns the previous month's leaderboard, based on the previous month's referral counts (With this option, participants that did not exist within the campaign during the previous month will not be returned).
TOTAL_IMPRESSION_COUNT
- Returns the leaderboard based on total impression counts.
UNIQUE_IMPRESSION_COUNT
- Returns the leaderboard based on unique impression counts.
POST
https://api.growsurf.com/v2/campaign/:id/participant
Adds a new participant to the campaign.
If the participant with the same email address already exists, then the existing participant will be returned.
id*
string
The ID of the campaign to add the new participant to
email*
string
The email of the new participant
referredBy
string
referralStatus
string
Set the referral credit status of this new participant's referrer to CREDIT_PENDING
or CREDIT_AWARDED
. If a referredBy
value is provided, the default value will be set to CREDIT_AWARDED
unless another referralStatus
value is specified.
To award referral credit immediately to the referrer, set this referralStatus
value to CREDIT_AWARDED
, otherwise it will be set based on the referral trigger configured for your campaign.
firstName
string
The first name of the new participant
lastName
string
The last name of the new participant
ipAddress
string
The IP address of the new participant (if provided, this property will be used for anti-fraud measurements)
metadata
object
A shallow Object containing custom key/values to include with the participant data.
The following keys are restricted: gdprAgreements
Metadata: Please see our API Guidelines for more information about metadata.
† What's a campaign referral trigger?
You can update the campaign referral trigger in the Installation step of the Campaign Editor (see image). Depending on what you select, the API will automatically set a default value for the participant:
If the referral trigger is Sign up + Qualifying Action, then referralStatus
will default to CREDIT_PENDING
If the referral trigger is Sign Up, then referralStatus
will default to CREDIT_AWARDED
POST
https://api.growsurf.com/v2/campaign/:id/participant/:participantId/ref
Triggers a referral using an existing participant's ID, awarding referral credit to the referrer of the existing participant.
id*
string
The ID of the campaign
participantId*
string
The ID of the referred participant
Important Notes:
Referral credit will only be awarded to the referrer if the participant referralStatus
has a value of CREDIT_PENDING
Make sure your campaign's referral trigger is set to Sign Up + Qualifying Action (see image). If the referral trigger is set to Sign Up Event, triggering referrals will not work since referral credit has already been provided.
If your campaign has a referral credit expiration window set up, triggering a referral will still return a successful response even if the threshold has been exceeded, but the referrer will not receive credit and no rewards will be unlocked.
POST
https://api.growsurf.com/v2/campaign/:id/participant/:participantEmail/ref
Triggers a referral using an existing participant's email address, awarding referral credit to the referrer of the existing participant.
id*
string
The ID of the campaign
participantEmail*
string
The email address of the referred participant
Important Notes:
Referral credit will only be awarded to the referrer if the participant referralStatus
has a value of CREDIT_PENDING
Make sure your campaign's referral trigger is set to Sign Up + Qualifying Action (see image). If the referral trigger is set to Sign Up, triggering referrals will not work since referral credit has already been provided.
If your campaign has a referral credit expiration window set up, triggering a referral will still return a successful response even if the threshold has been exceeded, but the referrer will not receive credit and no rewards will be unlocked.
POST
https://api.growsurf.com/v2/campaign/:id/participant/:participantId
Updates a participant within the campaign using the ID of the participant.
Note: This endpoint is useful for use-cases like updating the participant's information (email address, first name, etc.) or assigning the participant a referrer by setting { referredBy, referralStatus }
. Although you can use this endpoint to trigger referral credit for the participant's referrer by setting { referredBy, referralStatus }
, we recommend using the /POST Trigger Referral by Participant ID
endpoint for triggering referrals.
id*
string
The ID of the campaign
participantId*
string
The ID of the participant
referredBy
string
Set a referrer for this participant by providing the referrer's unique ID or email. If provided and a referrer has already been assigned, the referrer will not be updated and a error response will be returned.
string
The new email to assign to this participant. If the given email is already assigned to another participant within the campaign, an error response will be returned.
firstName
string
The first name of the participant.
lastName
string
The last name of the participant
metadata
object
A shallow Object containing custom values to include in the participant data.
If any existing metadata exists for the participant, any new values provided will be appended to the existing metadata, any existing values provided will overwrite and replace the existing metadata.*
To remove any existing metadata set its value to null
.
referralStatus
string
Set the referral status of this participant's referrer to CREDIT_PENDING
, CREDIT_AWARDED
, or CREDIT_EXPIRED
.
If provided and the referral status has already been awarded (