{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/leadmagic-io/json-schema/leadmagic-io-bulk-submission-request-schema.json",
  "title": "BulkSubmissionRequest",
  "description": "Request body for submitting a bulk enrichment job via POST /bulk/submit. Provide exactly one of rows, csv, fileUrl, or scrape.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/leadmagic-io-leadmagic-openapi-3-1-openapi.json#/components/schemas/BulkSubmissionRequest",
  "type": "object",
  "required": [
    "product"
  ],
  "properties": {
    "product": {
      "type": "string",
      "description": "The enrichment product to run on each row (e.g. email_finder, email_validation, mobile_finder, profile_search, company_search)."
    },
    "rows": {
      "type": "array",
      "description": "JSON array of row objects for /bulk/json (or /bulk/submit auto-detect). Each row is an object whose keys match the input fields the selected product expects.",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "csv": {
      "type": "string",
      "description": "Inline CSV string for /bulk/csv (or /bulk/submit)."
    },
    "fileUrl": {
      "type": "string",
      "description": "Public HTTPS URL to a remote file (CSV, JSON, JSONL). SSRF-validated server-side.",
      "format": "uri"
    },
    "format": {
      "type": "string",
      "description": "File format for fileUrl submissions.",
      "enum": [
        "csv",
        "json",
        "jsonl"
      ]
    },
    "scrape": {
      "type": "object",
      "description": "Browser-rendering config for /bulk/scrape (or /bulk/submit).",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "mode": {
          "type": "string",
          "enum": [
            "scrape",
            "crawl",
            "content",
            "markdown",
            "links",
            "json",
            "snapshot"
          ]
        },
        "extractPrompt": {
          "type": "string"
        },
        "render": {
          "type": "boolean"
        },
        "maxPages": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50
        },
        "maxDepth": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        }
      }
    },
    "inputMapping": {
      "type": "object",
      "description": "Optional column mapping from CSV/JSON columns to product input fields.",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "column": {
            "type": "string"
          },
          "value": {}
        }
      }
    },
    "callback": {
      "type": "object",
      "description": "Webhook configuration.",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "HTTPS URL to receive a POST on completion/failure. SSRF-validated."
        },
        "events": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "completed",
              "failed",
              "canceled",
              "any",
              "job.completed",
              "job.failed",
              "job.canceled"
            ]
          },
          "default": [
            "completed"
          ]
        },
        "inlineResults": {
          "type": "boolean"
        },
        "secret": {
          "type": "string"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "idempotencyKey": {
      "type": "string",
      "description": "Optional idempotency key for safe retries."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    },
    "presetId": {
      "type": "string"
    },
    "outputTransform": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string"
        },
        "prompt": {
          "type": "string"
        },
        "jsonSchema": {}
      }
    },
    "priority": {
      "type": "integer",
      "minimum": -1000,
      "maximum": 1000
    },
    "fileName": {
      "type": "string"
    }
  }
}