> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prontohq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search leads by filters

> Run a lead search with the full set of structured filters and stream enriched leads to your webhook.

Run a full lead search using structured filters. Pronto builds the underlying query for you, creates an asynchronous `Search`, and streams enriched leads to your `webhook_url`.

## Overview

Use this endpoint when you want to extract leads matching a precise persona definition (titles + seniority + function + tenure + company filters + signals). Pronto:

1. Validates and translates your filters into a search URL.
2. Estimates the number of matching profiles.
3. Enqueues the search and returns immediately with a `Search` record.
4. Streams leads to your webhook.

## Requirements

* A valid Sales Navigator **integration** must be connected on the authenticated user — **unless** you pass `live: false`, which serves the search from Pronto's people database and needs no integration.
* `webhook_url` is **required**.
* At least one filter or `keyword` must be provided.

## Live vs. database mode

By default (`live: true`) the search runs in real time through LinkedIn Sales Navigator. Set **`live: false`** to serve the count, preview, and streamed results entirely from Pronto's people database (Elasticsearch) instead — no Sales Navigator integration required.

Relationship and signal filters only exist in LinkedIn's graph, so they are **rejected with `422`** when `live: false`: `connections_of_profile`, `relationship`, `follows_your_company`, `viewed_your_profile`, `with_shared_experiences`, `posted_on_linkedin`, and `past_colleague`. Every other filter works in both modes.

The same `live` flag is accepted by the [preview endpoint](/api-reference/endpoints/leads/advanced_search_preview).

## Rate Limits

* **1 request per second** per user.

## Request body

### Top-level options

| Field         | Type               | Description                                                                                                                                                                                     |
| ------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `webhook_url` | string (HTTPS URL) | **Required.** Where Pronto sends the enriched leads.                                                                                                                                            |
| `live`        | boolean            | Data source. `true` (default) searches LinkedIn Sales Navigator; `false` searches Pronto's people database with no integration required (see [Live vs. database mode](#live-vs-database-mode)). |
| `name`        | string             | Friendly name. Defaults to `Lead search - API - <DD/MM/YYYY HH:MM>`.                                                                                                                            |
| `keyword`     | string             | Free-text keyword. Spell correction is automatically enabled when set.                                                                                                                          |
| `limit`       | integer            | Cap on enriched leads. Effective value is `min(limit, MAX_RESULTS_COUNT)`.                                                                                                                      |
| `streaming`   | boolean            | If `true`, leads are pushed to the webhook as they are scraped. Default `false`.                                                                                                                |
| `scale`       | boolean            | If `true`, skips some data retrieval, for higher volume. Default `false`.                                                                                                                       |
| `custom`      | object             | Arbitrary JSON stored on the search and echoed back in every webhook payload.                                                                                                                   |

### Title filters

| Field                  | Type             | Notes                                                 |
| ---------------------- | ---------------- | ----------------------------------------------------- |
| `job_titles`           | array of strings | Current titles to include (`CURRENT_TITLE` INCLUDED). |
| `excluded_job_titles`  | array of strings | Current titles to exclude (`CURRENT_TITLE` EXCLUDED). |
| `past_titles`          | array of strings | Past titles to include (`PAST_TITLE` INCLUDED).       |
| `excluded_past_titles` | array of strings | Past titles to exclude (`PAST_TITLE` EXCLUDED).       |

### Location filters

| Field                | Type                              |
| -------------------- | --------------------------------- |
| `included_locations` | array of LinkedIn `geoRegion` IDs |
| `excluded_locations` | array of LinkedIn `geoRegion` IDs |

Resolve region names to IDs with the [Location IDs endpoint](/api-reference/endpoints/miscellaneous/location-ids).

### Industry filters

| Field                 | Type                           |
| --------------------- | ------------------------------ |
| `included_industries` | array of LinkedIn industry IDs |
| `excluded_industries` | array of LinkedIn industry IDs |

