{
  "openapi": "3.0.1",
  "info": {
    "title": "ICP Fit Scorer",
    "description": "Score companies against your ICP using weighted signals and pre-built templates. Returns icp_score 0-100, icp_tier A-D, per-signal breakdown, and plain-English explanation. Flat Clay-ready output.",
    "version": "1.1",
    "x-build-id": "XgBEdiQsMNHKsMWg1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mambalabs~icp-fit-scorer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mambalabs-icp-fit-scorer",
        "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/mambalabs~icp-fit-scorer/runs": {
      "post": {
        "operationId": "runs-sync-mambalabs-icp-fit-scorer",
        "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/mambalabs~icp-fit-scorer/run-sync": {
      "post": {
        "operationId": "run-sync-mambalabs-icp-fit-scorer",
        "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": [
          "company_domain"
        ],
        "properties": {
          "company_domain": {
            "title": "Company Domain",
            "type": "string",
            "description": "The primary domain of the company to score (e.g. clay.com)."
          },
          "company_name": {
            "title": "Company Name",
            "type": "string",
            "description": "Optional display name of the company."
          },
          "scoring_config": {
            "title": "Scoring Config",
            "type": "object",
            "description": "JSON scoring weights config. Alternative to icp_description. Required if icp_description is not provided. Takes precedence over template if both are provided."
          },
          "template": {
            "title": "Scoring Template",
            "enum": [
              "saas_outbound",
              "b2b_services",
              "fintech",
              "smb_local",
              "enterprise"
            ],
            "type": "string",
            "description": "Pre-built scoring config. Used when scoring_config is not provided. Options: saas_outbound, b2b_services, fintech, smb_local, enterprise."
          },
          "dataset_id": {
            "title": "Dataset ID",
            "type": "string",
            "description": "Apify dataset ID to fetch items from. Each item is processed as a lead to score. Works alongside or instead of inline JSON input."
          },
          "csv_url": {
            "title": "CSV URL",
            "type": "string",
            "description": "URL of a CSV file to fetch and parse. Each row becomes a lead to score. Works alongside inline JSON or dataset_id."
          },
          "fetch_signals": {
            "title": "Fetch Signals",
            "type": "boolean",
            "description": "If true, call mambalabs/gtm-hiring-signal-scraper and mambalabs/gtm-tech-stack-signal-scraper for each domain before scoring. Requires apify_token.",
            "default": false
          },
          "apify_token": {
            "title": "Apify Token",
            "type": "string",
            "description": "Apify API token for fetch_signals and dataset_id features. Falls back to APIFY_TOKEN env var."
          },
          "include_explanation": {
            "title": "Include Explanation",
            "type": "boolean",
            "description": "If true, adds a score_explanation string to each output row describing what matched, missed, and point values.",
            "default": false
          },
          "min_score_to_output": {
            "title": "Min Score to Output",
            "type": "integer",
            "description": "If set, rows scoring below this threshold are skipped from output (not pushed to dataset). Skipped rows are logged only."
          },
          "webhook_url": {
            "title": "Webhook URL",
            "type": "string",
            "description": "URL to POST each scored result to as JSON after pushing to dataset. Fire and forget."
          },
          "previous_score": {
            "title": "Previous Score",
            "type": "integer",
            "description": "Previous ICP score for this company. If provided, output includes score_change and score_trend fields."
          },
          "gtm_hiring_signal": {
            "title": "GTM Hiring Signal",
            "type": "boolean",
            "description": "Whether the company is actively hiring for GTM/sales roles."
          },
          "uses_hubspot": {
            "title": "Uses HubSpot",
            "type": "boolean",
            "description": "Whether the company uses HubSpot."
          },
          "uses_salesforce": {
            "title": "Uses Salesforce",
            "type": "boolean",
            "description": "Whether the company uses Salesforce."
          },
          "uses_clay": {
            "title": "Uses Clay",
            "type": "boolean",
            "description": "Whether the company uses Clay."
          },
          "crm_detected": {
            "title": "CRM Detected",
            "type": "boolean",
            "description": "Whether any CRM was detected. Auto-derived from uses_hubspot/uses_salesforce if not set."
          },
          "seq_tool_detected": {
            "title": "Sequencing Tool Detected",
            "type": "boolean",
            "description": "Whether a sales sequencing tool (Outreach, SalesLoft, Apollo, Lemlist) was detected."
          },
          "tech_stack": {
            "title": "Tech Stack",
            "type": "string",
            "description": "Comma-separated list of technologies. Used to auto-detect CRM/sequencing tools if booleans are not set."
          },
          "headcount": {
            "title": "Headcount",
            "type": "integer",
            "description": "Current employee headcount."
          },
          "headcount_min": {
            "title": "Headcount Min",
            "type": "integer",
            "description": "Minimum headcount for the headcount_in_range signal."
          },
          "headcount_max": {
            "title": "Headcount Max",
            "type": "integer",
            "description": "Maximum headcount for the headcount_in_range signal."
          },
          "headcount_in_range": {
            "title": "Headcount In Range",
            "type": "boolean",
            "description": "Override: whether headcount is in your target range."
          },
          "recently_funded": {
            "title": "Recently Funded",
            "type": "boolean",
            "description": "Override: whether the company was recently funded (within 18 months)."
          },
          "last_funding_date": {
            "title": "Last Funding Date",
            "type": "string",
            "description": "ISO date of last funding round. Used to auto-detect recently_funded if boolean is not set."
          },
          "funding_stage": {
            "title": "Funding Stage",
            "type": "string",
            "description": "Funding stage (e.g. seed, series_a, series_b, growth). Used to infer recently_funded."
          },
          "industry": {
            "title": "Industry",
            "type": "string",
            "description": "The company's industry."
          },
          "industry_match": {
            "title": "Industry Match",
            "type": "boolean",
            "description": "Override: whether the company's industry matches your target list."
          },
          "target_industries": {
            "title": "Target Industries",
            "type": "string",
            "description": "Comma-separated list of target industries for the industry_match signal."
          },
          "icp_description": {
            "title": "ICP Description",
            "type": "string",
            "description": "Describe your target ICP in plain English. Requires llm_api_key. Alternative to scoring_config for non-technical users."
          },
          "llm_api_key": {
            "title": "LLM API Key",
            "type": "string",
            "description": "Your OpenAI or Anthropic API key. Required when using icp_description mode. Transmitted to Apify infrastructure for the duration of the run only."
          },
          "llm_provider": {
            "title": "LLM Provider",
            "enum": [
              "openai",
              "anthropic"
            ],
            "type": "string",
            "description": "Which LLM provider to use when generating a scoring config from icp_description. Accepts openai (GPT-4o-mini) or anthropic (claude-haiku-4-5-20251001). Ignored if scoring_config is provided directly.",
            "default": "openai"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}