{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/appy-to/json-schema/appy-to-sdk-open-request-schema.json",
  "title": "SdkOpenRequest",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/appy-to-openapi.yaml#/components/schemas/SdkOpenRequest",
  "type": "object",
  "required": [
    "installId",
    "firstLaunch",
    "device"
  ],
  "properties": {
    "installId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9-]{8,64}$",
      "description": "Random identifier created by the SDK on first launch and kept until the app is uninstalled."
    },
    "firstLaunch": {
      "type": "boolean",
      "description": "True until the first open of this install has been acknowledged."
    },
    "url": {
      "type": "string",
      "maxLength": 2048,
      "description": "The URL that opened the app, if any."
    },
    "installReferrer": {
      "type": "string",
      "maxLength": 2048,
      "description": "Android only. The raw install referrer of the store that installed the app",
      "sent on first launch.": null
    },
    "installReferrerSource": {
      "type": "string",
      "pattern": "^[a-z0-9_]{1,32}$",
      "description": "Android only. Which store provided `installReferrer`, for example `google_play` or `huawei_appgallery`."
    },
    "appleAdsToken": {
      "type": "string",
      "maxLength": 4096,
      "description": "iOS only. The AdServices attribution token (`AAAttribution.attributionToken()`), sent on first launch."
    },
    "metaInstallReferrer": {
      "type": "object",
      "description": "Android only. The row the Facebook, Instagram or Facebook Lite app returned for the Meta Install Referrer, sent on first launch.",
      "properties": {
        "installReferrer": {
          "type": "string",
          "maxLength": 8192,
          "description": "The `install_referrer` column as returned."
        },
        "isClickThrough": {
          "type": "boolean",
          "description": "The `is_ct` column."
        },
        "actualTimestamp": {
          "type": "integer",
          "description": "The `actual_timestamp` column",
          "Unix seconds.": null
        },
        "sourceApp": {
          "type": "string",
          "enum": [
            "facebook",
            "instagram",
            "facebook_lite"
          ]
        }
      }
    },
    "userId": {
      "type": "string",
      "maxLength": 128,
      "description": "Your own user identifier, if the app has set one."
    },
    "trackingEnabled": {
      "type": "boolean",
      "default": true
    },
    "device": {
      "$ref": "#/$defs/SdkDevice"
    },
    "app": {
      "$ref": "#/$defs/SdkApp"
    },
    "sdkVersion": {
      "type": "string"
    }
  },
  "$defs": {
    "SdkApp": {
      "type": "object",
      "properties": {
        "bundleId": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "build": {
          "type": "string"
        },
        "installer": {
          "type": "string",
          "maxLength": 128,
          "description": "Android only. Package name of the store that installed the app, for example `com.android.vending` or `com.huawei.appmarket`."
        }
      }
    },
    "SdkDevice": {
      "type": "object",
      "required": [
        "platform"
      ],
      "properties": {
        "platform": {
          "type": "string",
          "enum": [
            "ios",
            "android"
          ]
        },
        "osVersion": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "locale": {
          "type": "string"
        }
      }
    }
  }
}