{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/warplink-app/json-schema/warplink-app-attribution-attempt-schema.json",
  "title": "AttributionAttempt",
  "description": "One attribution attempt, matched or not.",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/warplink-app-openapi.json#/components/schemas/AttributionAttempt",
  "type": "object",
  "required": [
    "id",
    "platform",
    "strategy",
    "matched",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Stable attempt id, a decimal string because the stored id is a 64-bit integer."
    },
    "app_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The app the attempt came from. Null when it could not be determined, including every attempt before app ids were stored."
    },
    "platform": {
      "type": "string",
      "enum": [
        "ios",
        "android"
      ]
    },
    "sdk_version": {
      "type": [
        "string",
        "null"
      ],
      "description": "Self-reported by the SDK."
    },
    "strategy": {
      "type": "string",
      "description": "The cascade branch that ran: token (a recovery token), referrer (a link ID alone), device_id, fingerprint (the probabilistic match), raw or none."
    },
    "matched": {
      "type": "boolean"
    },
    "match_source": {
      "type": [
        "string",
        "null"
      ],
      "description": "claim when the attempt created an install, replay when it answered from an existing one. Null on unmatched attempts and on attempts before this was stored."
    },
    "match_method": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "referrer",
        "probabilistic",
        null
      ],
      "description": "An attempt names a method only when it created an install (match_source claim) through the referrer, fingerprint or raw strategy: referrer for the referrer strategy, probabilistic for fingerprint and raw. A token attempt is always null, as are replays, device_id answers and unmatched attempts, because an attempt stores neither the method nor the install it created. To see the method, read the install record."
    },
    "referral_id": {
      "type": "null",
      "description": "Always null. An attempt stores no link to an install or a referral; the referral an install was credited as is on the install record."
    },
    "evidence_class": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "exact",
        "estimated",
        "legacy_link",
        null
      ],
      "description": "How firm a matched answer was. Null on unmatched attempts and on attempts before the referral handoff."
    },
    "replay_state": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "original",
        "replayed",
        null
      ],
      "description": "Whether a repeated token or tap was answered from the first answer. Null on unmatched attempts and on attempts before the referral handoff."
    },
    "fail_reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Why the attempt did not match, or ambiguous_app on a matched attempt that looked up a device-wide signal across several apps. Null otherwise."
    },
    "fingerprint_version": {
      "type": [
        "string",
        "null"
      ],
      "description": "The match variant the SDK declared. Null when no match key was sent."
    },
    "tried_version": {
      "type": [
        "string",
        "null"
      ],
      "description": "The match variant the server tried last. Null when no probabilistic branch ran."
    },
    "candidate_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Clicks stored under the key the server tried, before any filter. Null when no probabilistic branch ran."
    },
    "ip_class": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "cgnat",
        "ipv4",
        "ipv6",
        null
      ],
      "description": "The class of the requesting address. The address itself is never stored."
    },
    "is_reinstall": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "The SDK's own claim. Null when the SDK did not send it."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}