Referrals & Affiliates
Programmatic access to the referral program and the affiliate program. Both are also available in the dashboard.
Not an agent workflow
Referral Link and Stats
GET /api/v1/referral/my-link returns your link and GET /api/v1/referral/stats your stats. GET /api/v1/referrals/code returns or creates your code, GET /api/v1/referrals/stats the dashboard stats and GET /api/v1/referrals/events the event history (page, page_size).
curl https://api.alterlab.io/api/v1/referral/my-link -H "X-API-Key: $ALTERLAB_API_KEY"Validate a Code
POST /api/v1/referral/validate-code checks a code before sign-up.
curl -X POST https://api.alterlab.io/api/v1/referral/validate-code -H "X-API-Key: $ALTERLAB_API_KEY" -H "Content-Type: application/json" -d '{"code": "FRIEND10"}'Affiliate Program
POST /api/v1/affiliates/apply takes optional notes. GET /api/v1/affiliates/me returns your profile, /me/stats your stats and /me/conversions your conversions (status, page, page_size).
curl -X POST https://api.alterlab.io/api/v1/affiliates/apply -H "X-API-Key: $ALTERLAB_API_KEY" -H "Content-Type: application/json" -d '{"notes": "Newsletter about data tooling"}'Track a Click
POST /api/v1/affiliates/track/click records a click for a referral_code, with an optional landing_page.
curl -X POST https://api.alterlab.io/api/v1/affiliates/track/click -H "Content-Type: application/json" -d '{"referral_code": "FRIEND10", "landing_page": "/pricing"}'