{
  "openapi": "3.0.1",
  "info": {
    "title": "Lead Stopwatch: Secret Shopper Speed-to-Lead Test",
    "description": "Secret-shopper speed-to-lead test for local businesses. Fills each website's quote form with a test request, times the auto-reply and the first real human reply, cold time, follow-ups and review requests, then grades A-F and ranks locally.",
    "version": "1.0",
    "x-build-id": "gH5xi9smc81es4cIa"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/growth-installations~lead-stopwatch/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-growth-installations-lead-stopwatch",
        "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/growth-installations~lead-stopwatch/runs": {
      "post": {
        "operationId": "runs-sync-growth-installations-lead-stopwatch",
        "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/growth-installations~lead-stopwatch/run-sync": {
      "post": {
        "operationId": "run-sync-growth-installations-lead-stopwatch",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "plant",
              "check",
              "report"
            ],
            "type": "string",
            "description": "plant = find each business's contact/quote form and (unless Dry run) submit one test request. check = read the reply inbox and update every timer (schedule this every 30 minutes). report = rebuild the dataset and scorecards without reading mail.",
            "default": "plant"
          },
          "dryRun": {
            "title": "Dry run (find and map forms, submit nothing)",
            "type": "boolean",
            "description": "On by default. Finds the form on each site, maps its fields and tells you whether it can be tested, but never submits. Turn off only when you are ready to send real test requests.",
            "default": true
          },
          "businesses": {
            "title": "Businesses to test",
            "type": "array",
            "description": "Businesses whose OWNERS ordered and authorized this test. Website URLs or Google Maps place URLs, or objects like {\"url\": \"https://acmehvac.com\", \"name\": \"Acme HVAC\", \"ownerName\": \"Dana Lee\", \"industry\": \"hvac\", \"group\": \"Richmond HVAC\", \"ownerConsent\": true, \"consentReference\": \"Agreement #1042, signed 2026-11-03\", \"approvedTestWindows\": [\"mon-fri 08:00-18:00\", \"sat 09:00-12:00\"], \"doNotContactTimes\": [\"2026-11-26\", \"daily 21:00-07:00\"], \"timezone\": \"America/New_York\"}. A real test is only planted when ownerConsent is true and the current time is inside an approved window and outside every do-not-contact time; otherwise the row is skipped as no-consent or outside-test-window. Dry runs ignore consent (they only read the public site)."
          },
          "campaignId": {
            "title": "Campaign ID",
            "type": "string",
            "description": "Name for this batch of tests. Use the same ID for plant, check and report runs so they share timers.",
            "default": "default"
          },
          "defaultIndustry": {
            "title": "Default industry",
            "type": "string",
            "description": "Used to pick the service in the request when a business has no industry, e.g. hvac, plumber, roofer, dentist, med spa."
          },
          "defaultGroup": {
            "title": "Default comparison group",
            "type": "string",
            "description": "Businesses in the same group are ranked against each other, e.g. 'Richmond HVAC'."
          },
          "defaultApprovedTestWindows": {
            "title": "Default approved test windows",
            "type": "array",
            "description": "Used when a business has no approvedTestWindows. Rules in the business's time zone: 'mon-fri 08:00-18:00', 'sat', 'daily 09:00-17:00', or an ISO range '2026-11-05T09:00/2026-11-05T12:00'. Empty = any time.",
            "items": {
              "type": "string"
            }
          },
          "defaultDoNotContactTimes": {
            "title": "Default do-not-contact times",
            "type": "array",
            "description": "Used when a business has no doNotContactTimes. Same rule format, plus whole dates like '2026-11-26'.",
            "items": {
              "type": "string"
            }
          },
          "plusAddressBase": {
            "title": "Reply inbox (plus-addressing)",
            "type": "string",
            "description": "A Gmail or Google Workspace address, e.g. tests@yourdomain.com. Each business gets a unique address like tests+ls-default-acmehvac-1a2b@yourdomain.com. Use this OR a catch-all domain."
          },
          "testInboxDomain": {
            "title": "Reply inbox (catch-all domain)",
            "type": "string",
            "description": "A domain or subdomain whose mail all lands in one inbox, e.g. shop.yourdomain.com. Each business gets ls-<campaign>-<business>@shop.yourdomain.com. Takes priority over plus-addressing."
          },
          "firstName": {
            "title": "Test first name",
            "type": "string",
            "description": "First name used on the form. Use a test persona, not a real person.",
            "default": "Jordan"
          },
          "lastName": {
            "title": "Test last name",
            "type": "string",
            "description": "Used only when the form asks for a last name.",
            "default": "Reed"
          },
          "messageTemplate": {
            "title": "Message template",
            "type": "string",
            "description": "{firstName} and {service} are filled in. Keep it harmless: ask for a quote and availability; never book a real slot.",
            "default": "Hi, this is {firstName}. I'm looking for a quote on {service}. What's your availability over the next couple of weeks? Email is the best way to reach me."
          },
          "serviceByIndustry": {
            "title": "Service per industry",
            "type": "object",
            "description": "Overrides the built-in service phrases, e.g. {\"hvac\": \"a furnace check\"}. Built in: hvac, plumber, roofer, electrician, dentist, orthodontist, chiropractor, med spa, veterinarian and more."
          },
          "defaultService": {
            "title": "Fallback service",
            "type": "string",
            "description": "Used when the industry has no phrase.",
            "default": "a quote for your services"
          },
          "testPhone": {
            "title": "Test phone (optional)",
            "type": "string",
            "description": "Only used when a form requires a phone. Must be a number you control. Leave empty and forms that require a phone are skipped as field-blocked."
          },
          "zipCode": {
            "title": "ZIP code (optional)",
            "type": "string",
            "description": "Filled only when a form requires a ZIP."
          },
          "disclosureLine": {
            "title": "Disclosure line (optional)",
            "type": "string",
            "description": "Appended to the message, e.g. 'This is a response-time test from Acme Agency.'"
          },
          "windowDays": {
            "title": "Test window (days)",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How long each test keeps timing replies.",
            "default": 7
          },
          "imapHost": {
            "title": "IMAP host",
            "type": "string",
            "description": "e.g. imap.gmail.com"
          },
          "imapPort": {
            "title": "IMAP port",
            "type": "integer",
            "description": "SSL port.",
            "default": 993
          },
          "imapUser": {
            "title": "IMAP username",
            "type": "string",
            "description": "Usually the full email address."
          },
          "imapPassword": {
            "title": "IMAP password / app password",
            "type": "string",
            "description": "For Gmail use an app password. Stored encrypted."
          },
          "imapFolder": {
            "title": "IMAP folder",
            "type": "string",
            "description": "Folder to read.",
            "default": "INBOX"
          },
          "imapExtraFolders": {
            "title": "Extra folders",
            "type": "array",
            "description": "Also read these, e.g. [\"[Gmail]/Spam\"] so auto-replies caught as spam still count.",
            "items": {
              "type": "string"
            }
          },
          "openaiApiKey": {
            "title": "OpenAI API key (optional)",
            "type": "string",
            "description": "If set, each reply is also labeled automated vs human by a small OpenAI model. Without it a header + wording heuristic is used."
          },
          "agencyName": {
            "title": "Your agency name",
            "type": "string",
            "description": "Shown on the Response Scorecard."
          },
          "ctaText": {
            "title": "Scorecard button text",
            "type": "string",
            "description": "e.g. 'Book a 15-minute fix call'"
          },
          "ctaUrl": {
            "title": "Scorecard button link",
            "type": "string",
            "description": "Where the button goes."
          },
          "timezone": {
            "title": "Scorecard time zone",
            "type": "string",
            "description": "IANA zone for times on the scorecard.",
            "default": "America/New_York"
          },
          "maxBusinesses": {
            "title": "Max businesses per run",
            "minimum": 1,
            "type": "integer",
            "description": "Safety cap.",
            "default": 200
          },
          "maxConcurrency": {
            "title": "Browsers at once",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "1-5.",
            "default": 2
          },
          "replant": {
            "title": "Re-plant already tested businesses",
            "type": "boolean",
            "description": "Off: businesses already planted in this campaign are skipped.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that keeps timers between runs.",
            "default": "lead-stopwatch-state"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Helps when resolving Google Maps URLs.",
            "default": {
              "useApifyProxy": false
            }
          },
          "mockMessages": {
            "title": "Test messages instead of IMAP",
            "type": "array",
            "description": "For trying check mode without an inbox: [{\"to\": \"<reply address>\", \"from\": \"...\", \"subject\": \"...\", \"body\": \"...\", \"receivedAt\": \"+12m\", \"headers\": {}}]. receivedAt can be ISO time or +Nm/+Nh after the submit."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}