API Reference
This reference documents the GrowSurf REST API, including all available public methods and examples of each.
Open in Postman
Easily test these API methods dynamically by using our Postman Collection.
Campaigns
Get Campaign
GET
https://api.growsurf.com/v2/campaign/:id
Retrieves a campaign for the given ID.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The ID of the campaign to retrieve |
Get Campaigns
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.
Participants
Get Participant by ID
GET
https://api.growsurf.com/v2/campaign/:id/participant/:participantId
Retrieves a single participant from a campaign using the given participant ID.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The ID of the campaign to retrieve the participant from |
participantId* | string | The ID of the participant to retrieve |
Get Participant by Email
GET
https://api.growsurf.com/v2/campaign/:id/participant/:participantEmail
Retrieves a single participant from a campaign using the given participant email.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The ID of the campaign to retrieve the participant from |
participantEmail* | string | The email of the participant to retrieve |
Get Participants
GET
https://api.growsurf.com/v2/campaign/:id/participants
Retrieves a list of participants in the campaign.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The ID of the campaign |
Query Parameters
Name | Type | Description |
---|---|---|
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 |
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 Leaderboard
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.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The ID of the campaign |
Query Parameters
Name | Type | Description |
---|---|---|
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 |
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 |
leaderboardType | string | Returns the leaderboard for the specified type if provided.
Options
|
Add Participant
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.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The ID of the campaign to add the new participant to |
Request Body
Name | Type | Description |
---|---|---|
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 |
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. |
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 toCREDIT_PENDING
If the referral trigger is Sign Up, then
referralStatus
will default toCREDIT_AWARDED
Trigger Referral by Participant ID
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.
Path Parameters
Name | Type | Description |
---|---|---|
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 ofCREDIT_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.
Trigger Referral by Participant Email
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.
Path Parameters
Name | Type | Description |
---|---|---|
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 ofCREDIT_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.
Update Participant by ID
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.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The ID of the campaign |
participantId* | string | The ID of the participant |
Request Body
Name | Type | Description |
---|---|---|
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 |
referralStatus | string | Set the referral status of this participant's referrer to |
vanityKeys | array | A list containing vanity IDs of the participant. This is useful for personalizing referral links for the participant.
The following rules apply:
- |
*Please see our API Guidelines for more information about metadata.
Update Participant by Email
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.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The campaign ID |
participantEmail* | string | The participant email |
Request Body
Name | Type | Description |
---|---|---|
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 |
referralStatus | string | Set the referral status of this participant's referrer to |
vanityKeys | array | A list containing vanity IDs of the participant. This is useful for personalizing referral links for the participant.
The following rules apply:
- |
*Please see our API Guidelines for more information about metadata.
Remove Participant by ID
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).
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The ID of the campaign |
participantId* | string | The ID of the participant |
Remove Participant by Email
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).
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The campaign ID |
participantEmail* | string | The participant email |
Participant Rewards
Get Participant Rewards by Participant ID
GET
https://api.growsurf.com/v2/campaign/:id/participant/:participantId/rewards
Retrieves a list of rewards earned by a participant.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The campaign ID |
participantId* | string | The participant's unique ID or email |
Query Parameters
Name | Type | Description |
---|---|---|
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 |
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. |
Get Participant Rewards by Participant Email
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.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The id of the campaign. |
participantEmail* | string | The participant email |
Query Parameters
Name | Type | Description |
---|---|---|
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 |
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. |
Approve Participant Reward
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
.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The campaign ID |
rewardId* | string | The ID of the participant reward to approve |
Request Body
Name | Type | Description |
---|---|---|
fulfill | boolean | Set 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). |
Fulfill Participant Reward
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).
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The campaign ID |
rewardId* | string | The ID of the participant reward to fulfill |
Remove Participant Reward
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.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The campaign ID |
rewardId* | string | The ID of the participant reward to remove |
Referrals and Invites
Get Referrals and Invites
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.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The ID of the campaign |
Query Parameters
Name | Type | Description |
---|---|---|
sortBy | string | If provided, will sort the results by the provided field. Valid sortBy options are |
desc | boolean | Defaults to |
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 ( | |
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 |
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 A boolean field |
Get Participant Referrals and Invites by ID
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.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The campaign ID |
participantId | string | The participant ID |
Query Parameters
Name | Type | Description |
---|---|---|
sortBy | string | If provided, will sort results by the provided field.
Valid options are |
desc | string | Defaults to true, returning results in descending (most recent first) order.
Set |
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 ( | |
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 |
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 A boolean field |
Get Participant Referrals and Invites by Email
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.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The campaign ID |
participantEmail | string | The email of the participant to retrieve the referrals for |
Query Parameters
Name | Type | Description |
---|---|---|
sortBy | string | If provided, will sort results by the provided field.
Valid options are |
desc | string | Defaults to true, returning results in descending (most recent first) order.
Set |
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 ( | |
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 |
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 A boolean field |
Send Participant Invites by ID
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.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The campaign ID |
participantId* | string | The participant ID |
Request Body
Name | Type | Description |
---|---|---|
emailAddresses* | array | A list of email addresses to send invites to |
messageText* | string | The email message body. Make sure to include You can also pass in the following values:
|
subjectText* | string | The email subject line. You can pass in the following values:
|
Send Participant Invites by Email
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.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | The campaign ID |
participantEmail* | string | The participant's email address |
Request Body
Name | Type | Description |
---|---|---|
emailAddresses* | array | A list of email addresses to send invites to |
messageText* | string | The email message body. Make sure to include You can also pass in the following values:
|
subjectText* | string | The email subject line.
You can pass in the following values:
|
Last updated