{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Companies House Leads — Filing Signals & AI Outreach",
    "version": "0.1",
    "x-build-id": "WEchNQ9JCtvvgF9d3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automationnation~companies-house-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automationnation-companies-house-leads",
        "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/automationnation~companies-house-leads/runs": {
      "post": {
        "operationId": "runs-sync-automationnation-companies-house-leads",
        "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/automationnation~companies-house-leads/run-sync": {
      "post": {
        "operationId": "run-sync-automationnation-companies-house-leads",
        "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": {
          "companiesHouseApiKey": {
            "title": "Companies House API Key (free)",
            "type": "string",
            "description": "Free UK government API key. Register at developer.companieshouse.gov.uk — required, this is the actor's core data source."
          },
          "sicCodes": {
            "title": "SIC codes (comma-separated)",
            "type": "string",
            "description": "Filter by UK SIC industry codes, e.g. \"62012,70229\" for IT consultancy + management consultancy. Leave blank for all industries.",
            "default": ""
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "Filter by registered office location, e.g. \"Manchester\" or \"London\". Leave blank for all UK.",
            "default": ""
          },
          "companyStatus": {
            "title": "Company status",
            "type": "array",
            "description": "Only include companies with this status. Active is almost always what you want for lead generation.",
            "items": {
              "type": "string",
              "enum": [
                "active",
                "dissolved",
                "liquidation",
                "receivership",
                "administration"
              ]
            },
            "default": [
              "active"
            ]
          },
          "incorporatedFrom": {
            "title": "Incorporated from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only include companies incorporated on or after this date. Leave blank for no lower bound.",
            "default": ""
          },
          "incorporatedTo": {
            "title": "Incorporated to (YYYY-MM-DD)",
            "type": "string",
            "description": "Only include companies incorporated on or before this date. Leave blank for no upper bound.",
            "default": ""
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of companies to process. Free trial is capped at 8 regardless of this value.",
            "default": 25
          },
          "signalWindowDays": {
            "title": "Filing signal window (days)",
            "minimum": 30,
            "maximum": 730,
            "type": "integer",
            "description": "How far back to look for funding filings (SH01), leadership changes, and \"newly incorporated\" status when scoring leads.",
            "default": 180
          },
          "anthropicApiKey": {
            "title": "Anthropic API key (optional)",
            "type": "string",
            "description": "Enables AI intent analysis and outreach message generation. Tried before Gemini if both are set."
          },
          "geminiApiKey": {
            "title": "Google Gemini API key (optional)",
            "type": "string",
            "description": "Free-tier alternative to Anthropic for AI intent analysis and outreach generation."
          },
          "yourName": {
            "title": "Your name",
            "type": "string",
            "description": "Used to personalise generated outreach messages.",
            "default": ""
          },
          "yourBusiness": {
            "title": "Your business name",
            "type": "string",
            "description": "Used to personalise generated outreach messages.",
            "default": ""
          },
          "yourService": {
            "title": "Your service",
            "type": "string",
            "description": "What you offer — used to write relevant outreach messages.",
            "default": ""
          },
          "yourEmail": {
            "title": "Your email",
            "type": "string",
            "description": "Included in generated outreach templates.",
            "default": ""
          },
          "yourPhone": {
            "title": "Your phone",
            "type": "string",
            "description": "Included in generated outreach templates.",
            "default": ""
          },
          "deliverEmail": {
            "title": "Deliver via email (CSV)",
            "type": "boolean",
            "description": "Email the results as a CSV attachment via SMTP.",
            "default": false
          },
          "smtpHost": {
            "title": "SMTP host",
            "type": "string",
            "description": "Required if email delivery is enabled.",
            "default": ""
          },
          "smtpPort": {
            "title": "SMTP port",
            "type": "integer",
            "description": "Usually 587 (STARTTLS) or 465 (SSL).",
            "default": 587
          },
          "smtpUser": {
            "title": "SMTP username",
            "type": "string",
            "description": "Required if email delivery is enabled.",
            "default": ""
          },
          "smtpPass": {
            "title": "SMTP password",
            "type": "string",
            "description": "Required if email delivery is enabled."
          },
          "toEmail": {
            "title": "Send results to",
            "type": "string",
            "description": "Recipient email address for CSV delivery.",
            "default": ""
          },
          "fromEmail": {
            "title": "From email",
            "type": "string",
            "description": "Defaults to the SMTP username if left blank.",
            "default": ""
          },
          "deliverWebhook": {
            "title": "Deliver via webhook",
            "type": "boolean",
            "description": "POST results to a webhook URL (Zapier, Make, your own CRM, etc.)",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Required if webhook delivery is enabled.",
            "default": ""
          },
          "webhookFormat": {
            "title": "Webhook payload format",
            "enum": [
              "json",
              "csv"
            ],
            "type": "string",
            "description": "JSON payload or CSV body.",
            "default": "json"
          },
          "webhookPerRecord": {
            "title": "Send one webhook call per lead",
            "type": "boolean",
            "description": "Required by Zapier catch hooks and most CRMs — sends one POST per lead instead of one bulk POST.",
            "default": false
          },
          "deliverSlack": {
            "title": "Deliver Slack summary",
            "type": "boolean",
            "description": "Post a summary of the top leads to a Slack channel.",
            "default": false
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL",
            "type": "string",
            "description": "Required if Slack delivery is enabled.",
            "default": ""
          },
          "slackChannel": {
            "title": "Slack channel",
            "type": "string",
            "description": "Optional — overrides the webhook's default channel.",
            "default": ""
          },
          "deliverHubSpot": {
            "title": "Push to HubSpot",
            "type": "boolean",
            "description": "Create HubSpot contacts for each lead.",
            "default": false
          },
          "hubspotToken": {
            "title": "HubSpot private app token",
            "type": "string",
            "description": "Required if HubSpot delivery is enabled."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}