API Reference
Auto-generated
Referrals
API reference for referrals endpoints.
Auto-generated
This page was generated from the OpenAPI spec. Run
make generate-docs to refresh after spec changes.GET /api/v1/referrals/code
GET
/api/v1/referrals/codeGet or create referral code
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/referrals/code \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"code": "example",
"tier": 0,
"total_referrals": 0,
"total_commission_microcents": 0,
"commission_rate_bps": 0,
"is_active": true
}GET /api/v1/referrals/events
GET
/api/v1/referrals/eventsGet referral event history
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | integer | Optional | Page number (1-indexed)Default: 1 |
| page_size | integer | Optional | Results per pageDefault: 20 |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/referrals/events \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"events": [],
"total": 0,
"page": 0,
"page_size": 0,
"has_more": true
}GET /api/v1/referrals/stats
GET
/api/v1/referrals/statsGet referral dashboard stats
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/referrals/stats \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"code": "example",
"tier": 0,
"commission_rate_bps": 0,
"total_signups": 0,
"total_purchases": 0,
"total_commission_microcents": 0
}