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.
Name | Type | Description |
---|---|---|
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.
GET
https://api.growsurf.com/v2/campaign/:id/participant/:participantEmail
Retrieves a single participant from a campaign using the given participant email.
GET
https://api.growsurf.com/v2/campaign/:id/participants
Retrieves a list of participants in the campaign.
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.
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.
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.
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.
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.
*Please see our API Guidelines for more information about metadata.
POST
https://api.growsurf.com/v2/campaign/:id/participant/:participantEmail
Updates a participant within the campaign using the email 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 Email
endpoint for triggering referrals.
*Please see our API Guidelines for more information about metadata.
DELETE
https://api.growsurf.com/v2/campaign/:id/participant/:participantId
Removes a participant within the campaign using the ID of the participant.
(Looking to remove a bulk list of participants using a CSV file? View this tutorial).
DELETE
https://api.growsurf.com/v2/campaign/:id/participant/:participantEmail
Removes a participant within the campaign using the email of the participant.
(Looking to remove a bulk list of participants using a CSV file? View this tutorial).
GET
https://api.growsurf.com/v2/campaign/:id/participant/:participantId/rewards
Retrieves a list of rewards earned by a participant.
GET
https://api.growsurf.com/v2/campaign/:id/participant/:participantEmail/rewards
Retrieves a list of rewards earned by a participant.
Paging this response
Each response will contain a nextId
, that value is the id of the next participant and not the email therefore, you must use this endpoint in conjunction of our Get Participant Rewards by ID endpoint if you wish to page results starting with this endpoint. To page you would provide the nextId
as the participantId
path parameter within the Get Participant Rewards by ID request.
POST
https://api.growsurf.com/v2/campaign/:id/reward/:rewardId/approve
Approve a reward that was earned by a participant.
You should only use this endpoint if your reward automation level is set to Manually approve rewards (learn more here). This means ParticipantRewards
will be generated with status: "PENDING"
, approved: false
, and isFulfilled: false
.
Calling this endpoint to approve a reward will cause New Participant Reward emails to be sent out and automations/integrations to be triggered. If you are using Webhooks to automate rewards, a new PARTICIPANT_REACHED_A_GOAL
event will be emitted with data.reward.approved
as false
.
POST
https://api.growsurf.com/v2/campaign/:id/reward/:rewardId/fulfill
Fulfill a reward that was earned by a participant (this can only be done if the reward is already approved). When you call this endpoint, the ParticipantReward
should have the following key-values: status: "PENDING"
, approved: true
, and isFulfilled: false
.
Fulfilling a reward does not trigger any emails or automations. It helps you stay organized when managing rewards from your GrowSurf admin dashboard (e.g, you won't see any red notifications reminding you to fulfill rewards -- see video here).
DELETE
https://api.growsurf.com/v2/campaign/:id/reward/:rewardId
Remove a reward that was earned by a participant. This only applies if your campaign was configured with manual reward approval and if the provided participant reward has not been approved.
GET
https://api.growsurf.com/v2/campaign/:id/referrals
Retrieves a list of all referrals and email invites made by participants in a campaign. Response Cache In some cases responses from this endpoint will be cached for up to but no longer than 5 minutes. Anytime a new referral or invite is triggered within your campaign that cache will be purged.
GET
https://api.growsurf.com/v2/campaign/:id/participant/:participantId/referrals
Retrieves a list of all referrals and email invites made by a participant in a campaign. Response Cache In some cases responses from this endpoint will be cached for up to but no longer than 5 minutes. Anytime a new referral or invite is triggered within your campaign that cache will be purged.
GET
https://api.growsurf.com/v2/campaign/:id/participant/:participantEmail/referrals
Retrieves a list of all referrals and email invites made by a participant in a campaign. Response Cache In some cases responses from this endpoint will be cached for up to but no longer than 5 minutes. Anytime a new referral or invite is triggered within your campaign that cache will be purged.
POST
https://api.growsurf.com/v2/campaign/:id/participant/:participantId/invites
Sends email invites on behalf of a participant to a list of email addresses.
NOTE: Your campaign must have a custom 'From' email address in order for email invites to be sent out. Learn more here.
POST
https://api.growsurf.com/v2/campaign/:id/participant/:participantEmail/invites
Sends email invites on behalf of a participant to a list of email addresses.
NOTE: Your campaign must have a custom 'From' email address in order for email invites to be sent out. Learn more here.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
id*
string
The ID of the campaign to retrieve the participant from
participantId*
string
The ID of the participant to retrieve
id*
string
The ID of the campaign to retrieve the participant from
participantEmail*
string
The email of the participant to retrieve
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.
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.
id*
string
The ID of the campaign to add the new participant to
email*
string
The email of the new participant
referredBy
string
Set a referrer for this participant by providing the referrer's unique ID or email
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.
id*
string
The ID of the campaign
participantId*
string
The ID of the referred participant
id*
string
The ID of the campaign
participantEmail*
string
The email address of the referred participant
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 (CREDIT_AWARDED
) the status cannot be updated and an error response will be returned.
vanityKeys
array
A list containing vanity IDs of the participant. This is useful for personalizing referral links for the participant.
The following rules apply:
- vanityKeys
must be an array with no more than 5 vanity IDs.
- Vanity IDs must be between 1-20 characters.
- Vanity IDs can only contain numbers, letters, underscores, and hyphens.
- Vanity IDs must be unique and cannot be identical to another participant's GrowSurf or vanity ID.
unsubscribed
boolean
The participant's unsubscribed status. If true
, they will not receive any campaign emails.
id*
string
The campaign ID
participantEmail*
string
The participant email
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 the 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 participant metadata, any existing values provided will overwrite and replace the existing metadata.*
To remove 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 (CREDIT_AWARDED
) the status cannot be updated and an error response will be returned.
vanityKeys
array
A list containing vanity IDs of the participant. This is useful for personalizing referral links for the participant.
The following rules apply:
- vanityKeys
must be an array with no more than 5 vanity IDs.
- Vanity IDs must be between 1-20 characters.
- Vanity IDs can only contain numbers, letters, underscores, and hyphens.
- Vanity IDs must be unique and cannot be identical to another participant's GrowSurf or vanity ID.
unsubscribed
boolean
The participant's unsubscribed status. If true
, they will not receive any campaign emails.
id*
string
The ID of the campaign
participantId*
string
The ID of the participant
id*
string
The campaign ID
participantEmail*
string
The participant email
id*
string
The campaign ID
participantId*
string
The participant's unique ID or email
nextId
string
The id of the participant reward 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 rewards otherwise the nextId
will be null
.
limit
string
The number of rewards to return. Must be a value less than or equal to 100, which is currently the maximum allowed per request.
id*
string
The id of the campaign.
participantEmail*
string
The participant email
nextId
string
The id of the participant reward 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 rewards otherwise the nextId
will be null
.
limit
string
The number of rewards to return. Must be a value less than or equal to 100, which is currently the maximum allowed per request.
id*
string
The campaign ID
rewardId*
string
The ID of the participant reward to approve
fulfill
boolean
Set true
to mark the reward as fulfilled.
Fulfilling a reward does not trigger any emails or automations. It helps you stay organized when managing rewards from your GrowSurf admin dashboard (e.g, you won't see any red notifications reminding you to fulfill rewards -- see video here).
id*
string
The campaign ID
rewardId*
string
The ID of the participant reward to fulfill
id*
string
The campaign ID
rewardId*
string
The ID of the participant reward to remove
id
string
The ID of the campaign
sortBy
string
If provided, will sort the results by the provided field. Valid sortBy options are updatedAt
, createdAt
, email
, referralTriggeredAt
.
By default, results are sorted by the updatedAt
timestamp in descending (most recent first) order.
desc
boolean
Defaults to true
, returning results in descending (most recent first) order.
Set desc
to false
to return results in ascending order.
limit
number
Limit the number of referral results to return. Must be a value less than or equal to 100 which is currently the maximum allowed per request.
offset
number
The offset number to start the result set at. This can be used to skip through the list or to page the list of results.
string
If provided, filters results by the given email value.
Any email value that is provided must be URL-encoded.
For data privacy and security purposes, invite (INVITE_SENT
) referral results cannot be filtered by email addresses.
firstName
string
If provided, filters results by the given first name value
lastName
string
If provided, filters results by the given last name value
referralStatus
string
If provided, filters results by the given referral status. Valid values for this filter are CREDIT_PENDING
, CREDIT_AWARDED
, CREDIT_EXPIRED
, INVITE_SENT
Any values other than the ones listed above will be ignored.
nextId
string
The ID of the result 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, based on the provided sortBy
value, if there are more results otherwise the nextId
value will be null
.
A boolean field more
will always be present for determining if there are more results.
id
string
The campaign ID
participantId
string
βThe participant ID
sortBy
string
If provided, will sort results by the provided field.
Valid options are updatedAt
, createdAt
, email
, referralTriggeredAt
.
By default, the results are sorted by the updatedAt
timestamp in descending (most recent first) order.
desc
string
Defaults to true, returning results in descending (most recent first) order.
Set desc
to false
to return results in ascending order.
limit
string
Limit the number of referral results to return. Must be a value less than or equal to 100 which is currently the maximum allowed per request.
offset
string
The offset number to start the result set at. This can be used to skip the list or page the list of results.
string
If provided, filters results by the provided email value. Any email value that is provided must be URL encoded.
For data privacy and security purposes, invite (INVITE_SENT
) referral results cannot be filtered by email addresses.
firstName
string
If provided, filters results by the given first name value
lastName
string
If provided, filters results by the given last name value
referralStatus
string
If provided, filters results by the given referral status. Valid values for this filter are CREDIT_PENDING
, CREDIT_AWARDED
, CREDIT_EXPIRED
, INVITE_SENT
.
Any values other than the ones listed above will be ignored.
nextId
string
The ID of the result 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, based on the provided sortBy
value, if there are more results otherwise the nextId
value will be null
.
A boolean field more
will always be present for determining if there are more results.
id
string
The campaign ID
participantEmail
string
βThe email of the participant to retrieve the referrals for
sortBy
string
If provided, will sort results by the provided field.
Valid options are updatedAt
, createdAt
, email
, referralTriggeredAt
.
By default, the results are sorted by the updatedAt
timestamp in descending (most recent first) order.
desc
string
Defaults to true, returning results in descending (most recent first) order.
Set desc
to false
to return results in ascending order.
limit
string
Limit the number of referral results to return. Must be a value less than or equal to 100 which is currently the maximum allowed per request.
offset
string
The offset number to start the result set at. This can be used to skip the list or page the list of results.
string
If provided, filters results by the provided email value. Any email value that is provided must be URL encoded.
For data privacy and security purposes, invite (INVITE_SENT
) referral results cannot be filtered by email addresses.
firstName
string
If provided, filters results by the given first name value
lastName
string
If provided, filters results by the given last name value
referralStatus
string
If provided, filters results by the given referral status. Valid values for this filter are CREDIT_PENDING
, CREDIT_AWARDED
, CREDIT_EXPIRED
, INVITE_SENT
.
Any values other than the ones listed above will be ignored.
nextId
string
The ID of the result 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, based on the provided sortBy
value, if there are more results otherwise the nextId
value will be null
.
A boolean field more
will always be present for determining if there are more results.
id*
string
The campaign ID
participantId*
string
The participant ID
emailAddresses*
array
A list of email addresses to send invites to
messageText*
string
The email message body.
Make sure to include {{referrerMessage}}
in the contents, which will be interpolated with the participant's personalized message.
You can also pass in the following values:
{{referrerFirstName}}
{{referrerLastName}}
{{referrerEmail}}
{{referrerShareUrl}}
subjectText*
string
The email subject line.
You can pass in the following values:
{{referrerFirstName}}
{{referrerLastName}}
{{referrerEmail}}
{{referrerMessage}}
{{referrerShareUrl}}
id*
string
The campaign ID
participantEmail*
string
The participant's email address
emailAddresses*
array
A list of email addresses to send invites to
messageText*
string
The email message body.
Make sure to include {{referrerMessage}}
in the contents, which will be interpolated with the participant's personalized message.
You can also pass in the following values:
{{referrerFirstName}}
{{referrerLastName}}
{{referrerEmail}}
{{referrerShareUrl}}
subjectText*
string
The email subject line.
You can pass in the following values:
{{referrerFirstName}}
{{referrerLastName}}
{{referrerEmail}}
{{referrerMessage}}
{{referrerShareUrl}}
id*
string
The ID of the campaign to retrieve