Attribution API
Every session is classified into a channel once, on arrival, by the attribution engine described in Channels & Attribution. These two endpoints expose that engine so you can check a link before it goes live.
| Method | Path | Scope |
|---|---|---|
| POST | /v2/property/attribution/preview | signals:read |
| GET | /v2/property/attribution/presets | signals:read |
Preview
Section titled “Preview”POST /v2/property/attribution/preview
Runs the same classification a real session gets, using either a full URL, explicit parameters, or both. Explicit body fields win over values parsed from the URL.
| Field | Rules |
|---|---|
url | string, max 4096. Parsed for UTM and click-id parameters |
utm_source, utm_medium, utm_campaign, utm_content, utm_term | string, max 255 |
click_ids | object of { param: value }, each value string, max 512. For example { "gclid": "..." } |
referrer | string, max 2048. The referring URL |
curl -X POST https://api.snipform.io/v2/property/attribution/preview \ -H "Authorization: Bearer $SNIPFORM_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://acme.com/spring?utm_source=whatsapp&utm_medium=messaging&utm_campaign=launch", "referrer": "https://l.facebook.com/" }'{ "code": 200, "status": "OK", "data": { "preview": { "channel_category": "messaging", "channel_category_label": "Messaging", "channel_category_color": "info", "is_direct": false, "channel_name": "WhatsApp", "source": "whatsapp", "medium": "messaging", "campaign": "launch", "attribution_method": "utm", "click_id": null }, "inputs": { "params": { "utm_source": "whatsapp", "utm_medium": "messaging", "utm_campaign": "launch" }, "referrer": "https://l.facebook.com/" } }}The preview shape
Section titled “The preview shape”| Field | Notes |
|---|---|
channel_category | direct, organic_search, paid_search, organic_social, paid_social, email, messaging, video, display, affiliates, referral |
channel_category_label, channel_category_color | Display helpers |
is_direct | true when nothing classified the visit |
channel_name | The named channel, for example Google Ads, WhatsApp |
source, medium, campaign | The resolved values that drove the decision |
attribution_method | Which rule won: utm, referrer_domain, click_id or custom_rule |
click_id | The click id parameter name that matched, or null |
custom_rule | Present only when one of the property’s custom channel rules matched; its name |
inputs echoes what the engine actually saw, after URL parsing and body overrides, so a surprising result is easy to trace.
Presets
Section titled “Presets”GET /v2/property/attribution/presets
A static catalog of channel chips. Each entry pairs a utm_source with a utm_medium that the engine classifies the way the label suggests. Use it to offer the same one-click choices the dashboard does when creating a short link.
curl https://api.snipform.io/v2/property/attribution/presets \ -H "Authorization: Bearer $SNIPFORM_TOKEN"{ "code": 200, "status": "OK", "data": { "presets": [ { "group": "Messaging", "key": "whatsapp", "label": "WhatsApp", "utm_source": "whatsapp", "utm_medium": "messaging" }, { "group": "Organic social", "key": "instagram", "label": "Instagram", "utm_source": "instagram", "utm_medium": "social" }, { "group": "Paid", "key": "google_ads", "label": "Google Ads", "utm_source": "google", "utm_medium": "cpc" }, { "group": "Email", "key": "newsletter", "label": "Newsletter", "utm_source": "newsletter", "utm_medium": "email" }, { "group": "Content", "key": "blog", "label": "Blog", "utm_source": "blog", "utm_medium": "content" }, { "group": "Offline", "key": "qr_code", "label": "QR Code", "utm_source": "qr", "utm_medium": "offline" } ] }}The full catalog today:
| Group | Keys |
|---|---|
| Messaging | whatsapp, telegram, imessage, signal, messenger, discord, slack (medium messaging) |
| Organic social | instagram, facebook, tiktok, twitter, linkedin, reddit, youtube, pinterest (medium social) |
| Paid | google_ads, meta_ads, tiktok_ads, linkedin_ads (medium cpc) |
newsletter, outreach (medium email) | |
| Content | blog, podcast (medium content), video (source youtube, medium video) |
| Offline | qr_code, print (medium offline) |
The catalog is a UX convenience and is not the rule set itself. Run a preview if you need to be certain how a pair will be classified.