> For the complete documentation index, see [llms.txt](https://referral-rocket.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://referral-rocket.gitbook.io/docs/developer-tools/rest-api/api-endpoint.md).

# API Endpoint

## POST /api/v1/addParticipant

> Add participants to a program by providing the campaign ID and their email address. Optionally, if a 'referredByCode' or 'referredByEmail' is provided, the user will be added as a referral to the participant with the corresponding code.

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://app.referralrocket.io","description":"Generated server url"}],"paths":{"/api/v1/addParticipant":{"post":{"tags":["v-1-controller"],"description":"Add participants to a program by providing the campaign ID and their email address. Optionally, if a 'referredByCode' or 'referredByEmail' is provided, the user will be added as a referral to the participant with the corresponding code.","operationId":"addParticipant","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["id","email"],"properties":{"id":{"type":"string","description":"The ID of the campaign."},"email":{"type":"string","description":"The email address of the participant."},"referredByCode":{"type":"string","description":"Referral code of the participant referring."},"referredByEmail":{"type":"string","description":"Email of the participant referring."}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}}}}}}},"components":{"schemas":{"ParticipantResponse":{"type":"object","properties":{"email":{"type":"string","description":"The email address of the participant."},"firstName":{"type":"string","description":"The first name of the participant."},"lastName":{"type":"string","description":"The last name of the participant."},"referralCode":{"type":"string","description":"The unique referral code of the participant."},"referredByCode":{"type":"string","description":"The referral code of the invitee."},"createdOn":{"type":"string","format":"date-time","description":"The datetime when participant joined the program."},"campaignId":{"type":"string","description":"The campaign Id of the program participant is part of."},"shareLink":{"type":"string","description":"The unique referral link of the participant."},"totalReferrals":{"type":"integer","description":"The total referrals made by the participant."},"referralReward":{"type":"integer","description":"The total rewards earned by referrals."},"referralRewardRedeemed":{"type":"integer","description":"The total referral reward redeemed."},"referralRewardBalance":{"type":"integer","description":"The total referral balance left."},"refereeReward":{"type":"integer","description":"The total rewards earned by joining the program."},"refereeRewardRedeemed":{"type":"integer","description":"The total referee reward redeemed."},"refereeRewardBalance":{"type":"integer","description":"The total referee balance left."},"rewardEventCompleted":{"type":"boolean","description":"The Boolean flag to indicate if the participant fulfilled the event required to earn the reward."},"fraudScore":{"type":"string","description":"The fraud score of the participant. Will be empty for participant created via APIs."}}},"ErrorDetail":{"type":"object","properties":{"message":{"type":"string"}}}}}}
```

## GET /api/v1/getCampaign

> Get campaign program details for the given Id.

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://app.referralrocket.io","description":"Generated server url"}],"paths":{"/api/v1/getCampaign":{"get":{"tags":["v-1-controller"],"description":"Get campaign program details for the given Id.","operationId":"getCampaignById","parameters":[{"name":"id","in":"query","required":true,"description":"Campaign Id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}}}}}}},"components":{"schemas":{"CampaignResponse":{"type":"object","properties":{"campaignId":{"type":"string","description":"The ID of the campaign."},"campaignName":{"type":"string","description":"The name of the campaign."},"status":{"type":"string","description":"Campaign status. [Active, Pause, End].","enum":["Active","Pause","End"]},"createdOn":{"type":"string","format":"date-time","description":"Campaign creation date."},"end":{"type":"string","format":"date-time","description":"Campaign end date if set."},"hostURL":{"type":"string","description":"Campaign URL."},"paused":{"type":"boolean","description":"The flag indicates if the campaign is paused or not."},"ended":{"type":"boolean","description":"The flag indicates if the campaign has ended or not."},"rewardHeader":{"type":"string","description":"Campaign reward header."},"rewardDescription":{"type":"string","description":"Campaign reward description."},"shareHeader":{"type":"string","description":"Campaign share widget header."},"shareDescription":{"type":"string","description":"Campaign share widget description."},"referrerRewardValue":{"type":"integer","description":"Referrer reward value."},"refereeRewardValue":{"type":"integer","description":"Referee reward value."},"rewardType":{"type":"string","description":"Reward type."},"participants":{"type":"integer","description":"Total participant in the campaign."}}},"ErrorDetail":{"type":"object","properties":{"message":{"type":"string"}}}}}}
```

## GET /api/v1/validateCode

> Validate referrer code for a campaign.

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://app.referralrocket.io","description":"Generated server url"}],"paths":{"/api/v1/validateCode":{"get":{"tags":["v-1-controller"],"description":"Validate referrer code for a campaign.","operationId":"validateCode","parameters":[{"name":"campaignId","in":"query","required":true,"description":"Campaign Id","schema":{"type":"string"}},{"name":"code","in":"query","required":true,"description":"Code","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"boolean"}}}}}}}}}
```

## GET /api/v1/getParticipant

> Get participant details for given campaign Id and email.

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://app.referralrocket.io","description":"Generated server url"}],"paths":{"/api/v1/getParticipant":{"get":{"tags":["v-1-controller"],"description":"Get participant details for given campaign Id and email.","operationId":"getParticipant","parameters":[{"name":"email","in":"query","required":true,"description":"Email address of the participant","schema":{"type":"string"}},{"name":"id","in":"query","required":true,"description":"Campaign Id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantResponse"}}}}}}}},"components":{"schemas":{"ParticipantResponse":{"type":"object","properties":{"email":{"type":"string","description":"The email address of the participant."},"firstName":{"type":"string","description":"The first name of the participant."},"lastName":{"type":"string","description":"The last name of the participant."},"referralCode":{"type":"string","description":"The unique referral code of the participant."},"referredByCode":{"type":"string","description":"The referral code of the invitee."},"createdOn":{"type":"string","format":"date-time","description":"The datetime when participant joined the program."},"campaignId":{"type":"string","description":"The campaign Id of the program participant is part of."},"shareLink":{"type":"string","description":"The unique referral link of the participant."},"totalReferrals":{"type":"integer","description":"The total referrals made by the participant."},"referralReward":{"type":"integer","description":"The total rewards earned by referrals."},"referralRewardRedeemed":{"type":"integer","description":"The total referral reward redeemed."},"referralRewardBalance":{"type":"integer","description":"The total referral balance left."},"refereeReward":{"type":"integer","description":"The total rewards earned by joining the program."},"refereeRewardRedeemed":{"type":"integer","description":"The total referee reward redeemed."},"refereeRewardBalance":{"type":"integer","description":"The total referee balance left."},"rewardEventCompleted":{"type":"boolean","description":"The Boolean flag to indicate if the participant fulfilled the event required to earn the reward."},"fraudScore":{"type":"string","description":"The fraud score of the participant. Will be empty for participant created via APIs."}}}}}}
```

## GET /api/v1/getAllParticipants

> Get all participants of a campaign. API returns 20 records at a time. You can adjust the size by passing in the Pageable params.

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://app.referralrocket.io","description":"Generated server url"}],"paths":{"/api/v1/getAllParticipants":{"get":{"tags":["v-1-controller"],"description":"Get all participants of a campaign. API returns 20 records at a time. You can adjust the size by passing in the Pageable params.","operationId":"getAllParticipants","parameters":[{"name":"id","in":"query","required":true,"description":"Campaign Id","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantResponse"}}}}}}}}},"components":{"schemas":{"Pageable":{"type":"object","properties":{"page":{"minimum":0,"type":"integer","format":"int32"},"size":{"minimum":1,"type":"integer","format":"int32"},"sort":{"type":"array","items":{"type":"string"}}}},"ParticipantResponse":{"type":"object","properties":{"email":{"type":"string","description":"The email address of the participant."},"firstName":{"type":"string","description":"The first name of the participant."},"lastName":{"type":"string","description":"The last name of the participant."},"referralCode":{"type":"string","description":"The unique referral code of the participant."},"referredByCode":{"type":"string","description":"The referral code of the invitee."},"createdOn":{"type":"string","format":"date-time","description":"The datetime when participant joined the program."},"campaignId":{"type":"string","description":"The campaign Id of the program participant is part of."},"shareLink":{"type":"string","description":"The unique referral link of the participant."},"totalReferrals":{"type":"integer","description":"The total referrals made by the participant."},"referralReward":{"type":"integer","description":"The total rewards earned by referrals."},"referralRewardRedeemed":{"type":"integer","description":"The total referral reward redeemed."},"referralRewardBalance":{"type":"integer","description":"The total referral balance left."},"refereeReward":{"type":"integer","description":"The total rewards earned by joining the program."},"refereeRewardRedeemed":{"type":"integer","description":"The total referee reward redeemed."},"refereeRewardBalance":{"type":"integer","description":"The total referee balance left."},"rewardEventCompleted":{"type":"boolean","description":"The Boolean flag to indicate if the participant fulfilled the event required to earn the reward."},"fraudScore":{"type":"string","description":"The fraud score of the participant. Will be empty for participant created via APIs."}}}}}}
```

## GET /api/v1/getReferrals

> Return all referrals of a participant. The API returns 20 records at a time. You can adjust the size by passing the Pageable params.

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://app.referralrocket.io","description":"Generated server url"}],"paths":{"/api/v1/getReferrals":{"get":{"tags":["v-1-controller"],"description":"Return all referrals of a participant. The API returns 20 records at a time. You can adjust the size by passing the Pageable params.","operationId":"getReferrals","parameters":[{"name":"id","in":"query","required":true,"description":"Campaign Id","schema":{"type":"string"}},{"name":"email","in":"query","required":true,"description":"Email address of the participant","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ParticipantResponse"}}}}}}}}},"components":{"schemas":{"Pageable":{"type":"object","properties":{"page":{"minimum":0,"type":"integer","format":"int32"},"size":{"minimum":1,"type":"integer","format":"int32"},"sort":{"type":"array","items":{"type":"string"}}}},"ParticipantResponse":{"type":"object","properties":{"email":{"type":"string","description":"The email address of the participant."},"firstName":{"type":"string","description":"The first name of the participant."},"lastName":{"type":"string","description":"The last name of the participant."},"referralCode":{"type":"string","description":"The unique referral code of the participant."},"referredByCode":{"type":"string","description":"The referral code of the invitee."},"createdOn":{"type":"string","format":"date-time","description":"The datetime when participant joined the program."},"campaignId":{"type":"string","description":"The campaign Id of the program participant is part of."},"shareLink":{"type":"string","description":"The unique referral link of the participant."},"totalReferrals":{"type":"integer","description":"The total referrals made by the participant."},"referralReward":{"type":"integer","description":"The total rewards earned by referrals."},"referralRewardRedeemed":{"type":"integer","description":"The total referral reward redeemed."},"referralRewardBalance":{"type":"integer","description":"The total referral balance left."},"refereeReward":{"type":"integer","description":"The total rewards earned by joining the program."},"refereeRewardRedeemed":{"type":"integer","description":"The total referee reward redeemed."},"refereeRewardBalance":{"type":"integer","description":"The total referee balance left."},"rewardEventCompleted":{"type":"boolean","description":"The Boolean flag to indicate if the participant fulfilled the event required to earn the reward."},"fraudScore":{"type":"string","description":"The fraud score of the participant. Will be empty for participant created via APIs."}}}}}}
```

## POST /api/v1/qualifyParticipant

> Mark qualifying event complete for a participant. Marking a qualifying event complete for a participant will result in the referrer being eligible for a reward. Only referred participants can be can complete a qualifying event and hence marked as qualified.

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://app.referralrocket.io","description":"Generated server url"}],"paths":{"/api/v1/qualifyParticipant":{"post":{"tags":["v-1-controller"],"description":"Mark qualifying event complete for a participant. Marking a qualifying event complete for a participant will result in the referrer being eligible for a reward. Only referred participants can be can complete a qualifying event and hence marked as qualified.","operationId":"fulfillRewardEvent","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["id","email"],"properties":{"id":{"type":"string","description":"The ID of the campaign."},"email":{"type":"string","description":"The email address of the participant."},"amountPaid":{"type":"string","description":"Amount spent/paid by participant."}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantResponse"}}}}}}}},"components":{"schemas":{"ParticipantResponse":{"type":"object","properties":{"email":{"type":"string","description":"The email address of the participant."},"firstName":{"type":"string","description":"The first name of the participant."},"lastName":{"type":"string","description":"The last name of the participant."},"referralCode":{"type":"string","description":"The unique referral code of the participant."},"referredByCode":{"type":"string","description":"The referral code of the invitee."},"createdOn":{"type":"string","format":"date-time","description":"The datetime when participant joined the program."},"campaignId":{"type":"string","description":"The campaign Id of the program participant is part of."},"shareLink":{"type":"string","description":"The unique referral link of the participant."},"totalReferrals":{"type":"integer","description":"The total referrals made by the participant."},"referralReward":{"type":"integer","description":"The total rewards earned by referrals."},"referralRewardRedeemed":{"type":"integer","description":"The total referral reward redeemed."},"referralRewardBalance":{"type":"integer","description":"The total referral balance left."},"refereeReward":{"type":"integer","description":"The total rewards earned by joining the program."},"refereeRewardRedeemed":{"type":"integer","description":"The total referee reward redeemed."},"refereeRewardBalance":{"type":"integer","description":"The total referee balance left."},"rewardEventCompleted":{"type":"boolean","description":"The Boolean flag to indicate if the participant fulfilled the event required to earn the reward."},"fraudScore":{"type":"string","description":"The fraud score of the participant. Will be empty for participant created via APIs."}}}}}}
```
