{
  "openapi": "3.0.1",
  "info": {
    "title": "Contact List Cleaner – Clean CSV Phones, Emails, Names, Dates",
    "description": "Clean contact lists in bulk: phones to E.164, email syntax, first and last name split, ISO dates and country codes, broken text (mojibake) repair, duplicate flags. CSV, Excel or Apify dataset in. Every change is logged. Offline rules, no AI. $0.20 per 1,000 rows.",
    "version": "0.1",
    "x-build-id": "vdesARsmkmWjIGgHi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~contact-list-cleaner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-contact-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/gazidev~contact-list-cleaner/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-contact-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/gazidev~contact-list-cleaner/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-contact-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": {
          "rows": {
            "title": "Contacts (JSON rows)",
            "type": "array",
            "description": "Paste rows as a JSON array of objects. The example has five messy, made-up contacts. Use a dataset or file below for real lists."
          },
          "datasetId": {
            "title": "Apify dataset",
            "type": "string",
            "description": "Clean the output of another Actor, for example a lead or Google Maps scraper. The dataset is only read. In an integration use {{resource.defaultDatasetId}}."
          },
          "fileUrls": {
            "title": "File URLs (CSV, Excel, JSON)",
            "type": "array",
            "description": "Public links to CSV, TSV, XLSX, XLS, ODS, JSON or JSON Lines files. Shared Google Sheets, Drive, Dropbox and OneDrive links work. Private network addresses are refused.",
            "items": {
              "type": "string"
            }
          },
          "firstRowIsHeader": {
            "title": "Files have a header row",
            "type": "boolean",
            "description": "Turn off for CSV / Excel files without column names. Columns are then called column_A, column_B and so on.",
            "default": true
          },
          "autoDetect": {
            "title": "Find contact columns automatically",
            "type": "boolean",
            "description": "Recognises phone, e-mail, name, date and country columns by their header (English, German, French, Spanish, Italian, Portuguese, Dutch, Turkish) and by content.",
            "default": true
          },
          "rules": {
            "title": "Rules for single columns",
            "type": "array",
            "description": "Overrides the automatic choice. Types: phone, email, name, firstName, lastName, date, country, text (repair only), skip (leave untouched). Optional: country (phone), dateOrder. Example: [{\"field\": \"Tel 2\", \"type\": \"phone\", \"country\": \"DE\"}]"
          },
          "defaultCountry": {
            "title": "Default country for phones",
            "type": "string",
            "description": "Two-letter code such as US, GB or DE. Used when a phone number has no country code and the row has no country column. Also decides how 03/04/2024 is read when the column gives no hint."
          },
          "phoneFormat": {
            "title": "Phone format",
            "enum": [
              "e164",
              "international",
              "national"
            ],
            "type": "string",
            "description": "E.164 is what CRMs, dialers and SMS tools expect.",
            "default": "e164"
          },
          "countryFormat": {
            "title": "Country format",
            "enum": [
              "iso2",
              "iso3",
              "name"
            ],
            "type": "string",
            "description": "How countries are written.",
            "default": "iso2"
          },
          "dateOrder": {
            "title": "Date order in your data",
            "enum": [
              "auto",
              "DMY",
              "MDY",
              "YMD"
            ],
            "type": "string",
            "description": "Auto reads the order from the column (25/12 can only be day first). Dates that stay unclear are reported as DATE_AMBIGUOUS. Output is always YYYY-MM-DD.",
            "default": "auto"
          },
          "splitNames": {
            "title": "Split full names",
            "type": "boolean",
            "description": "Adds firstName and lastName (and middleName, namePrefix, nameSuffix when present). Not used when the list already has first and last name columns.",
            "default": true
          },
          "fixNameCase": {
            "title": "Fix upper / lower case of names",
            "type": "boolean",
            "description": "JOHN SMITH and john smith become John Smith. Mixed case such as McDonald stays as typed.",
            "default": true
          },
          "repairText": {
            "title": "Repair broken text",
            "type": "boolean",
            "description": "Fixes mojibake (JosÃ© becomes José), invisible characters, HTML entities and outer spaces in all text columns.",
            "default": true
          },
          "fixEmailTypos": {
            "title": "Correct e-mail domain typos",
            "type": "boolean",
            "description": "Off: gmial.com is only reported with a suggestion. On: it is changed to gmail.com (and reported).",
            "default": false
          },
          "invalidValues": {
            "title": "Invalid values",
            "enum": [
              "keep",
              "empty"
            ],
            "type": "string",
            "description": "What happens to phones, e-mails, dates and countries that cannot be cleaned. They are always listed in _issues.",
            "default": "keep"
          },
          "duplicates": {
            "title": "Duplicates",
            "enum": [
              "flag",
              "remove",
              "off"
            ],
            "type": "string",
            "description": "Same e-mail address, or same phone and name when a row has no e-mail.",
            "default": "flag"
          },
          "dedupeBy": {
            "title": "Find duplicates by these columns",
            "type": "array",
            "description": "Optional, e.g. 'Phone' or 'firstName' + 'lastName' + 'City'. All listed columns must match after cleaning. Empty = automatic.",
            "items": {
              "type": "string"
            }
          },
          "maxRows": {
            "title": "Maximum rows",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many cleaned rows. 0 = all rows.",
            "default": 0
          },
          "exportFormat": {
            "title": "Also save as file",
            "enum": [
              "none",
              "csv",
              "xlsx",
              "json"
            ],
            "type": "string",
            "description": "One file in the key-value store, link in the OUTPUT record. Choose Excel if you open it in Excel: it would cut the + from phones in a CSV.",
            "default": "none"
          },
          "exportFileName": {
            "title": "File name",
            "type": "string",
            "description": "Without extension.",
            "default": "contacts-clean"
          },
          "maxFileSizeMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger files are skipped.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}