11// Template types
2+
3+ /**
4+ * Default settings applied to links created from a template.
5+ */
26export interface LinkTemplateSettings {
37 defaultIosUrl ?: string ;
48 defaultAndroidUrl ?: string ;
@@ -9,6 +13,9 @@ export interface LinkTemplateSettings {
913 expiresAfterDays ?: number ;
1014}
1115
16+ /**
17+ * A reusable link template that pre-populates settings when creating new links.
18+ */
1219export interface LinkTemplate {
1320 id : string ;
1421 userId ?: string ;
@@ -30,6 +37,9 @@ export interface CreateTemplateRequest {
3037
3138export interface UpdateTemplateRequest extends Partial < CreateTemplateRequest > { }
3239
40+ /**
41+ * A short link with routing, deep-linking, UTM, targeting, and Open Graph metadata.
42+ */
3343export interface Link {
3444 id : string ;
3545 userId ?: string ;
@@ -64,6 +74,9 @@ export interface Link {
6474 click_count ?: number ;
6575}
6676
77+ /**
78+ * Standard UTM tracking parameters appended to redirect URLs for campaign attribution.
79+ */
6780export interface UTMParameters {
6881 source ?: string ;
6982 medium ?: string ;
@@ -72,12 +85,19 @@ export interface UTMParameters {
7285 content ?: string ;
7386}
7487
88+ /**
89+ * Rules that control which redirect URL a visitor receives based on their
90+ * country, device type, or browser language.
91+ */
7592export interface TargetingRules {
7693 countries ?: string [ ] ;
7794 devices ?: ( 'ios' | 'android' | 'web' ) [ ] ;
7895 languages ?: string [ ] ;
7996}
8097
98+ /**
99+ * A recorded click event on a short link, including device, location, and UTM data.
100+ */
81101export interface ClickEvent {
82102 id : string ;
83103 linkId : string ;
@@ -130,6 +150,10 @@ export interface UpdateLinkRequest extends Partial<CreateLinkRequest> {
130150 isActive ?: boolean ;
131151}
132152
153+ /**
154+ * Aggregated analytics for one or more links over a time period, broken down
155+ * by date, geography, device, browser, UTM parameters, and referrer.
156+ */
133157export interface AnalyticsData {
134158 totalClicks : number ;
135159 uniqueClicks : number ;
@@ -157,8 +181,16 @@ export interface AnalyticsData {
157181}
158182
159183// Webhook types
184+
185+ /**
186+ * Discriminated event type sent in webhook payloads.
187+ * Consumers should filter webhooks by subscribing to specific event types.
188+ */
160189export type WebhookEvent = 'click_event' | 'install_event' | 'conversion_event' | 'sdk_event' ;
161190
191+ /**
192+ * A registered webhook endpoint that receives event notifications from LinkForty.
193+ */
162194export interface Webhook {
163195 id : string ;
164196 user_id : string ;
@@ -193,13 +225,19 @@ export interface UpdateWebhookRequest {
193225 timeoutMs ?: number ;
194226}
195227
228+ /**
229+ * The JSON body delivered to a webhook endpoint for every event.
230+ */
196231export interface WebhookPayload {
197232 event : WebhookEvent ;
198233 event_id : string ;
199234 timestamp : string ;
200235 data : ClickEvent | InstallEvent | ConversionEvent ;
201236}
202237
238+ /**
239+ * Outcome of a single webhook delivery attempt, including HTTP status and retry info.
240+ */
203241export interface WebhookDeliveryResult {
204242 success : boolean ;
205243 webhookId : string ;
@@ -212,6 +250,9 @@ export interface WebhookDeliveryResult {
212250 errorMessage ?: string ;
213251}
214252
253+ /**
254+ * An app install event, optionally attributed to a prior click via device fingerprinting.
255+ */
215256export interface InstallEvent {
216257 id : string ;
217258 linkId ?: string ;
@@ -224,6 +265,9 @@ export interface InstallEvent {
224265 platform ?: string ;
225266}
226267
268+ /**
269+ * A post-install in-app conversion event (e.g., purchase, sign-up) tied to an install.
270+ */
227271export interface ConversionEvent {
228272 id : string ;
229273 installId : string ;
0 commit comments