For the full list of industry IDs see the [LinkedIn Industry List](https://docs.google.com/spreadsheets/d/1qTFPVfcSHnL5PU1AcQlzD8mCmfSICKJ4WuU-OBGhkdI/edit?gid=0#gid=0). Common values:

* `4` Automotive
* `6` Technology, Information and Internet
* `12` Education
* `43` Financial Services
* `96` Software Development

### Company filters

| Field                  | Type                             | Notes                                                                                                                                   |
| ---------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `included_companies`   | array of ids or `{ id }` objects | Current company (`CURRENT_COMPANY` INCLUDED). `id` is the numeric LinkedIn organization id (the integer in `urn:li:organization:<id>`). |
| `excluded_companies`   | array of ids or `{ id }` objects | Current company to exclude (`CURRENT_COMPANY` EXCLUDED).                                                                                |
| `past_companies`       | array of ids or `{ id }` objects | Past company (`PAST_COMPANY` INCLUDED).                                                                                                 |
| `company_headquarters` | array of `geoRegion` IDs         | Filters by the lead's company HQ region (`COMPANY_HEADQUARTERS`).                                                                       |

Each entry can be a plain LinkedIn organization id (string or integer) or an object with an `id` key (e.g. `"1441"`, `1441`, or `{ "id": "1441" }`). Other shapes return `422`.

### Function & seniority

| Field              | Maps to           | Valid IDs                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------ | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `functions`        | `FUNCTION`        | `1` Accounting · `2` Administrative · `3` Arts and Design · `4` Business Development · `5` Community and Social Services · `6` Consulting · `7` Education · `8` Engineering · `9` Entrepreneurship · `10` Finance · `11` Healthcare Services · `12` Human Resources · `13` Information Technology · `14` Legal · `15` Marketing · `16` Media and Communication · `17` Military and Protective Services · `18` Operations · `19` Product Management · `20` Program and Project Management · `21` Purchasing · `22` Quality Assurance · `23` Real Estate · `24` Research · `25` Sales · `26` Customer Success and Support |
| `seniority_levels` | `SENIORITY_LEVEL` | `100` In Training · `110` Entry Level · `120` Senior · `130` Strategic · `200` Entry Level Manager · `210` Experienced Manager · `220` Director · `300` Vice President · `310` CXO · `320` Owner / Partner                                                                                                                                                                                                                                                                                                                                                                                                              |

Multiple IDs are combined with **OR** logic.

### Tenure filters

LinkedIn uses bucketed IDs `"1"`–`"8"` for these filters:

| Field                       | Maps to                     |
| --------------------------- | --------------------------- |
| `years_of_experience`       | `YEARS_OF_EXPERIENCE`       |
| `years_at_current_company`  | `YEARS_AT_CURRENT_COMPANY`  |
| `years_in_current_position` | `YEARS_IN_CURRENT_POSITION` |

Bucket meanings (same scale for all three): `"1"` Less than 1 year · `"2"` 1 to 2 years · `"3"` 3 to 5 years · `"4"` 6 to 10 years · `"5"` More than 10 years. Buckets `"6"`–`"8"` are reserved by LinkedIn.

### Company size & type

| Field          | Maps to             | Valid values (same strings as [account search](/api-reference/endpoints/accounts/search))                                                                    |
| -------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `company_size` | `COMPANY_HEADCOUNT` | `1-10` · `11-50` · `51-200` · `201-500` · `501-1000` · `1001-5000` · `5001-10000` · `10001+` (en-dashes in requests are normalized to hyphens on the server) |
| `company_type` | `COMPANY_TYPE`      | `C` Public Company · `E` Educational Institution · `G` Government Agency · `N` Non-Profit · `P` Privately Held · `S` Self-Employed · `X` Self-Owned          |

### Lists & relationship

| Field                    | Maps to                    | Value type                                                                                    |
| ------------------------ | -------------------------- | --------------------------------------------------------------------------------------------- |
| `included_account_lists` | `ACCOUNT_LIST` (INCLUDED)  | array of account list IDs                                                                     |
| `excluded_account_lists` | `ACCOUNT_LIST` (EXCLUDED)  | array of account list IDs                                                                     |
| `included_lead_lists`    | `LEAD_LIST` (INCLUDED)     | array of lead list IDs                                                                        |
| `excluded_lead_lists`    | `LEAD_LIST` (EXCLUDED)     | array of lead list IDs                                                                        |
| `relationship`           | `RELATIONSHIP`             | array of IDs: `F` 1st degree · `S` 2nd degree · `O` 3rd degree and beyond · `A` Group members |
| `recently_changed_jobs`  | `RECENTLY_CHANGED_JOBS`    | pass `["RPC"]` to enable                                                                      |
| `connections_of_profile` | `CONNECTION_OF` (INCLUDED) | single LinkedIn profile URL — returns 1st-degree connections of that profile                  |

`connections_of_profile` accepts any recognized LinkedIn profile URL:

* `https://www.linkedin.com/in/<handle>`
* `https://www.linkedin.com/in/<internal-urn>`
* `https://www.linkedin.com/sales/lead/<id>`

The server resolves the URL to the target member's internal id via LinkedIn before building the search. Returns `422` if the URL is malformed or can't be resolved.

### Boolean signal filters

These send a single fixed value when truthy. Pass `true` to apply.

| Field                     | Maps to                               |
| ------------------------- | ------------------------------------- |
| `follows_your_company`    | `FOLLOWS_YOUR_COMPANY` (id `CF`)      |
| `viewed_your_profile`     | `VIEW_YOUR_PROFILE` (id `VYP`)        |
| `with_shared_experiences` | `WITH_SHARED_EXPERIENCES` (id `COMM`) |
| `posted_on_linkedin`      | `POSTED_ON_LINKEDIN` (id `RPOL`)      |
| `past_colleague`          | `PAST_COLLEAGUE` (id `CL`)            |

## Response

`201 Created` — returns immediately with the created `Search`:

```json theme={null}
{
  "message": {
    "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
    "search_name": "EU SaaS VPs of Sales",
    "search_url": "https://www.linkedin.com/sales/search/people?query=(filters%3AList(...))",
    "expected_profiles_count": 842,
    "created_at": "2026-05-04T12:34:56Z",
    "custom": { "hubspot_id": "134567" }
  }
}
```

Enriched leads are then POSTed to your `webhook_url` (one-shot at the end of the search, or per-batch when `streaming: true`).

## Errors

| Status                     | When                                                                                                                               |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `400 Bad Request`          | Missing `webhook_url`, invalid webhook URL format, or no filter/keyword provided.                                                  |
| `401 Unauthorized`         | Invalid API key, or credentials missing/expired.                                                                                   |
| `403 Forbidden`            | API key does not have access to this endpoint.                                                                                     |
| `422 Unprocessable Entity` | Invalid filter shape, or enum ID outside the authorized list (e.g. unknown `functions`, `seniority_levels`, `company_size`, etc.). |
| `429 Too Many Requests`    | Per-user rate limit (1 req/s) or upstream LinkedIn rate limit.                                                                     |

## Examples

### EU SaaS VPs of Sales

```json theme={null}
{
  "name": "EU SaaS VPs of Sales",
  "webhook_url": "https://hooks.example.com/leads",
  "limit": 500,
  "streaming": true,
  "job_titles": ["VP of Sales", "Chief Revenue Officer"],
  "seniority_levels": ["300", "310"],
  "functions": ["25"],
  "included_industries": ["96", "4"],
  "included_locations": ["101452733", "105015875"],
  "company_size": ["51-200", "201-500", "501-1000"],
  "years_in_current_position": ["3", "4"],
  "custom": { "hubspot_id": "134567" }
}
```

### Engineering leaders at specific companies who recently changed jobs

```json theme={null}
{
  "name": "Eng leaders — recent movers",
  "webhook_url": "https://hooks.example.com/leads",
  "job_titles": ["VP Engineering", "Head of Engineering"],
  "functions": ["8"],
  "seniority_levels": ["220", "300"],
  "included_companies": ["1441", { "id": "162479" }],
  "recently_changed_jobs": ["RPC"]
}
```

### Target an account list while excluding an existing lead list

```json theme={null}
{
  "webhook_url": "https://hooks.example.com/leads",
  "job_titles": ["Head of Marketing"],
  "included_account_lists": ["12345678"],
  "excluded_lead_lists": ["87654321"]
}
```

### Past colleagues who posted on LinkedIn recently

```json theme={null}
{
  "webhook_url": "https://hooks.example.com/leads",
  "past_colleague": true,
  "posted_on_linkedin": true,
  "included_locations": ["103644278"]
}
```

### Keyword + tenure filter, scale mode

```json theme={null}
{
  "webhook_url": "https://hooks.example.com/leads",
  "keyword": "cybersecurity",
  "years_of_experience": ["4", "5"],
  "company_type": ["P", "C"],
  "scale": true,
  "limit": 1000
}
```

### 1st-degree connections of a target profile

```json theme={null}
{
  "webhook_url": "https://hooks.example.com/leads",
  "connections_of_profile": "https://www.linkedin.com/in/williamhgates",
  "seniority_levels": ["300", "310"],
  "functions": ["25"]
}
```


## OpenAPI

````yaml POST /leads/advanced_search
openapi: 3.0.1
info:
  title: Pronto Accounts API
  description: Pronto Accounts API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.prontohq.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /leads/advanced_search:
    post:
      summary: Search leads by filters
      description: >-
        Run a full lead search using structured filters (titles, locations,
        industries, companies, function, seniority, tenure, company size, type,
        lists, relationship and boolean signals). The endpoint builds the
        underlying query for you, creates an asynchronous `Search`, and streams
        enriched leads to your `webhook_url`.


        At least one filter (or `keyword`) **must** be provided in addition to
        `webhook_url`.


        By default the search runs live through LinkedIn Sales Navigator (`live:
        true`), which requires a connected Sales Navigator integration. Set
        `live: false` to serve the search — count, preview, and the streamed
        results — from Pronto's people database (Elasticsearch) instead, with no
        integration required. See the `live` parameter for the
        relationship/signal filters that database mode does not support.


        **Rate limit:** 1 request per second per user.
      requestBody:
        description: Lead advanced search parameters
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - webhook_url
              properties:
                webhook_url:
                  type: string
                  format: uri
                  description: HTTPS URL that will receive the enriched leads. Required.
                  example: https://hooks.example.com/leads
                live:
                  type: boolean
                  description: >-
                    Data source toggle. `true` (default) runs the search live
                    through LinkedIn Sales Navigator and requires a connected
                    Sales Navigator integration. `false` serves the count,
                    preview, and streamed results from Pronto's people database
                    (Elasticsearch) instead, with no integration required.
                    Relationship/signal filters that only exist in LinkedIn's
                    graph are **not supported** with `live: false` and return
                    `422`: `connections_of_profile`, `relationship`,
                    `follows_your_company`, `viewed_your_profile`,
                    `with_shared_experiences`, `posted_on_linkedin`, and
                    `past_colleague`. A non-boolean value returns `422`.
                  default: true
                  example: true
                name:
                  type: string
                  description: >-
                    Friendly name for the search. Defaults to `Lead search - API
                    - <DD/MM/YYYY HH:MM>` if omitted.
                  example: EU SaaS VPs of Sales
                keyword:
                  type: string
                  description: >-
                    Free-text keyword applied to the LinkedIn `keywords` query
                    parameter. Spell correction is automatically enabled when a
                    keyword is provided.
                  example: cybersecurity
                limit:
                  type: integer
                  description: >-
                    Cap on the number of leads to enrich. The effective limit is
                    `min(limit, MAX_RESULTS_COUNT)`. If omitted, the estimated
                    search size is used.
                  minimum: 1
                  example: 500
                streaming:
                  type: boolean
                  description: >-
                    When `true`, leads are POSTed to `webhook_url` as they are
                    scraped/enriched. When `false`, you receive them once the
                    search completes.
                  default: false
                  example: true
                scale:
                  type: boolean
                  description: >-
                    When set to true, increases request volume by omitting the
                    following fields: connections_count, headline, and vanity
                    LinkedIn profile URL. You will still receive a LinkedIn
                    profile URL, but it will use the user ID instead of the
                    vanity URL (e.g.,
                    https://www.linkedin.com/in/mathieu-brun-picard/)
                  default: false
                  example: false
                custom:
                  type: object
                  description: >-
                    Arbitrary JSON stored on the search and echoed back in every
                    webhook payload (useful for CRM correlation IDs, etc.).
                  additionalProperties: true
                  example:
                    hubspot_id: '134567'
                job_titles:
                  type: array
                  items:
                    type: string
                  description: >-
                    Current job titles to include (`CURRENT_TITLE` INCLUDED).
                    Free text matched against the lead's current title.
                  example:
                    - VP of Sales
                    - Chief Revenue Officer
                excluded_job_titles:
                  type: array
                  items:
                    type: string
                  description: Current job titles to exclude (`CURRENT_TITLE` EXCLUDED).
                  example:
                    - Intern
                    - Contractor
                past_titles:
                  type: array
                  items:
                    type: string
                  description: Past job titles to include (`PAST_TITLE` INCLUDED).
                  example:
                    - Account Executive
                excluded_past_titles:
                  type: array
                  items:
                    type: string
                  description: Past job titles to exclude (`PAST_TITLE` EXCLUDED).
                  example:
                    - SDR
                included_locations:
                  type: array
                  items:
                    type: string
                  description: >-
                    LinkedIn `geoRegion` IDs to include (`REGION` INCLUDED).
                    Resolve names to IDs with the [Location IDs
                    endpoint](/api-reference/endpoints/miscellaneous/location-ids).
                  example:
                    - '101452733'
                    - '105015875'
                excluded_locations:
                  type: array
                  items:
                    type: string
                  description: LinkedIn `geoRegion` IDs to exclude (`REGION` EXCLUDED).
                  example:
                    - '103644278'
                included_industries:
                  type: array
                  items:
                    type: string
                  description: >-
                    LinkedIn industry IDs to include (`INDUSTRY` INCLUDED). See
                    the [LinkedIn Industry
                    List](https://docs.google.com/spreadsheets/d/1qTFPVfcSHnL5PU1AcQlzD8mCmfSICKJ4WuU-OBGhkdI/edit?gid=0#gid=0)
                    for the full mapping. Examples: `"6"` Technology,
                    Information and Internet · `"96"` Software Development ·
                    `"43"` Financial Services.
                  example:
                    - '6'
                    - '96'
                excluded_industries:
                  type: array
                  items:
                    type: string
                  description: LinkedIn industry IDs to exclude (`INDUSTRY` EXCLUDED).
                  example:
                    - '12'
                included_companies:
                  type: array
                  items:
                    oneOf:
                      - type: string
                        description: >-
                          Numeric LinkedIn organization id (the integer in
                          `urn:li:organization:<id>`).
                      - type: integer
                        description: Numeric LinkedIn organization id.
                      - type: object
                        required:
                          - id
                        properties:
                          id:
                            type: string
                            description: >-
                              Numeric LinkedIn organization id (the integer in
                              `urn:li:organization:<id>`).
                  description: >-
                    Companies the lead currently works at (`CURRENT_COMPANY`
                    INCLUDED). Each entry can be a plain LinkedIn organization
                    id (string or integer) or an object with an `id` key.
                  example:
                    - '1441'
                    - id: '162479'
                excluded_companies:
                  type: array
                  items:
                    oneOf:
                      - type: string
                      - type: integer
                      - type: object
                        required:
                          - id
                        properties:
                          id:
                            type: string
                  description: >-
                    Companies to exclude as a current employer
                    (`CURRENT_COMPANY` EXCLUDED). Same shape as
                    `included_companies`.
                  example:
                    - '162479'
                past_companies:
                  type: array
                  items:
                    oneOf:
                      - type: string
                      - type: integer
                      - type: object
                        required:
                          - id
                        properties:
                          id:
                            type: string
                  description: >-
                    Companies the lead worked at in the past (`PAST_COMPANY`
                    INCLUDED). Same shape as `included_companies`.
                  example:
                    - id: '1441'
                company_headquarters:
                  type: array
                  items:
                    type: string
                  description: >-
                    LinkedIn `geoRegion` IDs for the lead's company headquarters
                    (`COMPANY_HEADQUARTERS`).
                  example:
                    - '103644278'
                included_account_lists:
                  type: array
                  items:
                    type: string
                  description: Account list IDs to include (`ACCOUNT_LIST` INCLUDED).
                  example:
                    - '12345678'
                excluded_account_lists:
                  type: array
                  items:
                    type: string
                  description: Account list IDs to exclude (`ACCOUNT_LIST` EXCLUDED).
                  example:
                    - '12345678'
                included_lead_lists:
                  type: array
                  items:
                    type: string
                  description: Lead list IDs to include (`LEAD_LIST` INCLUDED).
                  example:
                    - '87654321'
                excluded_lead_lists:
                  type: array
                  items:
                    type: string
                  description: Lead list IDs to exclude (`LEAD_LIST` EXCLUDED).
                  example:
                    - '87654321'
                functions:
                  type: array
                  items:
                    type: string
                    enum:
                      - '1'
                      - '2'
                      - '3'
                      - '4'
                      - '5'
                      - '6'
                      - '7'
                      - '8'
                      - '9'
                      - '10'
                      - '11'
                      - '12'
                      - '13'
                      - '14'
                      - '15'
                      - '16'
                      - '17'
                      - '18'
                      - '19'
                      - '20'
                      - '21'
                      - '22'
                      - '23'
                      - '24'
                      - '25'
                      - '26'
                  description: >-
                    LinkedIn function (department) IDs (`FUNCTION`). Multiple
                    IDs are combined with OR logic.


                    ID → value: 1 Accounting; 2 Administrative; 3 Arts and
                    Design; 4 Business Development; 5 Community and Social
                    Services; 6 Consulting; 7 Education; 8 Engineering; 9
                    Entrepreneurship; 10 Finance; 11 Healthcare Services; 12
                    Human Resources; 13 Information Technology; 14 Legal; 15
                    Marketing; 16 Media and Communication; 17 Military and
                    Protective Services; 18 Operations; 19 Product Management;
                    20 Program and Project Management; 21 Purchasing; 22 Quality
                    Assurance; 23 Real Estate; 24 Research; 25 Sales; 26
                    Customer Success and Support.
                  example:
                    - '25'
                seniority_levels:
                  type: array
                  items:
                    type: string
                    enum:
                      - '100'
                      - '110'
                      - '120'
                      - '130'
                      - '200'
                      - '210'
                      - '220'
                      - '300'
                      - '310'
                      - '320'
                  description: >-
                    LinkedIn seniority level IDs (`SENIORITY_LEVEL`).


                    ID → value: 100 In Training; 110 Entry Level; 120 Senior;
                    130 Strategic; 200 Entry Level Manager; 210 Experienced
                    Manager; 220 Director; 300 Vice President; 310 CXO; 320
                    Owner / Partner.
                  example:
                    - '300'
                    - '310'
                years_of_experience:
                  type: array
                  items:
                    type: string
                    enum:
                      - '1'
                      - '2'
                      - '3'
                      - '4'
                      - '5'
                      - '6'
                      - '7'
                      - '8'
                  description: >-
                    Bucketed total years of experience (`YEARS_OF_EXPERIENCE`).
                    LinkedIn buckets: `"1"` Less than 1 year, `"2"` 1 to 2
                    years, `"3"` 3 to 5 years, `"4"` 6 to 10 years, `"5"` More
                    than 10 years (additional buckets `"6"`–`"8"` are reserved
                    by LinkedIn).
                  example:
                    - '3'
                    - '4'
                years_at_current_company:
                  type: array
                  items:
                    type: string
                    enum:
                      - '1'
                      - '2'
                      - '3'
                      - '4'
                      - '5'
                      - '6'
                      - '7'
                      - '8'
                  description: >-
                    Bucketed years at the current company
                    (`YEARS_AT_CURRENT_COMPANY`). Same bucket scale as
                    `years_of_experience`.
                  example:
                    - '2'
                    - '3'
                years_in_current_position:
                  type: array
                  items:
                    type: string
                    enum:
                      - '1'
                      - '2'
                      - '3'
                      - '4'
                      - '5'
                      - '6'
                      - '7'
                      - '8'
                  description: >-
                    Bucketed years in the current position
                    (`YEARS_IN_CURRENT_POSITION`). Same bucket scale as
                    `years_of_experience`.
                  example:
                    - '3'
                company_size:
                  type: array
                  items:
                    type: string
                    enum:
                      - 1-10
                      - 11-50
                      - 51-200
                      - 201-500
                      - 501-1000
                      - 1001-5000
                      - 5001-10000
                      - 10001+
                  description: Company size ranges to include.
                  example:
                    - 51-200
                    - 201-500
                    - 501-1000
                company_type:
                  type: array
                  items:
                    type: string
                    enum:
                      - C
                      - E
                      - G
                      - 'N'
                      - P
                      - S
                      - X
                  description: >-
                    LinkedIn company type (`COMPANY_TYPE`).


                    ID → value: `C` Public Company; `E` Educational Institution;
                    `G` Government Agency; `N` Non-Profit; `P` Privately Held;
                    `S` Self-Employed; `X` Self-Owned.
                  example:
                    - P
                    - C
                relationship:
                  type: array
                  items:
                    type: string
                    enum:
                      - F
                      - S
                      - O
                      - A
                  description: >-
                    Connection relationship to the authenticated LinkedIn
                    account (`RELATIONSHIP`).


                    ID → value: `F` 1st degree; `S` 2nd degree; `O` 3rd degree
                    and beyond; `A` Group members.
                  example:
                    - S
                recently_changed_jobs:
                  type: array
                  items:
                    type: string
                    enum:
                      - RPC
                  description: >-
                    Restrict to leads who recently changed jobs
                    (`RECENTLY_CHANGED_JOBS`). Pass `["RPC"]` to enable.
                  example:
                    - RPC
                follows_your_company:
                  type: boolean
                  description: >-
                    When `true`, only include leads who follow your company
                    (`FOLLOWS_YOUR_COMPANY`, id `CF`).
                  default: false
                  example: false
                viewed_your_profile:
                  type: boolean
                  description: >-
                    When `true`, only include leads who viewed your profile
                    (`VIEW_YOUR_PROFILE`, id `VYP`).
                  default: false
                  example: false
                with_shared_experiences:
                  type: boolean
                  description: >-
                    When `true`, only include leads sharing experiences with you
                    (`WITH_SHARED_EXPERIENCES`, id `COMM`).
                  default: false
                  example: false
                posted_on_linkedin:
                  type: boolean
                  description: >-
                    When `true`, only include leads who recently posted on
                    LinkedIn (`POSTED_ON_LINKEDIN`, id `RPOL`).
                  default: false
                  example: true
                past_colleague:
                  type: boolean
                  description: >-
                    When `true`, only include past colleagues (`PAST_COLLEAGUE`,
                    id `CL`).
                  default: false
                  example: false
            example:
              name: EU SaaS VPs of Sales
              webhook_url: https://hooks.example.com/leads
              limit: 500
              streaming: true
              job_titles:
                - VP of Sales
                - Chief Revenue Officer
              seniority_levels:
                - '300'
                - '310'
              functions:
                - '25'
              included_industries:
                - '96'
                - '4'
              included_locations:
                - '101452733'
                - '105015875'
              company_size:
                - 51-200
                - 201-500
                - 501-1000
              years_in_current_position:
                - '3'
                - '4'
              custom:
                hubspot_id: '134567'
      responses:
        '201':
          description: Search created. Results will be delivered to `webhook_url`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: UUID of the created Search.
                      search_name:
                        type: string
                        description: Name of the search.
                      search_url:
                        type: string
                        format: uri
                        description: Sales Navigator URL built from your filters.
                      expected_profiles_count:
                        type: integer
                        description: >-
                          Estimated number of matching profiles before applying
                          `limit`.
                      created_at:
                        type: string
                        format: date-time
                      custom:
                        type: object
                        additionalProperties: true
                        description: Custom attributes echoed back.
              example:
                message:
                  id: 8e1dcba0-f0bb-4071-99fc-f18ba6559ccc
                  search_name: EU SaaS VPs of Sales
                  search_url: >-
                    https://www.linkedin.com/sales/search/people?query=(filters%3AList(...))
                  expected_profiles_count: 842
                  created_at: '2026-05-04T12:34:56Z'
                  custom:
                    hubspot_id: '134567'
        '400':
          description: >-
            Missing `webhook_url`, invalid webhook URL, or no filter / keyword
            provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Unauthorized — invalid API key, or  credentials missing/expired on
            the user account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden — API key does not have access to this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Validation error — a filter has the wrong shape, contains an ID
            outside the authorized list (functions, seniority levels,
            industries, company size, company type, relationship, tenure
            buckets, recently_changed_jobs), `live` is not a boolean, or a
            relationship/signal filter unsupported in database mode was sent
            with `live: false`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded (1 request per second per user).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    defaultApiKey:
      type: apiKey
      in: header
      description: Your API key
      name: X-API-KEY

````