{
  "openapi": "3.0.1",
  "info": {
    "title": "Pre-Dial Phone Scrub — Send, Skip & Review Verdicts",
    "description": "Bulk pre-dial phone scrub for outbound call/SMS: E.164 normalize, Twilio line type, UK TPS/CTPS, optional HLR. Each number gets send/skip/review with reason codes, caveats, and audit — not a format-only validator.",
    "version": "0.1",
    "x-build-id": "XZbQb0nP7cIhVUUxO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pequod-labs~outbound-phone-scrub/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pequod-labs-outbound-phone-scrub",
        "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/pequod-labs~outbound-phone-scrub/runs": {
      "post": {
        "operationId": "runs-sync-pequod-labs-outbound-phone-scrub",
        "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/pequod-labs~outbound-phone-scrub/run-sync": {
      "post": {
        "operationId": "run-sync-pequod-labs-outbound-phone-scrub",
        "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": [
          "phones"
        ],
        "properties": {
          "phones": {
            "title": "Phone numbers",
            "type": "array",
            "description": "One phone per item. Accepts national or international formats; optional <code>defaultRegion</code> helps parse numbers without a country prefix.",
            "default": [
              "+447700123456",
              "+393331234567",
              "+33123456789"
            ],
            "items": {
              "type": "string"
            }
          },
          "channel": {
            "title": "Outbound channel",
            "enum": [
              "call",
              "sms",
              "unknown"
            ],
            "type": "string",
            "description": "How you plan to contact the number. SMS is stricter on risky VoIP/premium line types.",
            "default": "unknown"
          },
          "purpose": {
            "title": "Campaign purpose",
            "enum": [
              "b2b_sales",
              "b2c_marketing",
              "unknown"
            ],
            "type": "string",
            "description": "Campaign purpose metadata. Does not change MVP verdicts; US RND uses consentDate + packs.usReassigned instead.",
            "default": "unknown"
          },
          "packs": {
            "title": "Enrichment packs",
            "type": "object",
            "description": "Toggle optional enrichment steps. Missing upstream credentials skip the pack and surface explicit coverage caveats instead of failing the run.",
            "properties": {
              "lineType": {
                "title": "Twilio line type intelligence",
                "type": "boolean",
                "description": "Lookup Twilio line type / carrier (mobile, landline, VoIP, etc.).",
                "default": true
              },
              "ukRegisters": {
                "title": "UK TPS/CTPS register check",
                "type": "boolean",
                "description": "Check UK TPS/CTPS via tpsapi.com when TPSAPI_API_KEY is set (GB/GG/JE/IM).",
                "default": true
              },
              "usReassigned": {
                "title": "US reassigned number (RND via Twilio)",
                "type": "boolean",
                "description": "Opt-in. Requires consentDate and a Twilio account with the reassigned_number package enabled. US numbers only.",
                "default": false
              },
              "reachability": {
                "title": "HLR reachability (pre-dial scrub)",
                "type": "boolean",
                "description": "Opt-in HLR lookup via HLR Lookup when HLRLOOKUP_API_KEY and HLRLOOKUP_API_SECRET are set. Flags dead/absent numbers before dial.",
                "default": false
              },
              "usLitigator": {
                "title": "US TCPA litigator list",
                "type": "boolean",
                "description": "Opt-in. Checks known US litigator databases via CheckThatPhone when CHECKTHATPHONE_API_KEY is set. US numbers only.",
                "default": false
              },
              "usDnc": {
                "title": "US federal/state DNC flags",
                "type": "boolean",
                "description": "Opt-in. Surfaces federal/state DNC flags from CheckThatPhone when available in the same response. Does not invent listed=false as certainty.",
                "default": false
              },
              "euRegisters": {
                "title": "EU national registers (BYO webhook)",
                "type": "boolean",
                "description": "Opt-in. For IT/ES/BE/SE licensed registers, POSTs to your <code>EU_REGISTER_WEBHOOK_URL</code> with register credentials you supply. Consent-regime markets (DE, NL, AT, PT, IE) and closed FR get <code>consent_or_local_rules</code> only — no invented hits. Default off.",
                "default": false
              }
            },
            "default": {
              "lineType": true,
              "ukRegisters": true,
              "usReassigned": false,
              "reachability": false,
              "usLitigator": false,
              "usDnc": false,
              "euRegisters": false
            }
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Parallel upstream lookups per run (Twilio and TPSCheck).",
            "default": 5
          },
          "defaultRegion": {
            "title": "Default region (ISO)",
            "type": "string",
            "description": "Two-letter ISO country code used when a number has no international prefix (e.g. <code>GB</code>, <code>IT</code>).",
            "default": ""
          },
          "consentDate": {
            "title": "Consent / last-verified date",
            "type": "string",
            "description": "YYYY-MM-DD or YYYYMMDD. Required for meaningful US RND when packs.usReassigned is on (sent to Twilio as LastVerifiedDate). EU numbers still get consent_or_local_rules caveats from country coverage, not from this field.",
            "default": ""
          },
          "quietHours": {
            "title": "Quiet hours (pre-flight flag)",
            "type": "object",
            "description": "Optional local-time window flag. When enabled and the current local hour is outside [startHour, endHour), call/SMS rows get review + quiet_hours (enforcement stays in your dialer).",
            "properties": {
              "enabled": {
                "title": "Enabled",
                "type": "boolean",
                "description": "When true, evaluate the local-time window and surface quiet_hours review for call/SMS outside the window.",
                "default": false
              },
              "timezone": {
                "title": "IANA timezone",
                "type": "string",
                "description": "IANA timezone name (e.g. America/New_York) used with zoneinfo for local hour.",
                "default": "America/New_York"
              },
              "startHour": {
                "title": "Window start hour",
                "type": "integer",
                "description": "Inclusive local hour (0–23) when contact is allowed.",
                "default": 8,
                "minimum": 0,
                "maximum": 23
              },
              "endHour": {
                "title": "Window end hour",
                "type": "integer",
                "description": "Exclusive local hour (0–23) when contact is allowed.",
                "default": 21,
                "minimum": 0,
                "maximum": 23
              }
            },
            "default": {
              "enabled": false,
              "timezone": "America/New_York",
              "startHour": 8,
              "endHour": 21
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}