API reference · App API
Referral growth
Ladders, boosts and gift links: what a referrer can reach and give away, to show in your referral screen.
Get a referrer’s ladders, boosts and gift links
/v1/referrals/growthEverything to show on a user’s referral screen beyond their code: progress up each ladder, boosts running now or soon, whether they can send gifts, and the gift links they have made. Creates their referrer account on first use.
AuthSigned request with an app key, fg_live_… or fg_test_…
Query parameters
appUserIdstringrequiredYour pseudonymous id for the user. Never an email address or phone number.
Returns · 200
programIdstringrequiredladdersarray of objectsrequiredChild attributes
ladderIdstringrequiredcampaignIdstringrequiredcampaignNamestringrequiredstatusstringrequiredOne of active paused
periodstringrequiredThe window referrals are counted in. Calendar periods are UTC.
One of campaign month quarter year
periodKeystringrequiredperiodStartstringrequiredperiodEndstringrequiredqualifiedintegerrequiredQualified referrals counted toward the ladder in this period.
countsobjectrequiredChild attributes
registeredintegerrequiredverifiedintegerrequiredqualifiedintegerrequiredrejectedintegerrequiredlevelstringrequiredLabel of the highest level reached.
tiersarray of objectsrequiredChild attributes
thresholdintegerrequiredQualified referrals needed.
amountintegerrequiredBonus in minor units; 0 for a level that carries no money.
currencystringrequiredlabelstringrequiredLevel name, e.g. "Silver".
unlocksstringrequiredA privilege the level brings; your app grants it.
statusstringrequiredreached: paid, or on its way, in this period.
One of reached open
reachedAtstringrequirednextobjectrequiredChild attributes
thresholdintegerrequiredremainingintegerrequiredamountintegerrequiredMinor units.
currencystringrequiredlabelstringrequiredboostsarray of objectsrequiredChild attributes
idstringrequiredcampaignIdstringrequirednamestringrequiredkindstringrequiredmultiplier: multiplierBps / 10000 times the reward (20000 is double). fixed: amount on top.
One of multiplier fixed
multiplierBpsintegerrequiredamountintegerrequiredcurrencystringrequiredappliesTostringrequiredOne of referrer referred_user both
startsAtstringrequiredendsAtstringrequiredmarketsarray of stringsrequiredCountries it applies to; empty for all.
segmentsarray of stringsrequiredmetadata.segment values of the invited user’s registration it applies to; empty for all.
livebooleanrequiredRunning now; otherwise it starts within a week.
giftobjectrequiredNull when no campaign offers gift links.
Child attributes
availablebooleanrequiredFalse when this referrer may not send gifts.
campaignIdstringrequiredlimitsobjectrequiredChild attributes
maxUsesPerLinkintegerrequiredexpiryDaysintegerrequiredmaxActiveLinksintegerrequiredmaxLinksPerDayintegerrequiredtermsobjectrequiredShow these to both people whenever a gift is offered.
Child attributes
friendGetsobjectrequiredChild attributes
amountintegerrequiredMinor units.
currencystringrequiredfundedBystringrequiredreferrer: the gift is taken out of the referrer’s own reward for this friend.
One of campaign referrer
qualifyingEventsarray of stringsrequiredEvent types the friend must complete; the gift follows the first.
withinDaysintegerrequiredreferrerGetsarray of objectsrequiredWhat the referrer gets for the same friend, after any part given away as the gift.
Child attributes
ruleNamestringrequiredtriggerEventstringrequiredmodelstringrequiredOne of fixed percentage
amountintegerrequiredpercentBpsintegerrequiredcurrencystringrequiredreducedByintegerrequiredThe part of the referrer’s reward that becomes the friend’s gift.
expiresAtstringrequiredmaxUsesintegerrequiredgiftLinksarray of objectsrequiredThe referrer’s latest 50 gift links, newest first.
Child attributes
idstringrequiredcodestringrequiredurlstringrequiredShare this. It keeps working as the referrer’s link after the gift has run out.
campaignIdstringrequiredamountintegerrequiredMinor units.
currencystringrequiredfundingstringrequiredOne of campaign referrer
maxUsesintegerrequiredusesintegerrequiredexpiresAtstringrequiredstatusstringrequiredOne of active used_up expired revoked
notestringrequiredcreatedAtstringrequiredtermsobjectrequiredShow these to both people whenever a gift is offered.
Child attributes
friendGetsobjectrequiredChild attributes
amountintegerrequiredMinor units.
currencystringrequiredfundedBystringrequiredreferrer: the gift is taken out of the referrer’s own reward for this friend.
One of campaign referrer
qualifyingEventsarray of stringsrequiredEvent types the friend must complete; the gift follows the first.
withinDaysintegerrequiredreferrerGetsarray of objectsrequiredWhat the referrer gets for the same friend, after any part given away as the gift.
Child attributes
ruleNamestringrequiredtriggerEventstringrequiredmodelstringrequiredOne of fixed percentage
amountintegerrequiredpercentBpsintegerrequiredcurrencystringrequiredreducedByintegerrequiredThe part of the referrer’s reward that becomes the friend’s gift.
expiresAtstringrequiredmaxUsesintegerrequiredErrors
- 400
validation_error The request does not match the schema.
detailssays which fields failed and why.- 401
missing_signature One of
x-fg-key,x-fg-timestampandx-fg-signatureis missing.- 401
invalid_timestamp x-fg-timestampis not Unix time in seconds.- 401
stale_timestamp x-fg-timestampis more than 300 seconds from the server clock. Sign each attempt again, and keep your clock in sync.- 401
invalid_key The key id is unknown or revoked, or the app is archived.
- 401
invalid_signature The signature does not match. Sign the exact bytes you send.
- 404
not_found Your app has no active friend-referral program.
- 429
too_many_attempts Too many requests with this key in the last minute. Wait
Retry-Afterseconds.
TS=$(date +%s)
SIG=$(printf '%s.' "$TS" | openssl dgst -sha256 -hmac "$FG_SECRET" | sed 's/^.*= //')
curl "https://api.flowgroup.se/v1/referrals/growth?appUserId=u_1042" \
-H "x-fg-key: $FG_KEY_ID" \
-H "x-fg-timestamp: $TS" \
-H "x-fg-signature: $SIG"import { createFlowGrowth } from '@flow/growth-sdk';
const fg = createFlowGrowth({
baseUrl: 'https://api.flowgroup.se',
keyId: process.env.FG_KEY_ID!, // fg_test_… in the sandbox
secret: process.env.FG_SECRET!,
});
const res = await fg.getReferralGrowth('u_1042');
if (res.ok) console.log(res.data.ladders, res.data.giftLinks);{
"programId": "0c9e6f3a-1b2d-4c5e-8f7a-9b0c1d2e3f4a",
"ladders": [],
"boosts": [],
"gift": null,
"giftLinks": []
}List active boosts
/v1/referrals/boostsBoosts on your friend-referral program that run now or start within a week.
AuthSigned request with an app key, fg_live_… or fg_test_…
Query parameters
countrystringISO 3166 alpha-2. Only boosts that apply there are returned.
Matches ^[A-Z]{2}$
Returns · 200
itemsarray of objectsrequiredChild attributes
idstringrequiredcampaignIdstringrequirednamestringrequiredkindstringrequiredmultiplier: multiplierBps / 10000 times the reward (20000 is double). fixed: amount on top.
One of multiplier fixed
multiplierBpsintegerrequiredamountintegerrequiredcurrencystringrequiredappliesTostringrequiredOne of referrer referred_user both
startsAtstringrequiredendsAtstringrequiredmarketsarray of stringsrequiredCountries it applies to; empty for all.
segmentsarray of stringsrequiredmetadata.segment values of the invited user’s registration it applies to; empty for all.
livebooleanrequiredRunning now; otherwise it starts within a week.
Errors
- 400
validation_error The request does not match the schema.
detailssays which fields failed and why.- 401
missing_signature One of
x-fg-key,x-fg-timestampandx-fg-signatureis missing.- 401
invalid_timestamp x-fg-timestampis not Unix time in seconds.- 401
stale_timestamp x-fg-timestampis more than 300 seconds from the server clock. Sign each attempt again, and keep your clock in sync.- 401
invalid_key The key id is unknown or revoked, or the app is archived.
- 401
invalid_signature The signature does not match. Sign the exact bytes you send.
- 429
too_many_attempts Too many requests with this key in the last minute. Wait
Retry-Afterseconds.
TS=$(date +%s)
SIG=$(printf '%s.' "$TS" | openssl dgst -sha256 -hmac "$FG_SECRET" | sed 's/^.*= //')
curl "https://api.flowgroup.se/v1/referrals/boosts" \
-H "x-fg-key: $FG_KEY_ID" \
-H "x-fg-timestamp: $TS" \
-H "x-fg-signature: $SIG"import { createFlowGrowth } from '@flow/growth-sdk';
const fg = createFlowGrowth({
baseUrl: 'https://api.flowgroup.se',
keyId: process.env.FG_KEY_ID!, // fg_test_… in the sandbox
secret: process.env.FG_SECRET!,
});
const res = await fg.getActiveBoosts('SE');{
"items": [
{
"id": "3f1c8a52-6c1e-4b8e-9d0a-2b7f0c4e5a91",
"campaignId": "3f1c8a52-6c1e-4b8e-9d0a-2b7f0c4e5a91",
"name": "name",
"kind": "multiplier",
"multiplierBps": 1,
"amount": 2500,
"currency": "USD",
"appliesTo": "referrer",
"startsAt": "2026-11-09T12:00:00.000Z",
"endsAt": "2026-11-09T12:00:00.000Z",
"markets": [
"markets"
],
"segments": [
"segments"
],
"live": true
}
]
}Create a gift link
/v1/referrals/gift-linksMakes a gift link for one of your users to send to a friend, within the campaign’s limits. The friend gets the gift when they complete a qualifying event.
AuthSigned request with an app key, fg_live_… or fg_test_…
Request body
appUserIdstringrequiredYour pseudonymous id for the user. Never an email address or phone number.
notestringA note for the referrer, e.g. who the gift is for. Never shown to the friend.
Returns · 201
A link a referrer sends to one or a few friends, carrying a welcome gift.
idstringrequiredcodestringrequiredurlstringrequiredShare this. It keeps working as the referrer’s link after the gift has run out.
campaignIdstringrequiredamountintegerrequiredMinor units.
currencystringrequiredfundingstringrequiredOne of campaign referrer
maxUsesintegerrequiredusesintegerrequiredexpiresAtstringrequiredstatusstringrequiredOne of active used_up expired revoked
notestringrequiredcreatedAtstringrequiredtermsobjectrequiredShow these to both people whenever a gift is offered.
Child attributes
friendGetsobjectrequiredChild attributes
amountintegerrequiredMinor units.
currencystringrequiredfundedBystringrequiredreferrer: the gift is taken out of the referrer’s own reward for this friend.
One of campaign referrer
qualifyingEventsarray of stringsrequiredEvent types the friend must complete; the gift follows the first.
withinDaysintegerrequiredreferrerGetsarray of objectsrequiredWhat the referrer gets for the same friend, after any part given away as the gift.
Child attributes
ruleNamestringrequiredtriggerEventstringrequiredmodelstringrequiredOne of fixed percentage
amountintegerrequiredpercentBpsintegerrequiredcurrencystringrequiredreducedByintegerrequiredThe part of the referrer’s reward that becomes the friend’s gift.
expiresAtstringrequiredmaxUsesintegerrequiredErrors
- 400
validation_error The request does not match the schema.
detailssays which fields failed and why.- 401
missing_signature One of
x-fg-key,x-fg-timestampandx-fg-signatureis missing.- 401
invalid_timestamp x-fg-timestampis not Unix time in seconds.- 401
stale_timestamp x-fg-timestampis more than 300 seconds from the server clock. Sign each attempt again, and keep your clock in sync.- 401
invalid_key The key id is unknown or revoked, or the app is archived.
- 401
invalid_signature The signature does not match. Sign the exact bytes you send.
- 403
referrer_blocked This referrer is suspended or blocked and cannot send gifts.
- 404
not_found Your app has no active friend-referral program.
- 409
gifts_unavailable No campaign of the program offers gift links right now.
- 409
gift_link_limit The referrer already has as many open gift links as the campaign allows.
- 409
gift_limit_reached The referrer has given away as much as the campaign allows.
- 429
gift_link_daily_limit The referrer has made as many gift links today as the campaign allows.
- 429
too_many_attempts Too many requests with this key in the last minute. Wait
Retry-Afterseconds.
BODY='{"appUserId":"u_8F2K","note":"For Sara"}'
TS=$(date +%s)
SIG=$(printf '%s.%s' "$TS" "$BODY" | openssl dgst -sha256 -hmac "$FG_SECRET" | sed 's/^.*= //')
curl -X POST "https://api.flowgroup.se/v1/referrals/gift-links" \
-H "content-type: application/json" \
-H "x-fg-key: $FG_KEY_ID" \
-H "x-fg-timestamp: $TS" \
-H "x-fg-signature: $SIG" \
--data-raw "$BODY"import { createFlowGrowth } from '@flow/growth-sdk';
const fg = createFlowGrowth({
baseUrl: 'https://api.flowgroup.se',
keyId: process.env.FG_KEY_ID!, // fg_test_… in the sandbox
secret: process.env.FG_SECRET!,
});
const res = await fg.createGiftLink({ appUserId: 'u_1042', note: 'For Sara' });
if (res.ok) share(res.data.url);{
"id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
"code": "gq4m8z2r",
"url": "https://go.affiliate.yflow.io/a/gq4m8z2r",
"campaignId": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8d",
"amount": 100,
"currency": "USD",
"funding": "referrer",
"maxUses": 1,
"uses": 0,
"expiresAt": "2026-11-23T09:30:00.000Z",
"status": "active",
"note": "For Sara",
"createdAt": "2026-11-09T09:30:00.000Z",
"terms": {
"friendGets": {
"amount": 100,
"currency": "USD"
},
"fundedBy": "referrer",
"qualifyingEvents": [
"purchase.completed"
],
"withinDays": 30,
"referrerGets": [
{
"ruleName": "Friend makes a first purchase",
"triggerEvent": "purchase.completed",
"model": "fixed",
"amount": 100,
"percentBps": null,
"currency": "USD",
"reducedBy": 100
}
],
"expiresAt": "2026-11-23T09:30:00.000Z",
"maxUses": 1
}
}Revoke a gift link
/v1/referrals/gift-links/{id}/revokeStops a gift link from carrying a gift. Friends who already used it keep theirs, and the link keeps working as the referrer’s own link.
AuthSigned request with an app key, fg_live_… or fg_test_…
Path parameters
idstringrequiredThe gift link’s id.
Request body
appUserIdstringrequiredYour pseudonymous id for the user. Never an email address or phone number.
Returns · 200
idstringrequiredstatusstringrequiredOne of active used_up expired revoked
Errors
- 400
validation_error The request does not match the schema.
detailssays which fields failed and why.- 401
missing_signature One of
x-fg-key,x-fg-timestampandx-fg-signatureis missing.- 401
invalid_timestamp x-fg-timestampis not Unix time in seconds.- 401
stale_timestamp x-fg-timestampis more than 300 seconds from the server clock. Sign each attempt again, and keep your clock in sync.- 401
invalid_key The key id is unknown or revoked, or the app is archived.
- 401
invalid_signature The signature does not match. Sign the exact bytes you send.
- 404
not_found The user has no gift link with this id, or your app has no active friend-referral program.
- 429
too_many_attempts Too many requests with this key in the last minute. Wait
Retry-Afterseconds.
BODY='{"appUserId":"u_8F2K"}'
TS=$(date +%s)
SIG=$(printf '%s.%s' "$TS" "$BODY" | openssl dgst -sha256 -hmac "$FG_SECRET" | sed 's/^.*= //')
curl -X POST "https://api.flowgroup.se/v1/referrals/gift-links/3f1c8a52-6c1e-4b8e-9d0a-2b7f0c4e5a91/revoke" \
-H "content-type: application/json" \
-H "x-fg-key: $FG_KEY_ID" \
-H "x-fg-timestamp: $TS" \
-H "x-fg-signature: $SIG" \
--data-raw "$BODY"import { createFlowGrowth } from '@flow/growth-sdk';
const fg = createFlowGrowth({
baseUrl: 'https://api.flowgroup.se',
keyId: process.env.FG_KEY_ID!, // fg_test_… in the sandbox
secret: process.env.FG_SECRET!,
});
const res = await fg.revokeGiftLink({ appUserId: 'u_1042', id: giftLinkId });{
"id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
"status": "revoked"
}