{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/appy-to/json-schema/appy-to-link-import-report-schema.json",
  "title": "LinkImportReport",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/appy-to-openapi.yaml#/components/schemas/LinkImportReport",
  "type": "object",
  "required": [
    "dryRun",
    "source",
    "plan",
    "limit",
    "used",
    "summary",
    "columns",
    "domains",
    "rows"
  ],
  "properties": {
    "dryRun": {
      "type": "boolean"
    },
    "source": {
      "type": "string",
      "enum": [
        "branch",
        "onelink"
      ]
    },
    "plan": {
      "type": "string",
      "enum": [
        "free",
        "pro",
        "business",
        "enterprise"
      ]
    },
    "limit": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The plan's link limit. null means no limit."
    },
    "used": {
      "type": "integer",
      "description": "Active links in the account before the import."
    },
    "customDomainsAvailable": {
      "type": "boolean"
    },
    "deeplinksAvailable": {
      "type": "boolean"
    },
    "summary": {
      "type": "object",
      "properties": {
        "rows": {
          "type": "integer"
        },
        "ready": {
          "type": "integer"
        },
        "imported": {
          "type": "integer"
        },
        "existing": {
          "type": "integer"
        },
        "errors": {
          "type": "integer"
        },
        "overLimit": {
          "type": "integer"
        },
        "aliasesKept": {
          "type": "integer"
        },
        "aliasesChanged": {
          "type": "integer"
        },
        "withWarnings": {
          "type": "integer"
        }
      }
    },
    "columns": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "header": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "key",
              "url",
              "alias",
              "long_url",
              "title",
              "data",
              "domain"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "used",
              "mapped",
              "unsupported",
              "ignored",
              "empty"
            ]
          },
          "mapsTo": {
            "type": "string"
          }
        }
      }
    },
    "domains": {
      "type": "array",
      "description": "Old link domains in the file. `vendor` domains (app.link, onelink.me) cannot point to Appy; `branded` domains can.",
      "items": {
        "type": "object",
        "properties": {
          "host": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "branded",
              "vendor"
            ]
          },
          "rows": {
            "type": "integer"
          },
          "appyStatus": {
            "type": "string",
            "enum": [
              "not_added",
              "pending",
              "verifying",
              "active",
              "error"
            ]
          }
        }
      }
    },
    "rows": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/LinkImportRow"
      }
    }
  },
  "$defs": {
    "LinkImportIssue": {
      "type": "object",
      "required": [
        "code",
        "severity",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "Errors: `missing_fallback`, `invalid_fallback_url`, `invalid_target_url`, `blocked_domain`,\n`duplicate_row`, `slug_conflict`. Warnings: `alias_too_short`, `alias_too_long`,\n`alias_characters`, `alias_reserved`, `alias_needs_pro`, `alias_taken`, `alias_duplicate`,\n`alias_path_segments`, `vendor_domain`, `deeplink_needs_pro`, `deeplink_needs_scheme`,\n`deeplink_conflict`, `invalid_deeplink`, `utm_not_applied`, `over_limit`,\n`social_preview_needs_pro`, `social_preview_needs_title`, `invalid_social_preview_image`,\n`invalid_social_preview`. Info:\n`alias_missing`, `exists`, `fallback_from_default`, `target_from_default`.\n"
        },
        "severity": {
          "type": "string",
          "enum": [
            "error",
            "warning",
            "info"
          ]
        },
        "field": {
          "type": "string"
        },
        "key": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "LinkImportRow": {
      "type": "object",
      "required": [
        "line",
        "status",
        "aliasKept",
        "targets",
        "utm",
        "unsupported",
        "ignored",
        "issues"
      ],
      "properties": {
        "line": {
          "type": "integer",
          "description": "Line number in the file."
        },
        "status": {
          "type": "string",
          "enum": [
            "ready",
            "imported",
            "exists",
            "error",
            "over_limit"
          ],
          "description": "`ready` appears only in a dry run."
        },
        "originalUrl": {
          "type": "string"
        },
        "host": {
          "type": "string"
        },
        "alias": {
          "type": "string",
          "description": "The original alias or short link ID."
        },
        "slug": {
          "type": "string",
          "description": "The Appy slug the link gets."
        },
        "aliasKept": {
          "type": "boolean",
          "description": "true when the old path equals the new slug, so the old URL works once its domain points to Appy."
        },
        "linkId": {
          "type": "string",
          "format": "uuid",
          "description": "Set when the link was created."
        },
        "title": {
          "type": "string"
        },
        "fallbackUrl": {
          "type": "string"
        },
        "deeplinkUrl": {
          "type": "string"
        },
        "socialPreview": {
          "type": "object",
          "description": "The social preview the link gets, from `$og_*` or `af_og_*` keys. Pro plan and above.",
          "properties": {
            "title": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "imageUrl": {
              "type": "string"
            }
          }
        },
        "targets": {
          "$ref": "#/$defs/Targets"
        },
        "utm": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "UTM parameters taken from the provider's campaign keys. They are added to the website destination."
        },
        "unsupported": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keys of this row that Appy does not carry over."
        },
        "ignored": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keys the old provider generated, such as `~id` or `+url`."
        },
        "issues": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LinkImportIssue"
          }
        }
      }
    },
    "Targets": {
      "type": "object",
      "description": "Store or web destination per device family. Any subset of the seven platforms. `samsung` and\n`xiaomi` are used when Appy can tell the phone's brand, mostly visits from Samsung Internet, the\nXiaomi browser and in-app browsers that report the model; other phones of those brands are\ntreated like any Android phone. `rustore` is used for Android visitors whose connection is in\nRussia. A matching `huawei`, `samsung` or `xiaomi` target wins over `countryRules`, and\n`countryRules` win over `rustore`.\n",
      "additionalProperties": false,
      "properties": {
        "iphone": {
          "type": "string",
          "format": "uri",
          "description": "Usually an App Store URL."
        },
        "ipad": {
          "type": "string",
          "format": "uri",
          "description": "Usually an App Store URL. iPads without a target fall back to `fallbackUrl`."
        },
        "android": {
          "type": "string",
          "format": "uri",
          "description": "Usually a Google Play URL. Appy adds `appy_slug` (and, for SDK apps, `appy_click_id`) to the Play install referrer."
        },
        "huawei": {
          "type": "string",
          "format": "uri",
          "description": "Usually an AppGallery URL."
        },
        "samsung": {
          "type": "string",
          "format": "uri",
          "description": "Usually a Galaxy Store URL."
        },
        "xiaomi": {
          "type": "string",
          "format": "uri",
          "description": "Usually a GetApps URL."
        },
        "rustore": {
          "type": "string",
          "format": "uri",
          "description": "Usually a RuStore URL. Used for Android visitors in Russia; Android visitors elsewhere follow `android`."
        }
      }
    }
  }
}