{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Lead Enrichment & Outreach Generator",
    "description": "Turn a CSV or Google Sheet of leads into ready-to-send outreach in one run. Scrapes each company's website, detects business signals (hiring, dev focus, B2B SaaS), and generates grounded icebreakers, angles, and value hooks with OpenAI — tied to your own value proposition and fit-scored per lead.",
    "version": "0.0",
    "x-build-id": "meg9uU8bZuNqqMsxZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/piotrv1001~ai-lead-enrichment-outreach-generator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-piotrv1001-ai-lead-enrichment-outreach-generator",
        "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/piotrv1001~ai-lead-enrichment-outreach-generator/runs": {
      "post": {
        "operationId": "runs-sync-piotrv1001-ai-lead-enrichment-outreach-generator",
        "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/piotrv1001~ai-lead-enrichment-outreach-generator/run-sync": {
      "post": {
        "operationId": "run-sync-piotrv1001-ai-lead-enrichment-outreach-generator",
        "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": [
          "inputSourceType",
          "openAiModel"
        ],
        "properties": {
          "inputSourceType": {
            "title": "Lead source",
            "enum": [
              "csv_upload",
              "google_sheet"
            ],
            "type": "string",
            "description": "Choose whether to upload a CSV or provide a public Google Sheets link. The default example uses a bundled sample of 3 B2B SaaS companies — leave csvFile set to 'SAMPLE' to try it without uploading anything.",
            "default": "csv_upload"
          },
          "csvFile": {
            "title": "Upload leads CSV",
            "type": "string",
            "description": "Upload a CSV containing your leads. Used when 'Lead source' is 'CSV upload'. The special value 'SAMPLE' loads a bundled 3-row sample (Linear, Notion, PostHog) so you can see the actor work end-to-end without uploading a file."
          },
          "googleSheetUrl": {
            "title": "Public Google Sheets URL",
            "type": "string",
            "description": "Paste a publicly accessible Google Sheets URL. Used when 'Lead source' is 'Public Google Sheets URL'."
          },
          "maxRows": {
            "title": "Maximum rows to process",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of rows to process from the input source. Higher values take longer and cost more.",
            "default": 100
          },
          "websiteColumn": {
            "title": "Website column",
            "type": "string",
            "description": "Name of the column in your CSV / Google Sheet that contains each lead's company website URL.",
            "default": "website"
          },
          "companyNameColumn": {
            "title": "Company name column",
            "type": "string",
            "description": "Name of the column that contains the company name.",
            "default": "company_name"
          },
          "leadNameColumn": {
            "title": "Lead first name column",
            "type": "string",
            "description": "Name of the column that contains the lead's first name. Used in icebreakers and LinkedIn openers.",
            "default": "first_name"
          },
          "jobTitleColumn": {
            "title": "Job title column",
            "type": "string",
            "description": "Optional. Name of the column that contains the lead's job title. Helps the AI tailor the angle to the lead's role.",
            "default": "title"
          },
          "companyDescriptionColumn": {
            "title": "Company description column",
            "type": "string",
            "description": "Optional. Name of the column that contains a short description of the company. Used as extra context for the AI if present.",
            "default": "company_description"
          },
          "additionalContextColumns": {
            "title": "Additional columns to include in AI context",
            "type": "array",
            "description": "Optional list of additional column names from your CSV to pass verbatim into the AI prompt as extra context.",
            "items": {
              "type": "string"
            }
          },
          "sellerValueProposition": {
            "title": "Your value proposition",
            "type": "string",
            "description": "1–3 sentences describing what you sell, who it's for, and the concrete outcome you deliver. Used to ground the outreach copy so the AI can tie your offer to each lead's company context."
          },
          "sellerCompanyName": {
            "title": "Your company name",
            "type": "string",
            "description": "Optional. Used by the AI to sign-off naturally and avoid awkward phrasing."
          },
          "sellerProofPoints": {
            "title": "Proof points / customer logos",
            "type": "array",
            "description": "Optional. Short facts the AI is allowed to cite: customer names, metrics, case studies.",
            "items": {
              "type": "string"
            }
          },
          "minFitScoreToCharge": {
            "title": "Minimum fit score to charge",
            "type": "string",
            "description": "Number between 0 and 1. If greater than 0, rows with a confidence_score below this threshold will be marked 'skipped' and not billed. Useful once you provide a value proposition, so you only pay for leads that are a real fit. Leave at 0 to disable.",
            "default": "0"
          },
          "openAiModel": {
            "title": "OpenAI model",
            "enum": [
              "gpt-4o-mini",
              "gpt-4.1-mini",
              "gpt-4o",
              "gpt-4.1"
            ],
            "type": "string",
            "description": "Select the OpenAI model to use. Pricing depends on the selected model — see README for the per-result price table.",
            "default": "gpt-4o-mini"
          },
          "outputTypes": {
            "title": "Generated outputs",
            "type": "array",
            "description": "Which outreach assets the AI should generate for each lead. You always get a personalization_reason and confidence_score in addition to these.",
            "items": {
              "type": "string",
              "enum": [
                "icebreaker",
                "outreach_angle",
                "value_hook",
                "email_subject",
                "linkedin_opener"
              ]
            },
            "default": [
              "icebreaker",
              "outreach_angle",
              "value_hook"
            ]
          },
          "scrapeMode": {
            "title": "Scraping depth",
            "enum": [
              "homepage_only",
              "homepage_plus_about",
              "smart_multi_page"
            ],
            "type": "string",
            "description": "How much of each company website to scrape. 'homepage_only' is fastest; 'smart_multi_page' fetches up to maxPagesPerCompany relevant internal pages (about, product, customers, blog).",
            "default": "homepage_plus_about"
          },
          "maxPagesPerCompany": {
            "title": "Maximum pages per company",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Cap on the number of pages fetched per unique company domain. Only applies in smart_multi_page mode.",
            "default": 3
          },
          "tone": {
            "title": "Tone",
            "enum": [
              "professional",
              "friendly",
              "curious",
              "direct",
              "casual"
            ],
            "type": "string",
            "description": "Desired tone of voice for the generated outreach copy.",
            "default": "professional"
          },
          "lengthPreference": {
            "title": "Length",
            "enum": [
              "very_short",
              "short",
              "medium"
            ],
            "type": "string",
            "description": "Preferred length of the generated outreach assets.",
            "default": "short"
          },
          "detectSignals": {
            "title": "Detect business signals",
            "type": "boolean",
            "description": "Run rule-based signal detection (hiring, dev/API focus, ecommerce, B2B SaaS, etc.) on the scraped pages and pass them to the AI.",
            "default": true
          },
          "includeSourceUrls": {
            "title": "Include source URLs in output",
            "type": "boolean",
            "description": "Include the list of scraped URLs in each output row for auditability.",
            "default": true
          },
          "saveIntermediateFields": {
            "title": "Include enrichment fields in output",
            "type": "boolean",
            "description": "Include company summary and detected signal fields in each output row alongside the generated outreach assets.",
            "default": true
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Enable verbose logging (extracted page titles, selected pages, signal detection details, prompt stats).",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}