# Evidence-Based B2B Lead Qualification & Outreach (`nextlabs/ai-lead-qualifier-outreach`) Actor

Turn a company list into evidence-backed ICP scores, buying-signal explanations, and ready-to-review LinkedIn and email outreach. Bring your own AI and research keys.

- **URL**: https://apify.com/nextlabs/ai-lead-qualifier-outreach.md
- **Developed by:** [Adam Chierici](https://apify.com/nextlabs) (community)
- **Categories:** AI, Automation, Lead generation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 leads

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Evidence-Based B2B Lead Qualification & Outreach

Turn a company list into evidence-backed ICP scores, buying-signal explanations, and ready-to-review LinkedIn and email outreach.

This Actor is designed around the result: prioritize the accounts worth a conversation and show why. You provide the offer, ICP, observable qualification criteria, hard disqualifiers, and target roles. The Actor researches each company, assesses only those criteria, validates citations, and calculates the final scores in code.

### Best for

- agencies and consultants qualifying prospect lists;
- SDR and RevOps teams preparing CRM-ready research;
- founders testing an ICP before manual outreach;
- automation teams prioritizing accounts for human review.

It does not find personal emails, scrape LinkedIn, send messages, or replace a salesperson’s judgment.

### What each result contains

- company description, industry, country, products, customers, and operating context;
- evidence-linked pain points and automation opportunities;
- one assessment for every configured qualification criterion;
- supported disqualifier matches;
- four deterministic scores;
- a concise LinkedIn DM and optional email;
- sources, evidence chunk IDs, warnings, and verification metadata.

#### Score meanings

| Score | Meaning |
|---|---|
| `icp_fit_score` | Percentage of configured criteria assessed as match (1 point) or partial (0.5 point) |
| `evidence_confidence_score` | Confidence derived from evidence levels and valid citations |
| `contact_relevance_score` | Role similarity between the lead and configured target roles |
| `outreach_readiness_score` | 55% ICP fit + 25% evidence + 20% contact relevance |

A supported disqualifier caps ICP fit at 25 and outreach readiness at 30. The LLM never controls the final numeric scores.

### Input example

```json
{
  "leads": [
    {
      "fullName": "Mario Rossi",
      "jobTitle": "COO",
      "companyName": "Example Manufacturing",
      "companyUrl": "https://example.com",
      "notes": "Met at an industry event; evaluating process automation this quarter."
    }
  ],
  "offerDescription": "We automate document-heavy B2B operations by connecting ERP, CRM, email, and approval workflows with human-reviewed AI.",
  "idealCustomerProfile": "Italian mid-market manufacturers with multi-person operations teams, repetitive document workflows, and an active process-improvement initiative.",
  "qualificationCriteria": [
    "Operates document-heavy workflows",
    "Uses an ERP or CRM",
    "Has a multi-person operations team"
  ],
  "disqualifiers": ["Only serves consumers", "Has no operational team"],
  "targetRoles": ["COO", "Head of Operations", "Operations Director"],
  "targetIndustries": ["Manufacturing"],
  "targetCountries": ["Italy"],
  "outreachGoal": "Start a 15-minute discovery conversation about one operational workflow.",
  "aiProvider": "openrouter",
  "model": "openrouter/free",
  "researchProvider": "website-only",
  "researchDepth": "standard",
  "verificationMode": "deep",
  "language": "it",
  "messageStyle": "soft-consultative",
  "maxMessageChars": 300,
  "includeEmail": true,
  "maxConcurrency": 4
}
````

Use factual notes only. Writing “this company has the pain point I want” biases any qualification system.

### Research and verification modes

#### Research depth

| Value | Website behavior |
|---|---|
| `homepage` | Fetch the homepage |
| `standard` | Fetch the homepage and up to 3 useful internal pages |
| `deep` | Fetch the homepage and up to 5 useful internal pages |

Website-only mode uses lightweight HTTP extraction. It does not render JavaScript or bypass anti-bot systems. Tavily mode adds public web search and extraction using the user’s Tavily key.

#### Verification mode

| Value | Behavior | Store PPE event |
|---|---|---:|
| `standard` | One analysis call plus deterministic guardrails and citation validation | `apify-default-dataset-item` |
| `deep` | Adds a second independent LLM evidence-checking pass | `apify-default-dataset-item` |

The published Store pricing displays this event as `lead` and charges $20 per 1,000 results for both verification modes. Its technical event name is `apify-default-dataset-item`. AI and Tavily usage are BYO-key costs paid directly by the user.

### Output example

```json
{
  "status": "succeeded",
  "lead": {
    "full_name": "Mario Rossi",
    "job_title": "COO",
    "company_name": "Example Manufacturing",
    "company_url": "https://example.com",
    "linkedin_url": null
  },
  "qualification": {
    "icp_fit_score": 83,
    "evidence_confidence_score": 82,
    "contact_relevance_score": 100,
    "outreach_readiness_score": 86,
    "priority": "high",
    "criteria_assessment": [
      {
        "criterion": "Uses an ERP or CRM",
        "status": "match",
        "evidence_level": "direct",
        "evidence_urls": ["https://example.com/solutions"],
        "evidence_chunk_ids": ["example.com-solutions#1"],
        "rationale": "The solutions page explicitly mentions ERP integration."
      }
    ],
    "matched_criteria": ["Uses an ERP or CRM"],
    "partial_criteria": [],
    "missing_criteria": [],
    "disqualifier_matches": [],
    "reasons": ["The published workflow is aligned with the offer."],
    "red_flags": [],
    "score_breakdown": {
      "icp_fit_weight": 0.55,
      "evidence_confidence_weight": 0.25,
      "contact_relevance_weight": 0.2
    }
  },
  "outreach": {
    "why_now": "The company publishes an ERP integration workflow.",
    "icebreaker": "I noticed your ERP integration focus.",
    "linkedin_dm": "Ciao Mario, ho notato il focus sulle integrazioni ERP. Lavoriamo su workflow documentali e approvativi collegati ai sistemi esistenti. Ha senso confrontarci per 15 minuti su un processo concreto?",
    "email_subject": "Un workflow operativo da semplificare",
    "email_body": "...",
    "cta": "Confronto di 15 minuti?"
  },
  "sources": ["https://example.com/solutions"],
  "warnings": [],
  "evidence_checker": {
    "enabled": true,
    "evidence_chunks_checked": 8,
    "model_based_verification": true
  },
  "metadata": {
    "research_depth": "standard",
    "verification_mode": "deep",
    "byo_api_keys": true,
    "linkedin_scraped": false
  }
}
```

The example values are illustrative; real output depends on the supplied evidence.

### Configure keys once

The input fields are secret and can be saved encrypted in an Apify Task. For a reusable Actor configuration, set a secret environment variable once in Apify Console under **Source → Environment variables** and leave the corresponding input field blank.

Use one of these names:

| Selected provider | Secret variable |
|---|---|
| OpenAI | `OPENAI_API_KEY` |
| OpenRouter | `OPENROUTER_API_KEY` |
| Anthropic | `ANTHROPIC_API_KEY` |
| Gemini | `GEMINI_API_KEY` |
| DeepSeek | `DEEPSEEK_API_KEY` |
| Mistral | `MISTRAL_API_KEY` |
| Groq | `GROQ_API_KEY` |
| ZenMux | `ZENMUX_API_KEY` |
| xAI | `XAI_API_KEY` |
| Qwen / Alibaba DashScope | `QWEN_API_KEY` |
| NVIDIA NIM | `NVIDIA_API_KEY` |

For Tavily, set `TAVILY_API_KEY`. Mark every key as **Secret**. A value typed into the input overrides the environment variable for that run. Never put keys in source code, README files, datasets, or Docker build arguments.

### Supported AI providers

The Actor supports direct adapters for OpenRouter, OpenAI, Anthropic Claude, Google Gemini, DeepSeek, Mistral, Groq, ZenMux, xAI Grok, Qwen / Alibaba DashScope, and NVIDIA NIM. The model field is passed through as an exact provider model ID, so the user can change models without code changes.

OpenRouter is the broadest option: one key reaches hundreds of model/provider combinations, including NVIDIA, Qwen, DeepSeek, and other vendors. Direct adapters are useful when you want the provider account, billing, rate limits, and data policy to be explicit. We do not claim that every provider on the internet has a dedicated adapter; for new OpenAI-compatible gateways, OpenRouter is the compatibility layer.

The default remains `openrouter/free`, which is useful for low-volume tests but has variable availability and tighter free-tier limits. For production, choose a pinned model such as `openrouter/auto` or an exact model ID and monitor cost, latency, and JSON reliability. Provider keys are marked secret in the Actor input schema and are never included in dataset output.

#### Provider/model examples

| Goal | `aiProvider` | `model` | Secret |
|---|---|---|---|
| Lowest-friction test | `openrouter` | `openrouter/free` | `OPENROUTER_API_KEY` |
| OpenRouter automatic routing | `openrouter` | `openrouter/auto` | `OPENROUTER_API_KEY` |
| NVIDIA direct | `nvidia` | `meta/llama-3.1-70b-instruct` | `NVIDIA_API_KEY` |
| Qwen direct | `qwen` | `qwen-flash` | `QWEN_API_KEY` |
| DeepSeek direct | `deepseek` | `deepseek-v4-flash` | `DEEPSEEK_API_KEY` |

Always keep the selected provider, model family, and secret aligned. If the model is blank, the Actor uses a safe provider default. The defaults track currently supported model IDs: Gemini `gemini-3.5-flash`, DeepSeek `deepseek-v4-flash`, Qwen `qwen-flash`, Groq `openai/gpt-oss-120b`, and NVIDIA `meta/llama-3.1-70b-instruct`. Provider catalogs change, so pin an exact model in production and retest after provider deprecation notices.

### GitHub, dev.to, and open source

Open source is optional. For the Apify Store, the source can stay private while the Store page, README, examples, and a short demo explain the outcome. A public GitHub repository is useful for trust and copy-paste examples, but it does not need to contain the full implementation: publish a sanitized example input, output schema, architecture notes, and issue tracker if you prefer to keep the core Actor private.

For dev.to, publish a practical tutorial such as “From 100 company URLs to a ranked outreach list with evidence,” with a 30–90 second run video, one redacted output, the Apify Actor link, and a clear note that users bring their own keys. Do not commit API keys, customer leads, or private datasets. The technical Actor slug stays stable; the human-readable Store title can change without breaking integrations.

### Reliability and security

- Public company URLs are validated before every request and redirect.
- Localhost, private networks, cloud metadata, embedded credentials, non-web schemes, and nonstandard ports are rejected.
- Responses are limited by content type, redirect count, and byte size.
- Website/search content is explicitly treated as untrusted data to reduce prompt-injection risk.
- Fabricated evidence chunk IDs cannot support a score.
- Unconfigured criteria and disqualifiers cannot affect scores.
- Failed leads produce transparent failed dataset items without charging a success event.
- Concurrency is bounded from 1 to 10.
- Pay-per-event runs preflight the user’s charge limit and stop output when it is reached.

### Limitations

- A model can still misinterpret ambiguous evidence. Review high-value prospects manually.
- Standard verification uses one LLM judgment pass; choose deep for higher-stakes lists.
- Static HTTP extraction may miss JavaScript-rendered websites.
- Public pages can be outdated or incomplete.
- The Actor generates drafts; it does not send LinkedIn messages or email.
- Do not use the output for protected-trait profiling or automated high-impact decisions.

### Local development

Requires Python 3.11+.

```bash
pip install -r requirements.txt
python -m unittest discover -s tests -v
apify run
```

To simulate pay-per-event locally:

```bash
ACTOR_TEST_PAY_PER_EVENT=true apify run
```

Deploy with:

```bash
apify push
```

Before publishing, configure the default dataset item event (shown as `lead` in the pricing UI) in Apify Console. The code follows the official [Apify pay-per-event flow](https://docs.apify.com/sdk/python/docs/concepts/pay-per-event), including charge-limit checks.

### Version 0.3 migration

Version 0.3 keeps the 0.2 input/output contract and adds:

- provider-specific secret environment-variable fallback;
- Tavily environment-variable fallback;
- no silent switching from OpenRouter to ZenMux when a legacy `zenmux:` model is present;
- OpenRouter’s default model is `openrouter/free` when the model field is blank; use `openrouter/auto` explicitly when the account has credits.

Clear any old `zenmux:` model from saved Tasks and republish the Actor before testing again.

# Actor input Schema

## `leads` (type: `array`):

1-200 B2B leads. Each lead needs a company name or public company website. LinkedIn URLs are context only and are not scraped.

## `offerDescription` (type: `string`):

Describe the offer being sold, the problem it solves, and the value delivered. This anchors qualification and outreach.

## `idealCustomerProfile` (type: `string`):

Describe the ideal company: size, sector, geography, operating model, maturity, and buying situation.

## `qualificationCriteria` (type: `array`):

1-12 concrete, observable conditions. Scores are calculated only from these criteria.

## `disqualifiers` (type: `array`):

Optional hard exclusions. A supported match caps the lead readiness score.

## `targetRoles` (type: `array`):

Roles that are relevant to the buying process, used for the contact relevance score.

## `targetIndustries` (type: `array`):

Optional industry focus used to guide research, not to fabricate a match.

## `targetCountries` (type: `array`):

Optional target geographies.

## `outreachGoal` (type: `string`):

The next step the message should seek.

## `aiProvider` (type: `string`):

Bring your own API key. OpenRouter provides access to hundreds of model/provider combinations through one account; the direct options use each provider API.

## `aiApiKey` (type: `string`):

Optional override. Leave blank to use the provider-specific secret environment variable configured on the Actor (for example OPENAI\_API\_KEY).

## `model` (type: `string`):

Optional exact model identifier. Leave blank to use the provider default. Examples: OpenRouter openrouter/free, Gemini gemini-3.5-flash, DeepSeek deepseek-v4-flash, Qwen qwen-flash, Groq openai/gpt-oss-120b, NVIDIA NIM meta/llama-3.1-70b-instruct. Model IDs are passed through unchanged.

## `researchProvider` (type: `string`):

Website-only crawls useful pages on the supplied company domain. Tavily also searches the public web.

## `researchApiKey` (type: `string`):

Optional override. Leave blank to use the secret TAVILY\_API\_KEY environment variable when Tavily is selected.

## `researchDepth` (type: `string`):

Homepage fetches one page; Standard crawls up to 4 useful pages; Deep crawls up to 6.

## `verificationMode` (type: `string`):

Standard uses deterministic citation guardrails and one LLM call. Deep adds a second LLM evidence-checking pass.

## `language` (type: `string`):

Language used for the analysis and outreach copy.

## `messageStyle` (type: `string`):

Tone used for the generated outreach.

## `maxMessageChars` (type: `integer`):

The generated message is trimmed to this limit.

## `includeEmail` (type: `boolean`):

Generate an email subject and body in addition to the LinkedIn DM.

## `maxConcurrency` (type: `integer`):

Controls speed and provider rate-limit pressure.

## Actor input object example

```json
{
  "leads": [
    {
      "fullName": "Alex Morgan",
      "jobTitle": "COO",
      "companyName": "Example Manufacturing",
      "companyUrl": "https://example.com",
      "notes": "Met at an industry event; evaluating process automation this quarter."
    }
  ],
  "offerDescription": "We automate document-heavy B2B operations by connecting ERP, CRM, email, and approval workflows with human-reviewed AI.",
  "idealCustomerProfile": "Italian mid-market manufacturers with multi-person operations teams, repetitive document workflows, and an active process-improvement initiative.",
  "qualificationCriteria": [
    "Operates document-heavy workflows",
    "Uses an ERP or CRM",
    "Has a multi-person operations team"
  ],
  "targetRoles": [
    "COO",
    "Head of Operations",
    "Operations Director"
  ],
  "outreachGoal": "Start a short discovery conversation.",
  "aiProvider": "openrouter",
  "researchProvider": "website-only",
  "researchDepth": "standard",
  "verificationMode": "deep",
  "language": "it",
  "messageStyle": "soft-consultative",
  "maxMessageChars": 300,
  "includeEmail": true,
  "maxConcurrency": 4
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "leads": [
        {
            "fullName": "Alex Morgan",
            "jobTitle": "COO",
            "companyName": "Example Manufacturing",
            "companyUrl": "https://example.com",
            "notes": "Met at an industry event; evaluating process automation this quarter."
        }
    ],
    "offerDescription": "We automate document-heavy B2B operations by connecting ERP, CRM, email, and approval workflows with human-reviewed AI.",
    "idealCustomerProfile": "Italian mid-market manufacturers with multi-person operations teams, repetitive document workflows, and an active process-improvement initiative.",
    "qualificationCriteria": [
        "Operates document-heavy workflows",
        "Uses an ERP or CRM",
        "Has a multi-person operations team"
    ],
    "targetRoles": [
        "COO",
        "Head of Operations",
        "Operations Director"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nextlabs/ai-lead-qualifier-outreach").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "leads": [{
            "fullName": "Alex Morgan",
            "jobTitle": "COO",
            "companyName": "Example Manufacturing",
            "companyUrl": "https://example.com",
            "notes": "Met at an industry event; evaluating process automation this quarter.",
        }],
    "offerDescription": "We automate document-heavy B2B operations by connecting ERP, CRM, email, and approval workflows with human-reviewed AI.",
    "idealCustomerProfile": "Italian mid-market manufacturers with multi-person operations teams, repetitive document workflows, and an active process-improvement initiative.",
    "qualificationCriteria": [
        "Operates document-heavy workflows",
        "Uses an ERP or CRM",
        "Has a multi-person operations team",
    ],
    "targetRoles": [
        "COO",
        "Head of Operations",
        "Operations Director",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("nextlabs/ai-lead-qualifier-outreach").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "leads": [
    {
      "fullName": "Alex Morgan",
      "jobTitle": "COO",
      "companyName": "Example Manufacturing",
      "companyUrl": "https://example.com",
      "notes": "Met at an industry event; evaluating process automation this quarter."
    }
  ],
  "offerDescription": "We automate document-heavy B2B operations by connecting ERP, CRM, email, and approval workflows with human-reviewed AI.",
  "idealCustomerProfile": "Italian mid-market manufacturers with multi-person operations teams, repetitive document workflows, and an active process-improvement initiative.",
  "qualificationCriteria": [
    "Operates document-heavy workflows",
    "Uses an ERP or CRM",
    "Has a multi-person operations team"
  ],
  "targetRoles": [
    "COO",
    "Head of Operations",
    "Operations Director"
  ]
}' |
apify call nextlabs/ai-lead-qualifier-outreach --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nextlabs/ai-lead-qualifier-outreach",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Evidence-Based B2B Lead Qualification & Outreach",
        "description": "Turn a company list into evidence-backed ICP scores, buying-signal explanations, and ready-to-review LinkedIn and email outreach. Bring your own AI and research keys.",
        "version": "0.3",
        "x-build-id": "HrklSddbSJdlLWblC"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/nextlabs~ai-lead-qualifier-outreach/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-nextlabs-ai-lead-qualifier-outreach",
                "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/nextlabs~ai-lead-qualifier-outreach/runs": {
            "post": {
                "operationId": "runs-sync-nextlabs-ai-lead-qualifier-outreach",
                "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/nextlabs~ai-lead-qualifier-outreach/run-sync": {
            "post": {
                "operationId": "run-sync-nextlabs-ai-lead-qualifier-outreach",
                "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": [
                    "leads",
                    "offerDescription",
                    "idealCustomerProfile",
                    "qualificationCriteria",
                    "aiProvider"
                ],
                "properties": {
                    "leads": {
                        "title": "Leads",
                        "minItems": 1,
                        "maxItems": 200,
                        "type": "array",
                        "description": "1-200 B2B leads. Each lead needs a company name or public company website. LinkedIn URLs are context only and are not scraped.",
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "fullName": {
                                    "type": "string",
                                    "title": "Full name",
                                    "description": "Lead full name, if known.",
                                    "maxLength": 200
                                },
                                "jobTitle": {
                                    "type": "string",
                                    "title": "Job title",
                                    "description": "Lead role or job title, if known.",
                                    "maxLength": 300
                                },
                                "companyName": {
                                    "type": "string",
                                    "title": "Company name",
                                    "description": "Company name. Required if companyUrl is not provided.",
                                    "maxLength": 300
                                },
                                "companyUrl": {
                                    "type": "string",
                                    "title": "Company website",
                                    "description": "Public HTTP/HTTPS website. Required if companyName is not provided. Private, local, and cloud-metadata addresses are blocked.",
                                    "maxLength": 2048
                                },
                                "linkedinUrl": {
                                    "type": "string",
                                    "title": "LinkedIn URL",
                                    "description": "Optional reference only; this Actor does not scrape LinkedIn.",
                                    "maxLength": 2048
                                },
                                "notes": {
                                    "type": "string",
                                    "title": "Factual lead notes",
                                    "description": "Optional facts you already know. Do not use this field to prescribe the desired score.",
                                    "maxLength": 3000
                                }
                            }
                        }
                    },
                    "offerDescription": {
                        "title": "What you sell",
                        "minLength": 20,
                        "maxLength": 3000,
                        "type": "string",
                        "description": "Describe the offer being sold, the problem it solves, and the value delivered. This anchors qualification and outreach."
                    },
                    "idealCustomerProfile": {
                        "title": "Ideal customer profile",
                        "minLength": 20,
                        "maxLength": 3000,
                        "type": "string",
                        "description": "Describe the ideal company: size, sector, geography, operating model, maturity, and buying situation."
                    },
                    "qualificationCriteria": {
                        "title": "Qualification criteria",
                        "minItems": 1,
                        "maxItems": 12,
                        "type": "array",
                        "description": "1-12 concrete, observable conditions. Scores are calculated only from these criteria.",
                        "items": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 300
                        }
                    },
                    "disqualifiers": {
                        "title": "Disqualifiers",
                        "maxItems": 12,
                        "type": "array",
                        "description": "Optional hard exclusions. A supported match caps the lead readiness score.",
                        "items": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 300
                        }
                    },
                    "targetRoles": {
                        "title": "Target roles",
                        "maxItems": 20,
                        "type": "array",
                        "description": "Roles that are relevant to the buying process, used for the contact relevance score.",
                        "items": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 200
                        }
                    },
                    "targetIndustries": {
                        "title": "Target industries",
                        "maxItems": 20,
                        "type": "array",
                        "description": "Optional industry focus used to guide research, not to fabricate a match.",
                        "items": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 200
                        }
                    },
                    "targetCountries": {
                        "title": "Target countries",
                        "maxItems": 20,
                        "type": "array",
                        "description": "Optional target geographies.",
                        "items": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        }
                    },
                    "outreachGoal": {
                        "title": "Outreach goal",
                        "minLength": 10,
                        "maxLength": 500,
                        "type": "string",
                        "description": "The next step the message should seek.",
                        "default": "Start a short discovery conversation."
                    },
                    "aiProvider": {
                        "title": "AI provider",
                        "enum": [
                            "openrouter",
                            "openai",
                            "anthropic",
                            "gemini",
                            "deepseek",
                            "mistral",
                            "groq",
                            "zenmux",
                            "xai",
                            "qwen",
                            "nvidia"
                        ],
                        "type": "string",
                        "description": "Bring your own API key. OpenRouter provides access to hundreds of model/provider combinations through one account; the direct options use each provider API.",
                        "default": "openrouter"
                    },
                    "aiApiKey": {
                        "title": "AI API key",
                        "type": "string",
                        "description": "Optional override. Leave blank to use the provider-specific secret environment variable configured on the Actor (for example OPENAI_API_KEY)."
                    },
                    "model": {
                        "title": "Model override",
                        "maxLength": 300,
                        "type": "string",
                        "description": "Optional exact model identifier. Leave blank to use the provider default. Examples: OpenRouter openrouter/free, Gemini gemini-3.5-flash, DeepSeek deepseek-v4-flash, Qwen qwen-flash, Groq openai/gpt-oss-120b, NVIDIA NIM meta/llama-3.1-70b-instruct. Model IDs are passed through unchanged."
                    },
                    "researchProvider": {
                        "title": "Research provider",
                        "enum": [
                            "website-only",
                            "tavily"
                        ],
                        "type": "string",
                        "description": "Website-only crawls useful pages on the supplied company domain. Tavily also searches the public web.",
                        "default": "website-only"
                    },
                    "researchApiKey": {
                        "title": "Tavily API key",
                        "type": "string",
                        "description": "Optional override. Leave blank to use the secret TAVILY_API_KEY environment variable when Tavily is selected."
                    },
                    "researchDepth": {
                        "title": "Research depth",
                        "enum": [
                            "homepage",
                            "standard",
                            "deep"
                        ],
                        "type": "string",
                        "description": "Homepage fetches one page; Standard crawls up to 4 useful pages; Deep crawls up to 6.",
                        "default": "standard"
                    },
                    "verificationMode": {
                        "title": "Evidence verification",
                        "enum": [
                            "standard",
                            "deep"
                        ],
                        "type": "string",
                        "description": "Standard uses deterministic citation guardrails and one LLM call. Deep adds a second LLM evidence-checking pass.",
                        "default": "deep"
                    },
                    "language": {
                        "title": "Output language",
                        "enum": [
                            "it",
                            "en"
                        ],
                        "type": "string",
                        "description": "Language used for the analysis and outreach copy.",
                        "default": "it"
                    },
                    "messageStyle": {
                        "title": "Outreach style",
                        "enum": [
                            "soft-consultative",
                            "direct",
                            "friendly",
                            "formal"
                        ],
                        "type": "string",
                        "description": "Tone used for the generated outreach.",
                        "default": "soft-consultative"
                    },
                    "maxMessageChars": {
                        "title": "Maximum LinkedIn DM characters",
                        "minimum": 120,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "The generated message is trimmed to this limit.",
                        "default": 300
                    },
                    "includeEmail": {
                        "title": "Generate email too",
                        "type": "boolean",
                        "description": "Generate an email subject and body in addition to the LinkedIn DM.",
                        "default": true
                    },
                    "maxConcurrency": {
                        "title": "Maximum concurrent leads",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Controls speed and provider rate-limit pressure.",
                        "default": 4
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
