{
  "openapi": "3.0.1",
  "info": {
    "title": "CSV Import Preflight — Validate, Map & Audit",
    "description": "Validate CSV files against an explicit import contract. Get a prepared CSV, column mapping, raw-value-free issue report, reconciliation audit, and integrity manifest—without AI guesswork or silent data invention.",
    "version": "0.1",
    "x-build-id": "GGNCADggJoreibKFe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/frantz-ai-automation~csv-import-preflight/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-frantz-ai-automation-csv-import-preflight",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/frantz-ai-automation~csv-import-preflight/runs": {
      "post": {
        "operationId": "runs-sync-frantz-ai-automation-csv-import-preflight",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/frantz-ai-automation~csv-import-preflight/run-sync": {
      "post": {
        "operationId": "run-sync-frantz-ai-automation-csv-import-preflight",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "sourceFile",
          "contractMode"
        ],
        "properties": {
          "sourceFile": {
            "title": "Source CSV",
            "minLength": 1,
            "maxLength": 2048,
            "type": "string",
            "description": "Upload exactly one CSV file, up to 10 MiB and 2,000 data rows. Generic external URLs are rejected. The uploaded file remains in Apify storage according to your plan's retention settings."
          },
          "contractMode": {
            "title": "Target contract",
            "enum": [
              "header-template",
              "typed-schema"
            ],
            "type": "string",
            "description": "Use a header-only target CSV for text-only checks, or an explicit JSON schema for typed validation and mapping.",
            "default": "header-template"
          },
          "targetModelFile": {
            "title": "Target CSV template",
            "minLength": 1,
            "maxLength": 2048,
            "type": "string",
            "description": "Required in header-template mode. Upload a CSV containing exactly one header row and no data. Generic external URLs are rejected. No type is inferred."
          },
          "typedSchema": {
            "title": "Typed validation schema",
            "type": "object",
            "description": "Required in typed-schema mode. Explicit versioned rules for columns, mappings, types, formats and limits. Unknown fields are rejected."
          },
          "inputEncoding": {
            "title": "Source encoding",
            "enum": [
              "utf-8-sig",
              "utf-8",
              "cp1252"
            ],
            "type": "string",
            "description": "Used only in header-template mode.",
            "default": "utf-8-sig"
          },
          "inputDelimiter": {
            "title": "Source delimiter",
            "enum": [
              "comma",
              "semicolon",
              "tab",
              "pipe"
            ],
            "type": "string",
            "description": "Used only in header-template mode.",
            "default": "semicolon"
          },
          "outputEncoding": {
            "title": "Prepared CSV encoding",
            "enum": [
              "utf-8-sig",
              "utf-8",
              "cp1252"
            ],
            "type": "string",
            "description": "Used only in header-template mode.",
            "default": "utf-8-sig"
          },
          "outputDelimiter": {
            "title": "Prepared CSV delimiter",
            "enum": [
              "comma",
              "semicolon",
              "tab",
              "pipe"
            ],
            "type": "string",
            "description": "Used only in header-template mode.",
            "default": "semicolon"
          },
          "headerOrder": {
            "title": "Header order policy",
            "enum": [
              "strict",
              "flexible"
            ],
            "type": "string",
            "description": "Strict requires the same order. Flexible accepts a different order and emits the target order.",
            "default": "flexible"
          },
          "formulaPolicy": {
            "title": "Spreadsheet formula policy",
            "enum": [
              "escape",
              "reject"
            ],
            "type": "string",
            "description": "Escape protects formula-like text in the prepared CSV. Reject fails the affected rows instead.",
            "default": "escape"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}