Skip to content

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.

MethodPathScope
POST/v2/property/attribution/previewsignals:read
GET/v2/property/attribution/presetssignals:read

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.

FieldRules
urlstring, max 4096. Parsed for UTM and click-id parameters
utm_source, utm_medium, utm_campaign, utm_content, utm_termstring, max 255
click_idsobject of { param: value }, each value string, max 512. For example { "gclid": "..." }
referrerstring, max 2048. The referring URL
Terminal window
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/"
}'
FieldNotes
channel_categorydirect, organic_search, paid_search, organic_social, paid_social, email, messaging, video, display, affiliates, referral
channel_category_label, channel_category_colorDisplay helpers
is_directtrue when nothing classified the visit
channel_nameThe named channel, for example Google Ads, WhatsApp
source, medium, campaignThe resolved values that drove the decision
attribution_methodWhich rule won: utm, referrer_domain, click_id or custom_rule
click_idThe click id parameter name that matched, or null
custom_rulePresent 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.

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.

Terminal window
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:

GroupKeys
Messagingwhatsapp, telegram, imessage, signal, messenger, discord, slack (medium messaging)
Organic socialinstagram, facebook, tiktok, twitter, linkedin, reddit, youtube, pinterest (medium social)
Paidgoogle_ads, meta_ads, tiktok_ads, linkedin_ads (medium cpc)
Emailnewsletter, outreach (medium email)
Contentblog, podcast (medium content), video (source youtube, medium video)
Offlineqr_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.