{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "projectId": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_-]{1,128}$",
      "description": "Identifier of the project returned by its create or list operation."
    },
    "supplier": {
      "type": "string",
      "enum": [
        "ahrefs",
        "google_search_console",
        "semrush",
        "majestic",
        "moz",
        "dataforseo",
        "linkody",
        "csv"
      ],
      "description": "Source of imported candidate evidence, retained as provenance."
    },
    "targetKind": {
      "type": "string",
      "enum": [
        "domain",
        "exact_url"
      ],
      "description": "Whether target identifies an exact URL or a domain."
    },
    "target": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096,
      "description": "Exact URL or domain to query, interpreted according to targetKind."
    },
    "includeSubdomains": {
      "type": "boolean",
      "description": "Include subdomains of the selected domain in this query."
    },
    "backlinksStatus": {
      "type": "string",
      "enum": [
        "live",
        "lost",
        "all"
      ],
      "description": "Supplier-reported backlink status filter; this is not Linktrail verification."
    },
    "rows": {
      "minItems": 1,
      "maxItems": 1000,
      "type": "array",
      "items": {
        "anyOf": [
          {},
          {
            "type": "object",
            "properties": {
              "source_url": {
                "type": "string",
                "maxLength": 4096
              },
              "target_url": {
                "type": "string",
                "maxLength": 4096
              },
              "anchor": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 4096
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rel": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1024
                      },
                      {
                        "maxItems": 32,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 128
                        }
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "dofollow": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "link_type": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "first_seen": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last_seen": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "is_lost": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "supplier_row_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 256
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "supplier_metrics": {
                "anyOf": [
                  {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "source_url",
              "target_url"
            ],
            "additionalProperties": false
          }
        ]
      },
      "description": "Each row requires source_url and target_url. target_url is the row destination; the outer target defines the import scope. Optional fields are shown in the row schema. Invalid rows return positional errors without rejecting valid neighbors. Example: {\"source_url\":\"https://publisher.example/article\",\"target_url\":\"https://example.com/\",\"anchor\":\"Example\"}."
    },
    "supplierGeneratedAt": {
      "description": "Supplier export generation timestamp, distinct from import time.",
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "idempotencyKey": {
      "description": "Caller-generated key reused only for retries of the same operation and arguments in this workspace.",
      "type": "string",
      "pattern": "^[\\x21-\\x7e]{1,200}$"
    }
  },
  "required": [
    "projectId",
    "supplier",
    "targetKind",
    "target",
    "includeSubdomains",
    "backlinksStatus",
    "rows"
  ],
  "additionalProperties": false
}
