{
  "openapi": "3.0.1",
  "info": {
    "title": "Lead List Cleaner: Dedupe & Tidy CRM CSVs",
    "description": "Clean a lead list you already have before CRM import: remove duplicates, trim whitespace, lowercase emails, optionally format US/Canada phones, and flag invalid, missing or personal-domain emails. Input an Apify dataset or CSV URL. No scraping, no enrichment.",
    "version": "0.2",
    "x-build-id": "8kHeyH5jiHDGQUoWt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/silent_jubilance~lead-list-cleaner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-silent_jubilance-lead-list-cleaner",
        "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/silent_jubilance~lead-list-cleaner/runs": {
      "post": {
        "operationId": "runs-sync-silent_jubilance-lead-list-cleaner",
        "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/silent_jubilance~lead-list-cleaner/run-sync": {
      "post": {
        "operationId": "run-sync-silent_jubilance-lead-list-cleaner",
        "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",
        "properties": {
          "datasetId": {
            "title": "Source dataset",
            "type": "string",
            "description": "Apify dataset to clean (read-only access is requested). Use this OR CSV URL, not both."
          },
          "csvUrl": {
            "title": "CSV URL",
            "pattern": "^https?://.+",
            "type": "string",
            "description": "Direct http(s) link to a CSV file, e.g. a Google Sheets 'Publish to web → CSV' link. Comma, semicolon, tab and pipe delimiters; UTF-8, cp1252 or latin-1. Max 50 MB / 100,000 rows. Use this OR Source dataset, not both."
          },
          "dedupeKeys": {
            "title": "Dedupe keys",
            "type": "array",
            "description": "Columns that define a duplicate. Use an exact column name (case-insensitive) or a field type: email, phone, company, full_name, website, title, linkedin. Several keys = all must match. Comparison ignores case and surrounding spaces; rows where every key is blank are never treated as duplicates. Empty list = no de-duplication. The first occurrence is kept.",
            "default": [
              "email"
            ],
            "items": {
              "type": "string"
            }
          },
          "removeDuplicates": {
            "title": "Remove duplicates",
            "type": "boolean",
            "description": "On: later duplicates are dropped from the output. Off: they are kept and flagged duplicate_of_row_N.",
            "default": true
          },
          "trimWhitespace": {
            "title": "Trim whitespace",
            "type": "boolean",
            "description": "Strip leading/trailing spaces and collapse repeated spaces in every cell.",
            "default": true
          },
          "lowercaseEmails": {
            "title": "Lowercase emails",
            "type": "boolean",
            "description": "Lowercase every column detected as an email column.",
            "default": true
          },
          "normalizePhones": {
            "title": "Format US/Canada phones",
            "type": "boolean",
            "description": "Rewrite 10-digit numbers (or 11 digits starting with 1) in phone columns as +1XXXXXXXXXX. Other numbers are left unchanged. Off by default.",
            "default": false
          },
          "titleCaseNames": {
            "title": "Fix ALL-CAPS / lowercase names",
            "type": "boolean",
            "description": "In name columns, title-case words that are entirely upper- or lower-case (\"jane DOE\" → \"Jane Doe\"). Mixed-case words such as McDonald are left alone. Off by default.",
            "default": false
          },
          "flagIssues": {
            "title": "Flag issues per row",
            "type": "boolean",
            "description": "Add per-row flags: missing_email, invalid_email (format check only, not a deliverability check), personal_domain, bad_phone, missing_company, ragged_row, duplicate_of_row_N.",
            "default": true
          },
          "issuesColumnInCsv": {
            "title": "Add issues column to CLEANED_CSV",
            "type": "boolean",
            "description": "Append a preflight_issues column to CLEANED_CSV with the plain-English reason for each flag, e.g. \"Email 'sam@@x.example' is not a valid email format (not auto-fixed)\". Off by default, so the CSV keeps exactly your columns. The dataset always has the preflightIssues field.",
            "default": false
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}