Skip to content

Ambassadors​

The ambassador programme: the public directory, invitations and applications, referral links and click tracking, and the ambassador portal under /me/referrals/*.


Redeem an ambassador invitation​

POST
/ambassador-invites/redeem

Accepts an ambassador invitation for the signed-in account — the path for Google and Apple sign-ups, which cannot carry the token through POST /cognito/signup. The invitation is matched against the account's own registered email address; someone else's token is declined with email_mismatch.

A declined redemption is still a 200 with granted: false and a reason, so a client can always call this after sign-up even when the token was already spent. No special permission is needed.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Request Body​

application/json
JSON
{
"token": "string"
}

Responses​

Granted, or declined with a reason

application/json
JSON
{
"granted": true,
"reason": "string"
}

Playground​

Server
Authorization
Body

Samples​


Apply to be an ambassador​

POST
/ambassador-applications

Files an application to the ambassador programme for review by FundlyHub. Works signed out; when a session is present, the application records which account filed it.

One pending application per address: a second is 409, as is an address that already holds the ambassador role.

Authentication is optional. Rate limited at 5 requests/minute per IP.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)
or

Request Body​

application/json
JSON
{
"fullName": "string",
"email": "string",
"location": "string",
"socialMedia": "string",
"experience": "string",
"motivation": "string"
}

Responses​

Application received

application/json
JSON
{
"received": true
}

Playground​

Server
Authorization
Body

Samples​


List ambassadors (public directory)​

GET
/ambassadors

Ambassador role-holders with a public profile, ordered by the money their referral links have driven (the amounts themselves are not returned). Feeds the front-page rail.

No authentication. Rate limited at 300 requests/minute per IP.

Parameters​

Query Parameters

limit
Type
integer
Minimum
1
Maximum
60
Default
24

Responses​

The directory

application/json
JSON
{
"ambassadors": [
{
"userId": "string",
"name": "string",
"avatar": "string",
"href": "string",
"location": "string"
}
]
}

Playground​

Server
Variables
Key
Value

Samples​


List ambassadors for the endorsement picker​

GET
/ambassadors/selectable

Ambassadors a campaign creator may ask to endorse their campaign: role-holders with a public profile, excluding the caller, with the lifetime money each has driven in cents. Authenticated because it carries those amounts.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Parameters​

Query Parameters

limit
Type
integer
Minimum
1
Maximum
60
Default
24

Responses​

The picker list

application/json
JSON
{
"ambassadors": [
{
"userId": "string",
"name": "string",
"avatar": "string",
"referredCents": 0
}
]
}

Playground​

Server
Authorization
Variables
Key
Value

Samples​


Get an ambassador's referral analytics​

GET
/ambassadors/{id}/analytics

All-time referral analytics for one ambassador: clicks by traffic type, conversions, attributed funds per currency, and breakdowns by campaign, UTM source and day.

Callers may read their own analytics; anyone else's answers 403.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Parameters​

Path Parameters

id*

The ambassador's profile UUID.

Type
string
Required
Format
"uuid"

Responses​

The analytics (bare object)

application/json
JSON
"string"

Playground​

Server
Authorization
Variables
Key
Value

Samples​


Get or create my referral code​

POST
/referrals/codes

Returns the caller's referral code — the profile-level one, or the one for fundraiser_id — creating it on first use. Idempotent. Share links take the form /r/{code} on the site. Every signed-in user can hold a code; the ambassador role is not required.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Request Body​

application/json
JSON
{
"fundraiser_id": "string"
}

Responses​

The code

application/json
JSON
{
"code": "aB3dE5fG7h"
}

Playground​

Server
Authorization
Body

Samples​


Record a referral-link click​

POST
/referrals/clicks

Called by the FundlyHub web app when a visitor opens a referral link (/r/{code}); not for third-party clients. Returns where to redirect and the visitor id to set as a cookie. Records a click classified as human, bot or unknown, and stamps the code into utm_content. When the visitor is signed in, the code is also remembered on their profile for attribution.

An unknown code still answers 200 with resolved: false and a target_path of the home page.

Authentication is optional. Rate limited per caller: 120 requests/minute, on top of the global per-IP limiter. Past the limit the answer is 429 with Retry-After.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)
or

Request Body​

application/json
JSON
{
"code": "string",
"user_agent": "string",
"request_method": "GET",
"referer": "string",
"visitor_id": "string",
"ip": "string",
"utm_source": "string",
"utm_medium": "string",
"utm_campaign": "string",
"utm_content": "string",
"entry_point": "redirect"
}

Responses​

Click processed

application/json
JSON
"string"

Playground​

Server
Authorization
Body

Samples​


Get my referral summary​

GET
/me/referrals/summary

The ambassador portal's headline: totals, the click-to-gift funnel and a daily series for the caller's own referral links over a window (default: the 28 days ending to). Every portal route reads only the session's own rows.

Requires permission: view_own_referral_portal.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Parameters​

Query Parameters

from

Window start. Defaults to 28 days before to. Must be before to and not earlier than 2020-01-01.

Type
string
Format
"date-time"
to

Window end. Defaults to now.

Type
string
Format
"date-time"

Responses​

The summary

application/json
JSON
{
"data": "string",
"range": "string"
}

Playground​

Server
Authorization
Variables
Key
Value

Samples​


List campaigns I referred to​

GET
/me/referrals/campaigns

Per-campaign clicks, visitors, driven gifts and money raised from the caller's referral links in the window.

Requires permission: view_own_referral_portal.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Parameters​

Query Parameters

from

Window start. Defaults to 28 days before to. Must be before to and not earlier than 2020-01-01.

Type
string
Format
"date-time"
to

Window end. Defaults to now.

Type
string
Format
"date-time"

Responses​

The campaigns

application/json
JSON
{
"data": [
{
"fundraiser_id": "string",
"fundraiser_title": "string",
"fundraiser_slug": "string",
"clicks_human": 0,
"clicks_bot": 0,
"clicks_unknown": 0,
"distinct_human_visitors": 0,
"driven_gifts": 0,
"raised_cents": 0,
"last_click_at": "string"
}
],
"range": "string"
}

Playground​

Server
Authorization
Variables
Key
Value

Samples​


Get what my referral link did for one campaign​

GET
/me/referrals/campaigns/{fundraiserId}

All-time figures for the caller's own referral link on one campaign: impressions (visits not identified as a bot), clicks by traffic type, distinct human visitors, driven gifts (paid, not self-referred), distinct donors, and the value of those gifts (donation + tip) per currency in cents. The same definitions as the per-campaign rows of the ambassador analytics. Also returns the caller's referral code and link for the campaign when one exists; this read never creates one. Feeds the ambassador bar on the campaign page.

A campaign the caller may not open (draft, pending, private or deleted, and not their own) is a 404, as its page is.

Requires permission: view_own_referral_portal.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Parameters​

Path Parameters

fundraiserId*

The campaign's id.

Type
string
Required
Format
"uuid"

Responses​

The caller's figures for the campaign

application/json
JSON
{
"data": {
"fundraiser_id": "string",
"impressions": 0,
"clicks_by_traffic_type": {
"human": 0,
"bot": 0,
"unknown": 0
},
"distinct_human_visitors": 0,
"driven_gifts": 0,
"distinct_donors": 0,
"funds_attributed": [
{
"currency": "string",
"amount_cents": 0
}
],
"referral_code": "string",
"referral_url": "https://fundlyhub.org/r/AbC123xYz0",
"last_click_at": "string",
"last_gift_at": "string",
"as_of": "string"
}
}

Playground​

Server
Authorization
Variables
Key
Value

Samples​


Get my referral traffic breakdown​

GET
/me/referrals/traffic

Where the caller's referral clicks came from — by UTM source, referer and medium — plus traffic type, and country and device splits from Google Analytics when it is configured (ga_note says why those are null otherwise).

Requires permission: view_own_referral_portal.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Parameters​

Query Parameters

from

Window start. Defaults to 28 days before to. Must be before to and not earlier than 2020-01-01.

Type
string
Format
"date-time"
to

Window end. Defaults to now.

Type
string
Format
"date-time"

Responses​

The breakdown

application/json
JSON
{
"data": "string",
"range": "string"
}

Playground​

Server
Authorization
Variables
Key
Value

Samples​


List gifts I drove​

GET
/me/referrals/gifts

The donations attributed to the caller's referral links in the window, refunded, failed and self-referred gifts included. Each row carries exactly the fields of AmbassadorGift: no donor email, card details or receipt reference, and no donor name on an anonymous gift.

Requires permission: view_own_referral_portal.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Parameters​

Query Parameters

from

Window start. Defaults to 28 days before to. Must be before to and not earlier than 2020-01-01.

Type
string
Format
"date-time"
to

Window end. Defaults to now.

Type
string
Format
"date-time"
limit
Type
integer
Minimum
1
Maximum
200
Default
50
offset
Type
integer
Minimum
0
Default
0

Responses​

One page of gifts

application/json
JSON
{
"data": [
],
"total": 0,
"drivenTotal": 0,
"range": "string"
}

Playground​

Server
Authorization
Variables
Key
Value

Samples​


Get my ambassador standing​

GET
/me/referrals/standing

The caller's rank among ambassadors by money raised in the window, and the leaderboard (up to 200 rows; truncated when there are more). Other ambassadors with private profiles appear without name or avatar.

Requires permission: view_own_referral_portal.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Parameters​

Query Parameters

from

Window start. Defaults to 28 days before to. Must be before to and not earlier than 2020-01-01.

Type
string
Format
"date-time"
to

Window end. Defaults to now.

Type
string
Format
"date-time"

Responses​

The standing

application/json
JSON
{
"data": {
"rank": 0,
"total_ambassadors": 0,
"leaderboard": [
{
"rank": 0,
"ambassador_user_id": "string",
"display_name": "string",
"avatar_url": "string",
"raised_cents": 0,
"driven_gifts": 0,
"is_me": true
}
],
"truncated": true
},
"range": "string"
}

Playground​

Server
Authorization
Variables
Key
Value

Samples​


List my own campaigns (ambassador portal)​

GET
/me/campaigns

The campaigns the caller owns, with totals and how many clicks on their own referral links led to them (self-referrals, which do not count as driven). Takes no date range.

Requires permission: view_own_referral_portal.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Responses​

The caller's campaigns

application/json
JSON
{
"data": [
{
"id": "string",
"title": "string",
"slug": "string",
"status": "string",
"goal_amount_cents": 0,
"total_raised_cents": 0,
"donation_count": 0,
"created_at": "string",
"self_referred_clicks": 0
}
]
}

Playground​

Server
Authorization

Samples​


Powered by VitePress OpenAPI

Built with VitePress