Documentation Index
Fetch the complete documentation index at: https://agentref.co/docs/llms.txt
Use this file to discover all available pages before exploring further.
Your Referral Link
Every affiliate gets a unique referral code. Your tracking link follows this format:?via=YOUR_CODE. Some programs may still expose ref, r, a, or merchant-configured aliases for inbound attribution.
When someone clicks your link, AgentRef:
- Records the click with your affiliate ID
- Sets a first-party cookie on the visitor’s browser
- Tracks the visitor across the cookie window (typically 30-90 days)
- Attributes any conversion back to you
Referral Code
Your referral code is set when you join a program. It’s usually your name or brand:Creating links via API
Affiliate API keys can create named tracking links for a joined program. Usedestination_path for a merchant-approved path on the merchant website and custom_slug when you want a specific referral code for that link.
destination_path must be a relative path such as /pricing or /blog/review. It must be in the program’s allowed destination list. custom_slug must be 3-32 lowercase letters, numbers, or hyphens.
Updating links via API
The current update contract is narrower than the create contract.PATCH /api/v1/me/links/{id} accepts name, targetUrl, and isActive; it does not accept destination_path or custom_slug. Use targetUrl when you need to point an existing link at a full URL, and create a new link when you need a different approved destination path or custom slug.
Cookie Duration
Each program sets a cookie window – the number of days a click stays valid. If a visitor clicks your link today and purchases within the window, you get credit.| Typical Windows | Duration |
|---|---|
| Short | 30 days |
| Standard | 60 days |
| Long | 90 days |
UTM & Sub-ID Tracking
You can append tracking parameters to your links for your own analytics:Supported Parameters
| Parameter | Description |
|---|---|
utm_source | Traffic source (youtube, twitter, newsletter) |
utm_medium | Medium (video, post, email) |
utm_campaign | Campaign name |
utm_content | Content variant |
utm_term | Search term |
sub1 - sub5 | Custom sub-IDs for your own tracking |