{
  "openapi": "3.0.1",
  "info": {
    "title": "Pipecorn API",
    "description": "All Pipecorn REST endpoints in one document, generated from the fragments in api-reference/specs/. Documentation: https://docs.pipecorn.com",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://app.pipecorn.com/api/v2"
    }
  ],
  "security": [
    {
      "defaultApiKey": []
    }
  ],
  "tags": [
    {
      "name": "Accounts",
      "description": "Pipecorn Accounts API"
    },
    {
      "name": "Alerts",
      "description": "Pipecorn Alerts API"
    },
    {
      "name": "Enrichments",
      "description": "Pipecorn List API"
    },
    {
      "name": "Signals",
      "description": "Pipecorn Accounts API"
    },
    {
      "name": "Leads",
      "description": "Pipecorn Accounts API"
    },
    {
      "name": "List",
      "description": "Pipecorn List API"
    },
    {
      "name": "Miscellaneous",
      "description": "Pipecorn Miscellaneous API"
    },
    {
      "name": "Personas",
      "description": "Pipecorn Personas API"
    },
    {
      "name": "Searches",
      "description": "Pipecorn List API"
    }
  ],
  "paths": {
    "/accounts": {
      "post": {
        "summary": "Extract account search results",
        "description": "Extract company accounts from a LinkedIn Sales Navigator search URL and process them asynchronously.\n\n**Rate limit:** 20 requests per minute, on top of your plan's per-minute request limit\n\nAt most 1000 accounts are extracted per search URL, whatever the `limit` (which accepts 1 to 2500). Split larger searches into several URLs.\n\nThis endpoint creates an import job that will process the search results in the background. Results will be sent to the specified webhook URL when processing is complete.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn Sales Navigator company search URL. Must start with 'https://www.linkedin.com/sales/search/company'",
                    "example": "https://www.linkedin.com/sales/search/company?query=(filters%3AList((type%3AANNUAL_REVENUE%2CrangeValue%3A(min%3A10%2Cmax%3A100)%2CselectedSubFilter%3AUSD)%2C(type%3AINDUSTRY%2Cvalues%3AList((id%3A6%2Ctext%3ATechnologie%252C%2520information%2520et%2520Internet%2CselectionType%3AINCLUDED)))))&sessionId=uYap7SN9RS6itaRp2Vt7Xg%3D%3D&viewAllFilters=true"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name for the import job",
                    "example": "Tech Companies 10M-100M Revenue"
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Webhook URL to receive the processed results",
                    "example": "https://webhook.site/8b53c96f-f2cd-4c24-bc09-b3c2176d7ea8"
                  },
                  "streaming": {
                    "type": "boolean",
                    "description": "Enable streaming mode for real-time results",
                    "default": false,
                    "example": false
                  },
                  "custom": {
                    "type": "object",
                    "description": "Custom attributes to associate with the import",
                    "example": {
                      "source": "api",
                      "campaign": "q1_outreach"
                    }
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of accounts to extract, from 1 to 2500; any other value returns `422`. At most 1000 accounts are extracted from one search URL, so a `limit` above 1000 has no effect.",
                    "example": 100
                  }
                },
                "required": [
                  "search_url",
                  "name",
                  "webhook_url"
                ]
              },
              "example": {
                "search_url": "https://www.linkedin.com/sales/search/company?query=(revenueRange:%22%2410M-%24100M%22%20AND%20employeeCountRange:%2211-50%22%20AND%20industry:%22Technology%2C%20Information%20and%20Internet%22)",
                "name": "Tech Companies 10M-100M Revenue",
                "webhook_url": "https://webhook.site/8b53c96f-f2cd-4c24-bc09-b3c2176d7ea8",
                "streaming": false,
                "limit": 100,
                "custom": {
                  "source": "api",
                  "campaign": "q1_outreach"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Import job created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier for the import job",
                          "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                        },
                        "import_name": {
                          "type": "string",
                          "description": "Name of the import job",
                          "example": "Tech Companies 10M-100M Revenue"
                        },
                        "import_url": {
                          "type": "string",
                          "format": "uri",
                          "description": "The processed search URL used for extraction",
                          "example": "https://www.linkedin.com/sales-api/salesApiLeadSearch?query=(revenueRange:%22%2410M-%24100M%22%20AND%20employeeCountRange:%2211-50%22%20AND%20industry:%22Technology%2C%20Information%20and%20Internet%22)"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Creation timestamp of the import job",
                          "example": "2024-01-15T10:30:00Z"
                        },
                        "limit": {
                          "type": "integer",
                          "description": "Maximum number of companies to import, when `limit` was sent",
                          "example": 500
                        },
                        "custom": {
                          "type": "object",
                          "description": "Custom attributes associated with the import",
                          "example": {
                            "source": "api",
                            "campaign": "q1_outreach"
                          }
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the import: `GET /lists/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                },
                "example": {
                  "message": {
                    "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                    "import_name": "Tech Companies 10M-100M Revenue",
                    "import_url": "https://www.linkedin.com/sales-api/salesApiLeadSearch?query=(revenueRange:%22%2410M-%24100M%22%20AND%20employeeCountRange:%2211-50%22%20AND%20industry:%22Technology%2C%20Information%20and%20Internet%22)",
                    "created_at": "2024-01-15T10:30:00Z",
                    "limit": 500,
                    "custom": {
                      "source": "api",
                      "campaign": "q1_outreach"
                    }
                  },
                  "status_url": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this import, `GET /lists/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "202": {
            "description": "Scale plan only: your company import quota cannot cover the request right now, so it is queued instead of refused. It starts automatically once the quota resets; until then its status URL reports `NOT_STARTED`. The body is the `201` body plus `status` and `notice`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "status_url",
                    "status",
                    "notice"
                  ],
                  "properties": {
                    "message": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier for the import job",
                          "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                        },
                        "import_name": {
                          "type": "string",
                          "description": "Name of the import job",
                          "example": "Tech Companies 10M-100M Revenue"
                        },
                        "import_url": {
                          "type": "string",
                          "format": "uri",
                          "description": "The processed search URL used for extraction",
                          "example": "https://www.linkedin.com/sales-api/salesApiLeadSearch?query=(revenueRange:%22%2410M-%24100M%22%20AND%20employeeCountRange:%2211-50%22%20AND%20industry:%22Technology%2C%20Information%20and%20Internet%22)"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Creation timestamp of the import job",
                          "example": "2024-01-15T10:30:00Z"
                        },
                        "limit": {
                          "type": "integer",
                          "description": "Maximum number of companies to import, when `limit` was sent",
                          "example": 500
                        },
                        "custom": {
                          "type": "object",
                          "description": "Custom attributes associated with the import",
                          "example": {
                            "source": "api",
                            "campaign": "q1_outreach"
                          }
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the import: `GET /lists/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ],
                      "description": "Always `queued`: the request waits for the quota to reset.",
                      "example": "queued"
                    },
                    "notice": {
                      "type": "string",
                      "description": "Why the request is queued.",
                      "example": "Plan limit reached. The request is queued and starts automatically once your quota resets."
                    }
                  }
                },
                "example": {
                  "message": {
                    "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                    "import_name": "Tech Companies 10M-100M Revenue",
                    "import_url": "https://www.linkedin.com/sales-api/salesApiLeadSearch?query=(revenueRange:%22%2410M-%24100M%22%20AND%20employeeCountRange:%2211-50%22%20AND%20industry:%22Technology%2C%20Information%20and%20Internet%22)",
                    "created_at": "2024-01-15T10:30:00Z",
                    "limit": 500,
                    "custom": {
                      "source": "api",
                      "campaign": "q1_outreach"
                    }
                  },
                  "status": "queued",
                  "notice": "Plan limit reached. The request is queued and starts automatically once your quota resets.",
                  "status_url": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this import, `GET /lists/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_required_keys": {
                    "summary": "Missing required keys",
                    "value": {
                      "error": "Missing required keys: search_url, name, webhook_url"
                    }
                  },
                  "invalid_url_format": {
                    "summary": "Invalid URL format",
                    "value": {
                      "error": "Invalid URL format. Please provide a valid LinkedIn company search URL"
                    }
                  },
                  "no_filters": {
                    "summary": "search_url has no filters",
                    "value": {
                      "error": "search_url must contain search filters"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key, or LinkedIn rejected the session of the connected account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  },
                  "linkedin_expired": {
                    "summary": "LinkedIn cookie expired",
                    "value": {
                      "error": "LinkedIn cookie has expired. Please reconnect your LinkedIn account."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "LinkedIn refused access to the search, or the account is closed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "linkedin_forbidden": {
                    "summary": "LinkedIn refused access",
                    "value": {
                      "error": "You don't have access to this LinkedIn resource."
                    }
                  },
                  "account_closed": {
                    "summary": "Account closed",
                    "value": {
                      "error": "Account closed"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Plan limit reached (on the Scale plan the request is queued with `202` instead, unless it is larger than a whole period's quota), or the import could not be saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Can't proceed with the request. Plan limit reached."
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (20 requests per minute, or your plan's per-minute limit), or LinkedIn rate-limited the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "plan_rate_limit": {
                    "summary": "Rate limit exceeded",
                    "value": {
                      "error": "Rate limit exceeded. Please wait before retrying."
                    }
                  },
                  "linkedin_rate_limit": {
                    "summary": "Rate limited by LinkedIn",
                    "value": {
                      "error": "Rate limited by LinkedIn. Please wait a few hours before retrying.",
                      "account_email": "jane@acme.com"
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "502": {
            "description": "LinkedIn failed to answer the search size lookup. Other upstream failures answer their own status (`404`, `503`, `504`) with the same body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "upstream": {
                    "summary": "LinkedIn request failed",
                    "value": {
                      "error": "LinkedIn request failed. Please retry later."
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Accounts"
        ],
        "operationId": "extractAccountSearchResults"
      }
    },
    "/accounts/single_enrich": {
      "post": {
        "summary": "Enrich a single company account",
        "description": "Enrich a single company account with firmographic data.\n\n**Credits:** 1 credit per enrichment. You are only charged when a company is actually resolved — a lookup that matches nothing costs nothing.\n\nIdentify the company with any of `company_linkedin_url` (or `linkedin_url`), `domain` (or `website`) or `name`. The more you provide, the more precisely the account is matched.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn company profile URL (regular or Sales Navigator)",
                    "example": "https://linkedin.com/company/pipecorn"
                  },
                  "linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Alias of `company_linkedin_url`.",
                    "example": "https://linkedin.com/company/pipecorn"
                  },
                  "name": {
                    "type": "string",
                    "description": "Company name",
                    "example": "Pipecorn"
                  },
                  "domain": {
                    "type": "string",
                    "description": "Company website domain",
                    "example": "pipecorn.com"
                  },
                  "website": {
                    "type": "string",
                    "description": "Alias of `domain`. A full URL is accepted and reduced to its origin.",
                    "example": "https://www.pipecorn.com"
                  },
                  "country": {
                    "type": "string",
                    "description": "Two-letter ISO country code (ISO 3166-1 alpha-2). Examples: FR (France), US (United States), GB (United Kingdom), DE (Germany), ES (Spain), IT (Italy)",
                    "example": "FR"
                  },
                  "country_code": {
                    "type": "string",
                    "description": "Alias of `country`. Takes precedence when both are sent.",
                    "example": "FR"
                  },
                  "live": {
                    "type": "boolean",
                    "default": false,
                    "example": false,
                    "description": "Data source. `false` (default) answers from the Pipecorn companies database, with the `AccountEnrichment` fields. `true` looks the company up live on LinkedIn and returns LinkedIn's raw company payload instead (camelCase keys, plus `urn`); it needs a connected Sales Navigator account. A non-boolean value returns `422`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The enriched company, or `{\"data\": null, \"message\": \"No company found\"}` when no company matches (nothing is charged)",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AccountEnrichment"
                    },
                    {
                      "$ref": "#/components/schemas/NoMatch"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_identifier": {
                    "summary": "No identifier",
                    "value": {
                      "error": "Provide at least one of: name, domain, company_linkedin_url"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits for the 1-credit enrichment. Returned before any lookup runs, so nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits left",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "The workspace weekly enrichment credit limit is reached. Buying credits does not lift it, so no `top_up_url` is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceLimitError"
                },
                "example": {
                  "error": "You have reached your weekly enrichment credit limit for this workspace",
                  "code": "workspace_limit_exceeded"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "`live` is not a boolean, or `live: true` and the Sales Navigator connection is missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_live": {
                    "summary": "live is not a boolean",
                    "value": {
                      "error": "Invalid live value. Must be a boolean (true/false)"
                    }
                  },
                  "sales_navigator_expired": {
                    "summary": "Sales Navigator credentials expired (live: true)",
                    "value": {
                      "error": "Sales Navigator credentials expired. Refresh your connection on Pipecorn interface, or set parameter 'live' to false in your request body"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "LinkedIn rate-limited the request (`live: true`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "linkedin_rate_limit": {
                    "summary": "Rate limited by LinkedIn",
                    "value": {
                      "error": "Rate limited by LinkedIn. Please wait a few hours before retrying.",
                      "account_email": "jane@acme.com"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "LinkedIn failed to answer (`live: true`). Other upstream failures answer their own status (`401` for an expired LinkedIn session, `403`, `503`, `504`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "upstream": {
                    "summary": "LinkedIn request failed",
                    "value": {
                      "error": "LinkedIn request failed. Please retry later."
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Accounts"
        ],
        "operationId": "enrichASingleCompanyAccount"
      }
    },
    "/accounts/count_profiles": {
      "post": {
        "summary": "Count matching profiles",
        "description": "Count the profiles of a company, optionally narrowed by LinkedIn function, job titles (or a persona's job titles) and locations. By default the count comes from Pipecorn's people database (`live: false`), with no integration required. Set `live: true` to count live on LinkedIn Sales Navigator instead, which requires a connected Sales Navigator account.\n\n**Credits:** 1 credit per request, with `live: true` or `live: false`. A company that can't be resolved returns `total: 0` and costs nothing.\n\n**Rate limit:** 20 requests per second, on top of your plan's per-minute request limit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "function": {
                    "type": "string",
                    "description": "LinkedIn function id, from `1` to `26` (e.g. `25` for Sales, `8` for Engineering). Only profiles in that function are counted, and the response echoes the function's name in `function`. Any other value returns `422`.",
                    "example": "25"
                  },
                  "persona_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional. UUID of one of your personas (see `GET /personas`). Its included and excluded job titles are counted as `title_to_include` / `title_to_exclude`. With `live: false`, its locations are applied too; its industries and company sizes are always ignored. Cannot be combined with `title_to_include` or `title_to_exclude` (`422`). An unknown persona returns `404`.",
                    "example": "8f2c1b7e-3a4d-4e5f-9a6b-1c2d3e4f5a6b"
                  },
                  "title_to_include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of job titles that were included in the search",
                    "example": [
                      "Software Engineer",
                      "Developer"
                    ]
                  },
                  "title_to_exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of job titles that were excluded from the search",
                    "example": [
                      "Junior"
                    ]
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to include. With `live: true`, LinkedIn Sales Navigator location IDs; with `live: false`, Pipecorn database location IDs (`\"source\": \"database\"` in the Location Ids endpoint). An ID of the other kind returns `422`.",
                    "example": [
                      "country:fr"
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to exclude. With `live: true`, LinkedIn Sales Navigator location IDs; with `live: false`, Pipecorn database location IDs (`\"source\": \"database\"` in the Location Ids endpoint). An ID of the other kind returns `422`.",
                    "example": [
                      "region:fr-11"
                    ]
                  },
                  "live": {
                    "type": "boolean",
                    "description": "Data source toggle. `false` (default) counts in Pipecorn's people database, with no integration required; location IDs then come from the Pipecorn database (Location Ids endpoint with `\"source\": \"database\"`), and a persona's locations are applied as well as its job titles. `true` counts live on LinkedIn Sales Navigator and requires a connected Sales Navigator account. A non-boolean value returns `422`.",
                    "default": false,
                    "example": false
                  }
                },
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "company_linkedin_id"
                    ],
                    "properties": {
                      "company_linkedin_id": {
                        "type": "string",
                        "description": "LinkedIn company identifier",
                        "example": "1234567"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "company_linkedin_url"
                    ],
                    "properties": {
                      "company_linkedin_url": {
                        "type": "string",
                        "format": "uri",
                        "description": "LinkedIn company profile URL (regular or Sales Navigator)",
                        "example": "https://www.linkedin.com/company/microsoft"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully counted matching profiles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "description": "Total number of matching profiles",
                      "example": 26
                    },
                    "function": {
                      "type": "string",
                      "description": "Name of the requested function. Present only when `function` was sent.",
                      "example": "Sales"
                    },
                    "persona_id": {
                      "type": "string",
                      "description": "UUID of the persona applied. Present only when `persona_id` was sent; its job titles are echoed in `title_to_include` and `title_to_exclude`.",
                      "example": "8f2c1b7e-3a4d-4e5f-9a6b-1c2d3e4f5a6b"
                    },
                    "title_to_include": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "List of job titles that were included in the search",
                      "example": [
                        "Software Engineer",
                        "Developer"
                      ]
                    },
                    "title_to_exclude": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "List of job titles that were excluded from the search",
                      "example": [
                        "Junior"
                      ]
                    },
                    "included_locations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "List of Location IDs that were included in the search",
                      "example": [
                        "country:fr"
                      ]
                    },
                    "excluded_locations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "List of Location IDs that were excluded from the search",
                      "example": [
                        "region:fr-11"
                      ]
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_company": {
                    "summary": "No company identifier",
                    "value": {
                      "error": "Either company_linkedin_url or company_linkedin_id must be provided"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits for the 1-credit count. Returned before any count runs, so nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits left",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Invalid `function` or array parameter, plan limit reached, or the Sales Navigator connection is missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_function": {
                    "summary": "Unknown function id",
                    "value": {
                      "error": "Invalid function. Should be between 1 and 26"
                    }
                  },
                  "invalid_titles": {
                    "summary": "Titles are not arrays",
                    "value": {
                      "error": "title_to_include and title_to_exclude must be arrays"
                    }
                  },
                  "invalid_locations": {
                    "summary": "Locations are not arrays",
                    "value": {
                      "error": "included_locations and excluded_locations must be arrays"
                    }
                  },
                  "sales_navigator_expired": {
                    "summary": "Sales Navigator credentials expired",
                    "value": {
                      "error": "Sales Navigator credentials expired. Refresh your connection on Pipecorn interface"
                    }
                  },
                  "plan_limit": {
                    "summary": "Plan limit reached",
                    "value": {
                      "error": "Can't proceed with the request. Plan limit reached."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (20 requests per second, or your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Accounts"
        ],
        "operationId": "countMatchingProfiles"
      }
    },
    "/accounts/search": {
      "post": {
        "summary": "Search accounts by filters",
        "description": "Search and extract company accounts based on industry, location, size, and keyword filters. This endpoint processes results asynchronously and sends them to your webhook.\n\nBy default the search runs live through LinkedIn Sales Navigator (`live: true`), which requires a connected Sales Navigator integration. Set `live: false` to serve everything from Pipecorn's companies database (Elasticsearch) instead, with no integration required.\n\n**Rate limit:** your plan's per-minute request limit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Webhook URL (`http` or `https`) to receive the processed results",
                    "example": "https://webhook.site/8b53c96f-f2cd-4c24-bc09-b3c2176d7ea8"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name for the import job",
                    "example": "Tech Companies in US"
                  },
                  "included_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of industry IDs to include in the search",
                    "example": [
                      "4",
                      "6",
                      "96"
                    ]
                  },
                  "excluded_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of industry IDs to exclude from the search",
                    "example": [
                      "12"
                    ]
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of location IDs to include in the search. Use the /locations endpoint to get valid location IDs",
                    "example": [
                      "103644278",
                      "105015875"
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of location IDs to exclude from the search",
                    "example": [
                      "102221843"
                    ]
                  },
                  "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": [
                      "11-50",
                      "51-200"
                    ]
                  },
                  "keyword": {
                    "type": "string",
                    "description": "Keyword to search for in company names or descriptions",
                    "example": "saas"
                  },
                  "min_revenue": {
                    "type": "number",
                    "description": "Minimum annual revenue in millions. Valid values: 0, 0.5, 1, 2.5, 5, 10, 20, 50, 100, 500, 1000",
                    "enum": [
                      0,
                      0.5,
                      1,
                      2.5,
                      5,
                      10,
                      20,
                      50,
                      100,
                      500,
                      1000
                    ],
                    "example": 10
                  },
                  "max_revenue": {
                    "type": "number",
                    "description": "Maximum annual revenue in millions. Valid values: 0.5, 1, 2.5, 5, 10, 20, 50, 100, 500, 1000, 1001 (where 1001 represents $1B+)",
                    "enum": [
                      0.5,
                      1,
                      2.5,
                      5,
                      10,
                      20,
                      50,
                      100,
                      500,
                      1000,
                      1001
                    ],
                    "example": 50
                  },
                  "revenue_currency": {
                    "type": "string",
                    "description": "Currency code for revenue values. Defaults to USD if not specified",
                    "enum": [
                      "USD",
                      "EUR",
                      "GBP",
                      "CAD",
                      "AUD",
                      "JPY",
                      "CNY",
                      "INR",
                      "BRL",
                      "SEK",
                      "NOK",
                      "DKK",
                      "SGD",
                      "HKD",
                      "NZD",
                      "THB",
                      "IDR",
                      "TRY",
                      "TWD",
                      "ILS",
                      "AED",
                      "RUB"
                    ],
                    "default": "USD",
                    "example": "USD"
                  },
                  "company_types": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "Public Company",
                        "Privately Held",
                        "Non Profit",
                        "Educational Institution",
                        "Partnership",
                        "Self-Employed",
                        "Self Owned",
                        "Government Agency"
                      ]
                    },
                    "description": "Company types to include. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": [
                      "Privately Held"
                    ]
                  },
                  "business_models": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "saas"
                      ]
                    },
                    "description": "Business models to include. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": [
                      "saas"
                    ]
                  },
                  "min_headcount": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Minimum number of employees. A custom range set with `min_headcount`/`max_headcount` replaces `company_size`. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 20
                  },
                  "max_headcount": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Maximum number of employees. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 80
                  },
                  "min_year_founded": {
                    "type": "integer",
                    "description": "Founded in or after this year. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 2015
                  },
                  "max_year_founded": {
                    "type": "integer",
                    "description": "Founded in or before this year. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 2022
                  },
                  "last_funding_within_days": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Last funding round raised within this many days (the app offers 30, 90 and 365). Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 365
                  },
                  "min_last_funding_amount": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Minimum size of the last funding round, in USD millions. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 5
                  },
                  "max_last_funding_amount": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Maximum size of the last funding round, in USD millions. `1001` means no upper bound. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 50
                  },
                  "headcount_growth_period": {
                    "type": "string",
                    "enum": [
                      "mom",
                      "qoq",
                      "six_months",
                      "yoy"
                    ],
                    "default": "yoy",
                    "description": "Window the headcount growth filters measure over: month, quarter, six months or year. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`."
                  },
                  "min_headcount_growth": {
                    "type": "number",
                    "description": "Minimum company headcount growth over `headcount_growth_period`, in percent. Can be negative. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 10
                  },
                  "max_headcount_growth": {
                    "type": "number",
                    "description": "Maximum company headcount growth over `headcount_growth_period`, in percent. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 50
                  },
                  "department_headcounts": {
                    "type": "array",
                    "description": "Headcount rules per department, e.g. at least 10 people in Sales. A rule with no bounds keeps companies that have the department. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "items": {
                      "type": "object",
                      "required": [
                        "department"
                      ],
                      "properties": {
                        "department": {
                          "type": "string",
                          "enum": [
                            "Accounting",
                            "Administrative",
                            "Arts and Design",
                            "Business Development",
                            "Community and Social Services",
                            "Consulting",
                            "Customer Success and Support",
                            "Education",
                            "Engineering",
                            "Entrepreneurship",
                            "Finance",
                            "Healthcare Services",
                            "Human Resources",
                            "Information Technology",
                            "Legal",
                            "Marketing",
                            "Media and Communication",
                            "Military and Protective Services",
                            "Operations",
                            "Product Management",
                            "Program and Project Management",
                            "Purchasing",
                            "Quality Assurance",
                            "Real Estate",
                            "Research",
                            "Sales"
                          ],
                          "description": "Department name (case-insensitive)"
                        },
                        "min": {
                          "type": "number",
                          "description": "Lower bound, inclusive. Omit for no lower bound"
                        },
                        "max": {
                          "type": "number",
                          "description": "Upper bound, inclusive. Omit for no upper bound"
                        }
                      }
                    }
                  },
                  "department_headcount_match": {
                    "type": "string",
                    "enum": [
                      "all",
                      "any"
                    ],
                    "default": "all",
                    "description": "Whether every `department_headcounts` rule must hold (`all`) or at least one (`any`). Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`."
                  },
                  "department_growths": {
                    "type": "array",
                    "description": "Headcount growth rules per department, in percent over `headcount_growth_period`. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "items": {
                      "type": "object",
                      "required": [
                        "department"
                      ],
                      "properties": {
                        "department": {
                          "type": "string",
                          "enum": [
                            "Accounting",
                            "Administrative",
                            "Arts and Design",
                            "Business Development",
                            "Community and Social Services",
                            "Consulting",
                            "Customer Success and Support",
                            "Education",
                            "Engineering",
                            "Entrepreneurship",
                            "Finance",
                            "Healthcare Services",
                            "Human Resources",
                            "Information Technology",
                            "Legal",
                            "Marketing",
                            "Media and Communication",
                            "Military and Protective Services",
                            "Operations",
                            "Product Management",
                            "Program and Project Management",
                            "Purchasing",
                            "Quality Assurance",
                            "Real Estate",
                            "Research",
                            "Sales"
                          ],
                          "description": "Department name (case-insensitive)"
                        },
                        "min": {
                          "type": "number",
                          "description": "Lower bound, inclusive. Omit for no lower bound"
                        },
                        "max": {
                          "type": "number",
                          "description": "Upper bound, inclusive. Omit for no upper bound"
                        }
                      }
                    }
                  },
                  "department_growth_match": {
                    "type": "string",
                    "enum": [
                      "all",
                      "any"
                    ],
                    "default": "all",
                    "description": "Whether every `department_growths` rule must hold (`all`) or at least one (`any`). Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`."
                  },
                  "min_monthly_visitors": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Minimum monthly website visitors. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 10000
                  },
                  "max_monthly_visitors": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Maximum monthly website visitors. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`."
                  },
                  "monthly_visitor_growth_period": {
                    "type": "string",
                    "enum": [
                      "mom",
                      "qoq"
                    ],
                    "default": "mom",
                    "description": "Window the website traffic growth filters measure over: month or quarter. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`."
                  },
                  "min_monthly_visitor_growth": {
                    "type": "number",
                    "description": "Minimum website traffic growth over `monthly_visitor_growth_period`, in percent. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": 20
                  },
                  "max_monthly_visitor_growth": {
                    "type": "number",
                    "description": "Maximum website traffic growth over `monthly_visitor_growth_period`, in percent. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`."
                  },
                  "included_company_lists": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Only return companies saved in these company lists (ids from `GET /lists`). An unknown id answers `422`. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`."
                  },
                  "excluded_company_lists": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "Leave out companies saved in these company lists (ids from `GET /lists`). An unknown id answers `422`. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`."
                  },
                  "competitors_of": {
                    "type": "array",
                    "maxItems": 10,
                    "items": {
                      "type": "string"
                    },
                    "description": "Only return the competitors (organic and paid search) of these companies, given as LinkedIn company ids. Up to 10. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": [
                      "104885158"
                    ]
                  },
                  "with_job_titles": {
                    "type": "array",
                    "maxItems": 25,
                    "items": {
                      "type": "string"
                    },
                    "description": "Only return companies where someone currently holds one of these job titles. Titles match like `job_titles` on lead search: `CTO` also finds `CTO & Co-Founder`; put a title in quotes (`\"Owner\"`) for an exact match. Up to 25. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": [
                      "Head of Sales"
                    ]
                  },
                  "without_job_titles": {
                    "type": "array",
                    "maxItems": 25,
                    "items": {
                      "type": "string"
                    },
                    "description": "Only return companies where no one currently holds any of these job titles. Same matching as `with_job_titles`. Up to 25. Requires `live: false` (Pipecorn database); with `live: true` the request answers `422`.",
                    "example": [
                      "CTO"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of accounts to extract: a positive integer. Values above 1000 are capped at 1000 (default: 1000)",
                    "example": 100
                  },
                  "streaming": {
                    "type": "boolean",
                    "description": "Enable streaming mode for real-time results",
                    "default": false,
                    "example": false
                  },
                  "live": {
                    "type": "boolean",
                    "description": "Data source toggle. `true` (default) searches live through LinkedIn Sales Navigator and requires a connected Sales Navigator integration. `false` serves the count, preview, and extracted accounts from Pipecorn's companies database (Elasticsearch) instead, with no integration required. A non-boolean value returns `422`.",
                    "default": true,
                    "example": true
                  }
                },
                "required": [
                  "webhook_url"
                ]
              },
              "example": {
                "webhook_url": "https://webhook.site/8b53c96f-f2cd-4c24-bc09-b3c2176d7ea8",
                "name": "Tech Companies in US",
                "included_industries": [
                  "6"
                ],
                "excluded_industries": [
                  "12"
                ],
                "included_locations": [
                  "103644278"
                ],
                "company_size": [
                  "51-200",
                  "201-500"
                ],
                "keyword": "saas",
                "min_revenue": 10,
                "max_revenue": 100,
                "revenue_currency": "USD",
                "limit": 500,
                "streaming": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Account search started successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Account search started successfully. You will receive the results on your webhook shortly."
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the import job",
                      "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    },
                    "total": {
                      "type": "integer",
                      "description": "Total number of accounts that will be processed",
                      "example": 342
                    },
                    "preview": {
                      "type": "array",
                      "description": "Preview of the first 10 matching accounts With `live: false`, each account also carries its location, domain, website, description, headcount, company type, founding year and business models.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "company_name": {
                            "type": "string",
                            "example": "Pipecorn"
                          },
                          "industry": {
                            "type": "string",
                            "example": "Technology, Information and Internet"
                          },
                          "linkedin_id": {
                            "type": "string",
                            "example": "104885158"
                          },
                          "linkedin_url": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://www.linkedin.com/company/104885158"
                          },
                          "location": {
                            "type": "string",
                            "description": "Headquarters location. `live: false` only",
                            "example": "Paris, France"
                          },
                          "domain": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "pipecorn.com"
                          },
                          "website": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "https://pipecorn.com"
                          },
                          "description": {
                            "type": "string",
                            "description": "`live: false` only"
                          },
                          "employee_count": {
                            "type": "integer",
                            "description": "`live: false` only",
                            "example": 12
                          },
                          "employee_range": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "11-50"
                          },
                          "company_type": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "Privately Held"
                          },
                          "year_founded": {
                            "type": "integer",
                            "description": "`live: false` only",
                            "example": 2024
                          },
                          "business_models": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "`live: false` only",
                            "example": [
                              "saas"
                            ]
                          }
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the import: `GET /lists/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                },
                "example": {
                  "message": "Account search started successfully. You will receive the results on your webhook shortly.",
                  "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                  "total": 342,
                  "preview": [
                    {
                      "company_name": "Pipecorn",
                      "industry": "Technology, Information and Internet",
                      "linkedin_id": "104885158",
                      "linkedin_url": "https://www.linkedin.com/company/104885158"
                    }
                  ],
                  "status_url": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this import, `GET /lists/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "202": {
            "description": "Scale plan only: your company import quota cannot cover the request right now, so it is queued instead of refused. It starts automatically once the quota resets; until then its status URL reports `NOT_STARTED`. The body is the `201` body plus `status` and `notice`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Account search started successfully. You will receive the results on your webhook shortly."
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "Unique identifier for the import job",
                      "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    },
                    "total": {
                      "type": "integer",
                      "description": "Total number of accounts that will be processed",
                      "example": 342
                    },
                    "preview": {
                      "type": "array",
                      "description": "Preview of the first 10 matching accounts With `live: false`, each account also carries its location, domain, website, description, headcount, company type, founding year and business models.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "company_name": {
                            "type": "string",
                            "example": "Pipecorn"
                          },
                          "industry": {
                            "type": "string",
                            "example": "Technology, Information and Internet"
                          },
                          "linkedin_id": {
                            "type": "string",
                            "example": "104885158"
                          },
                          "linkedin_url": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://www.linkedin.com/company/104885158"
                          },
                          "location": {
                            "type": "string",
                            "description": "Headquarters location. `live: false` only",
                            "example": "Paris, France"
                          },
                          "domain": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "pipecorn.com"
                          },
                          "website": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "https://pipecorn.com"
                          },
                          "description": {
                            "type": "string",
                            "description": "`live: false` only"
                          },
                          "employee_count": {
                            "type": "integer",
                            "description": "`live: false` only",
                            "example": 12
                          },
                          "employee_range": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "11-50"
                          },
                          "company_type": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "Privately Held"
                          },
                          "year_founded": {
                            "type": "integer",
                            "description": "`live: false` only",
                            "example": 2024
                          },
                          "business_models": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "`live: false` only",
                            "example": [
                              "saas"
                            ]
                          }
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the import: `GET /lists/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ],
                      "description": "Always `queued`: the request waits for the quota to reset.",
                      "example": "queued"
                    },
                    "notice": {
                      "type": "string",
                      "description": "Why the request is queued.",
                      "example": "Plan limit reached. The request is queued and starts automatically once your quota resets."
                    }
                  }
                },
                "example": {
                  "message": "Account search started successfully. You will receive the results on your webhook shortly.",
                  "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                  "total": 342,
                  "preview": [
                    {
                      "company_name": "Pipecorn",
                      "industry": "Technology, Information and Internet",
                      "linkedin_id": "104885158",
                      "linkedin_url": "https://www.linkedin.com/company/104885158"
                    }
                  ],
                  "status": "queued",
                  "notice": "Plan limit reached. The request is queued and starts automatically once your quota resets.",
                  "status_url": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this import, `GET /lists/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Missing webhook URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_webhook": {
                    "summary": "Missing webhook URL",
                    "value": {
                      "error": "webhook_url key is required in your payload"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Invalid API key"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Invalid filter values (company size, locations, revenue), a `limit` that is not a positive integer, a `webhook_url` that is not an http(s) URL, or plan limit reached (on the Scale plan the request is queued with `202` instead, unless it is larger than a whole period's quota)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_company_size": {
                    "summary": "Invalid company size",
                    "value": {
                      "error": "Invalid company_size values",
                      "invalid_sizes": [
                        "10-50"
                      ],
                      "valid_formats": [
                        "Self-employed",
                        "1-10",
                        "11-50",
                        "51-200",
                        "201-500",
                        "501-1000",
                        "1001-5000",
                        "5001-10000",
                        "10001+"
                      ]
                    }
                  },
                  "invalid_location": {
                    "summary": "Invalid location format",
                    "value": {
                      "error": "Invalid location format",
                      "message": "Locations must be provided as an array of ids",
                      "example": [
                        "123"
                      ]
                    }
                  },
                  "invalid_min_revenue": {
                    "summary": "Invalid min_revenue value",
                    "value": {
                      "error": "Invalid min_revenue value",
                      "message": "min_revenue must be one of: 0, 0.5, 1, 2.5, 5, 10, 20, 50, 100, 500, 1000",
                      "valid_values": [
                        0,
                        0.5,
                        1,
                        2.5,
                        5,
                        10,
                        20,
                        50,
                        100,
                        500,
                        1000
                      ]
                    }
                  },
                  "invalid_max_revenue": {
                    "summary": "Invalid max_revenue value",
                    "value": {
                      "error": "Invalid max_revenue value",
                      "message": "max_revenue must be one of: 0.5, 1, 2.5, 5, 10, 20, 50, 100, 500, 1000, 1001",
                      "valid_values": [
                        0.5,
                        1,
                        2.5,
                        5,
                        10,
                        20,
                        50,
                        100,
                        500,
                        1000,
                        1001
                      ]
                    }
                  },
                  "invalid_revenue_currency": {
                    "summary": "Invalid revenue_currency",
                    "value": {
                      "error": "Invalid revenue_currency",
                      "message": "revenue_currency must be one of: USD, AED, AUD, BRL, CAD, CNY, DKK, EUR, GBP, HKD, IDR, ILS, INR, JPY, NOK, NZD, RUB, SEK, SGD, THB, TRY, TWD",
                      "valid_currencies": [
                        "USD",
                        "AED",
                        "AUD",
                        "BRL",
                        "CAD",
                        "CNY",
                        "DKK",
                        "EUR",
                        "GBP",
                        "HKD",
                        "IDR",
                        "ILS",
                        "INR",
                        "JPY",
                        "NOK",
                        "NZD",
                        "RUB",
                        "SEK",
                        "SGD",
                        "THB",
                        "TRY",
                        "TWD"
                      ]
                    }
                  },
                  "invalid_limit": {
                    "summary": "limit is not a whole number",
                    "value": {
                      "error": "Limit must be an integer"
                    }
                  },
                  "limit_not_positive": {
                    "summary": "limit is 0 or negative",
                    "value": {
                      "error": "Limit must be greater than 0"
                    }
                  },
                  "invalid_webhook_url": {
                    "summary": "webhook_url is not an http(s) URL",
                    "value": {
                      "error": "Invalid webhook_url format"
                    }
                  },
                  "plan_limit": {
                    "summary": "Plan limit reached",
                    "value": {
                      "error": "Can't proceed with the request. Plan limit reached."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Accounts"
        ],
        "operationId": "searchAccountsByFilters"
      }
    },
    "/accounts/search/preview": {
      "post": {
        "summary": "Preview",
        "description": "Run the same filters as `POST /accounts/search` and return a synchronous preview: the total estimated account count plus the first 25 matching companies. No `Import` is created, no webhook is called, and no credits are consumed.\n\nThis is intended for UI previews, filter validation, and audience sizing before kicking off the real search. Unlike `POST /accounts/search`, **`webhook_url` is not required**.\n\n**Rate limit:** your plan's per-minute request limit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Accepts the same filter object as `POST /accounts/search` (`included_industries`, `excluded_industries`, `included_locations`, `excluded_locations`, `company_size`, `keyword`, `min_revenue`, `max_revenue`, `revenue_currency`, etc.), including `live` (default `true`) to preview from Pipecorn's companies database instead of LinkedIn Sales Navigator. `webhook_url`, `name`, `limit`, and `streaming` are accepted but ignored — the response is always the first 25 results.",
                "additionalProperties": true
              },
              "example": {
                "included_industries": [
                  "6",
                  "96"
                ],
                "included_locations": [
                  "103644278"
                ],
                "company_size": [
                  "51-200",
                  "201-500"
                ],
                "keyword": "saas"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview generated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total_count": {
                      "type": "integer",
                      "description": "Estimated total number of accounts matching the filters (not capped to 25)."
                    },
                    "preview": {
                      "type": "array",
                      "description": "Up to 25 matching accounts. With `live: false`, each account also carries its location, domain, website, description, headcount, company type, founding year and business models.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "company_name": {
                            "type": "string",
                            "example": "Pipecorn"
                          },
                          "industry": {
                            "type": "string",
                            "example": "Technology, Information and Internet"
                          },
                          "linkedin_id": {
                            "type": "string",
                            "example": "104885158"
                          },
                          "linkedin_url": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://www.linkedin.com/company/104885158"
                          },
                          "location": {
                            "type": "string",
                            "description": "Headquarters location. `live: false` only",
                            "example": "Paris, France"
                          },
                          "domain": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "pipecorn.com"
                          },
                          "website": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "https://pipecorn.com"
                          },
                          "description": {
                            "type": "string",
                            "description": "`live: false` only"
                          },
                          "employee_count": {
                            "type": "integer",
                            "description": "`live: false` only",
                            "example": 12
                          },
                          "employee_range": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "11-50"
                          },
                          "company_type": {
                            "type": "string",
                            "description": "`live: false` only",
                            "example": "Privately Held"
                          },
                          "year_founded": {
                            "type": "integer",
                            "description": "`live: false` only",
                            "example": 2024
                          },
                          "business_models": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "`live: false` only",
                            "example": [
                              "saas"
                            ]
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "total_count": 4321,
                  "preview": [
                    {
                      "company_name": "Pipecorn",
                      "industry": "Technology, Information and Internet",
                      "linkedin_id": "104885158",
                      "linkedin_url": "https://www.linkedin.com/company/104885158"
                    }
                  ]
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "description": "Unauthorized — invalid API key or missing credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Invalid filter shape or value (company size, location, industry, revenue, etc.), or (with `live: true`) the Sales Navigator connection is expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Accounts"
        ],
        "operationId": "preview"
      }
    },
    "/accounts/headcount": {
      "post": {
        "summary": "Get company headcount by department",
        "description": "Retrieve headcount information for specified departments or all departments if none specified.\n\nBy default the data comes from Pipecorn's companies database (`live: false`), with no integration required: a current snapshot per department, without evolution, in this shape:\n\n```json\n{\n  \"total_headcount\": 18769,\n  \"departments\": {\n    \"Engineering\": { \"current_headcount\": 8681 },\n    \"Sales\": { \"current_headcount\": 6258 }\n  }\n}\n```\n\nSet `live: true` to get the data live from LinkedIn instead, with 3/6/12-month evolution per department as documented below. It requires a connected Sales Navigator account.\n\n**Credits:** 1 credit per request. A lookup that matches no company costs nothing.\n\n**Rate limit:** 20 requests per second, on top of your plan's per-minute request limit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "departments": {
                    "type": "array",
                    "example": [
                      "Engineering",
                      "Sales",
                      "Finance"
                    ],
                    "items": {
                      "type": "string",
                      "enum": [
                        "Accounting",
                        "Administrative",
                        "Arts and Design",
                        "Business Development",
                        "Community and Social Services",
                        "Consulting",
                        "Customer Success and Support",
                        "Education",
                        "Engineering",
                        "Entrepreneurship",
                        "Finance",
                        "Healthcare Services",
                        "Human Resources",
                        "Information Technology",
                        "Legal",
                        "Marketing",
                        "Media and Communication",
                        "Military and Protective Services",
                        "Operations",
                        "Product Management",
                        "Program and Project Management",
                        "Purchasing",
                        "Quality Assurance",
                        "Real Estate",
                        "Research",
                        "Sales"
                      ]
                    },
                    "description": "List of departments to get headcount for. If not provided, returns data for all departments."
                  },
                  "live": {
                    "type": "boolean",
                    "description": "Data source toggle. `false` (default) answers from Pipecorn's companies database (Elasticsearch), with no integration required, returning a current headcount snapshot (`total_headcount` plus `departments` with `current_headcount`) without evolution data. `true` returns the live department headcount with 3/6/12-month evolution from LinkedIn and requires a connected Sales Navigator account. A non-boolean value returns `422`.",
                    "default": false,
                    "example": false
                  }
                },
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "company_linkedin_id"
                    ],
                    "properties": {
                      "company_linkedin_id": {
                        "type": "string",
                        "description": "LinkedIn company identifier",
                        "example": "1818"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "company_linkedin_url"
                    ],
                    "properties": {
                      "company_linkedin_url": {
                        "type": "string",
                        "format": "uri",
                        "description": "LinkedIn company profile URL (regular or Sales Navigator)",
                        "example": "https://www.linkedin.com/company/microsoft"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully retrieved headcount data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "3_months_evolution": {
                        "type": "object",
                        "properties": {
                          "base_headcount": {
                            "type": "integer",
                            "description": "Base headcount value"
                          },
                          "current_headcount": {
                            "type": "integer",
                            "description": "Current headcount value"
                          },
                          "headcount_gain": {
                            "type": "integer",
                            "description": "Headcount gain"
                          },
                          "headcount_gain_percentage": {
                            "type": "integer",
                            "description": "Headcount gain percentage"
                          }
                        }
                      },
                      "6_months_evolution": {
                        "type": "object",
                        "properties": {
                          "base_headcount": {
                            "type": "integer",
                            "description": "Base headcount value"
                          },
                          "current_headcount": {
                            "type": "integer",
                            "description": "Current headcount value"
                          },
                          "headcount_gain": {
                            "type": "integer",
                            "description": "Headcount gain"
                          },
                          "headcount_gain_percentage": {
                            "type": "integer",
                            "description": "Headcount gain percentage"
                          }
                        },
                        "nullable": true,
                        "description": "`null` when LinkedIn has no data for this department over the period."
                      },
                      "12_months_evolution": {
                        "type": "object",
                        "properties": {
                          "base_headcount": {
                            "type": "integer",
                            "description": "Base headcount value"
                          },
                          "current_headcount": {
                            "type": "integer",
                            "description": "Current headcount value"
                          },
                          "headcount_gain": {
                            "type": "integer",
                            "description": "Headcount gain"
                          },
                          "headcount_gain_percentage": {
                            "type": "integer",
                            "description": "Headcount gain percentage"
                          }
                        },
                        "nullable": true,
                        "description": "`null` when LinkedIn has no data for this department over the period."
                      }
                    }
                  }
                },
                "example": {
                  "Engineering": {
                    "3_months_evolution": {
                      "base_headcount": 8611,
                      "current_headcount": 8681,
                      "headcount_gain": 70,
                      "headcount_gain_percentage": 1
                    },
                    "6_months_evolution": {
                      "base_headcount": 8412,
                      "current_headcount": 8681,
                      "headcount_gain": 269,
                      "headcount_gain_percentage": 3
                    },
                    "12_months_evolution": {
                      "base_headcount": 8153,
                      "current_headcount": 8681,
                      "headcount_gain": 528,
                      "headcount_gain_percentage": 6
                    }
                  },
                  "Finance": {
                    "3_months_evolution": {
                      "base_headcount": 2801,
                      "current_headcount": 2830,
                      "headcount_gain": 29,
                      "headcount_gain_percentage": 1
                    },
                    "6_months_evolution": {
                      "base_headcount": 2774,
                      "current_headcount": 2830,
                      "headcount_gain": 56,
                      "headcount_gain_percentage": 2
                    },
                    "12_months_evolution": {
                      "base_headcount": 2659,
                      "current_headcount": 2830,
                      "headcount_gain": 171,
                      "headcount_gain_percentage": 6
                    }
                  },
                  "Sales": {
                    "3_months_evolution": {
                      "base_headcount": 6130,
                      "current_headcount": 6258,
                      "headcount_gain": 128,
                      "headcount_gain_percentage": 2
                    },
                    "6_months_evolution": {
                      "base_headcount": 5914,
                      "current_headcount": 6258,
                      "headcount_gain": 344,
                      "headcount_gain_percentage": 6
                    },
                    "12_months_evolution": {
                      "base_headcount": 5549,
                      "current_headcount": 6258,
                      "headcount_gain": 709,
                      "headcount_gain_percentage": 13
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Invalid request: unknown departments, or neither `company_linkedin_id` nor `company_linkedin_url` provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Invalid departments",
                  "details": {
                    "invalid_departments": [
                      "Engineers"
                    ],
                    "valid_departments": [
                      "Accounting",
                      "Administrative",
                      "Arts and Design",
                      "Business Development",
                      "Community and Social Services",
                      "Consulting",
                      "Education",
                      "Engineering",
                      "Entrepreneurship",
                      "Finance",
                      "Healthcare Services",
                      "Human Resources",
                      "Information Technology",
                      "Legal",
                      "Marketing",
                      "Media and Communication",
                      "Military and Protective Services",
                      "Operations",
                      "Product Management",
                      "Program and Project Management",
                      "Purchasing",
                      "Quality Assurance",
                      "Real Estate",
                      "Research",
                      "Sales",
                      "Customer Success and Support"
                    ]
                  },
                  "message": "Please use only valid department values from the provided list."
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits for the 1-credit headcount lookup. Returned before any lookup runs, so nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits left",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "404": {
            "description": "No company matches the `company_linkedin_id` or `company_linkedin_url` (`live: false`: not in the Pipecorn database; `live: true`: not found on LinkedIn). Nothing is charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_in_database": {
                    "summary": "Not in the Pipecorn database (live: false)",
                    "value": {
                      "error": "Company not found"
                    }
                  },
                  "not_on_linkedin": {
                    "summary": "Not found on LinkedIn (live: true)",
                    "value": {
                      "error": "Couldn't find resource on LinkedIn. Please make sure it exists and that you have the right permissions to access it."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "`live` is not a boolean, plan limit reached, or `live: true` and the Sales Navigator connection is missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_live": {
                    "summary": "live is not a boolean",
                    "value": {
                      "error": "Invalid live value. Must be a boolean (true/false)"
                    }
                  },
                  "sales_navigator_expired": {
                    "summary": "Sales Navigator credentials expired (live: true)",
                    "value": {
                      "error": "Sales Navigator credentials expired. Refresh your connection on Pipecorn interface, or set parameter 'live' to false in your request body"
                    }
                  },
                  "plan_limit": {
                    "summary": "Plan limit reached",
                    "value": {
                      "error": "Can't proceed with the request. Plan limit reached."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (20 requests per second, or your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Accounts"
        ],
        "operationId": "getCompanyHeadcountByDepartment"
      }
    },
    "/accounts/company_hiring": {
      "post": {
        "summary": "Get company job postings",
        "description": "Retrieve the list of open job postings indexed for a company.\n\n**Credits:** 1 credit per job returned. You are only charged for the jobs actually returned, and never for more jobs than your available credits allow. A lookup that returns no jobs costs nothing.\n\n**Rate limit:** 5 requests per second (exempt from the per-plan limit)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_domain": {
                    "type": "string",
                    "description": "Company website domain",
                    "example": "notion.so"
                  },
                  "company_name": {
                    "type": "string",
                    "description": "Company name",
                    "example": "Notion"
                  },
                  "company_linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn company URL",
                    "example": "https://www.linkedin.com/company/notionhq/"
                  },
                  "posted_within_days": {
                    "type": "integer",
                    "enum": [
                      7,
                      30,
                      60,
                      90,
                      180
                    ],
                    "default": 30,
                    "description": "Only return jobs posted within the last N days. Must be one of the selectable look-back windows: 7, 30, 60, 90, or 180. Defaults to 30 when omitted; any other value returns 422.",
                    "example": 30
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "description": "Maximum number of jobs to return. A positive integer capped at 100. Because billing is 1 credit per job, use this to bound how many credits a single lookup can spend. Only enough pages to satisfy the limit are fetched.",
                    "example": 10
                  },
                  "full_description": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, return each job's full description. Defaults to false, in which case descriptions are truncated to a 300-character snippet.",
                    "example": false
                  },
                  "job_title_keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Only return jobs whose title matches one of these keywords.",
                    "example": [
                      "engineer",
                      "developer"
                    ]
                  },
                  "excluded_job_title_keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Exclude jobs whose title matches one of these keywords.",
                    "example": [
                      "intern"
                    ]
                  },
                  "job_description_keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Only return jobs whose description contains one of these keywords.",
                    "example": [
                      "rails",
                      "ruby"
                    ]
                  },
                  "excluded_job_description_keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Exclude jobs whose description contains one of these keywords.",
                    "example": [
                      "php"
                    ]
                  },
                  "job_country_codes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Only return jobs located in these countries. 2-letter ISO 3166-1 alpha-2 country codes (e.g. US, FR); case-insensitive.",
                    "example": [
                      "US",
                      "FR"
                    ]
                  },
                  "excluded_job_country_codes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Exclude jobs located in these countries. 2-letter ISO 3166-1 alpha-2 country codes (e.g. US, FR); case-insensitive.",
                    "example": [
                      "CA"
                    ]
                  }
                }
              },
              "examples": {
                "by_domain": {
                  "summary": "Lookup by domain",
                  "value": {
                    "company_domain": "notion.so"
                  }
                },
                "by_linkedin_url": {
                  "summary": "Lookup by LinkedIn URL",
                  "value": {
                    "company_linkedin_url": "https://www.linkedin.com/company/notionhq/"
                  }
                },
                "by_name": {
                  "summary": "Lookup by name",
                  "value": {
                    "company_name": "Notion"
                  }
                },
                "with_posted_within_days": {
                  "summary": "Filter by recency",
                  "value": {
                    "company_domain": "notion.so",
                    "posted_within_days": 30
                  }
                },
                "with_filters_and_limit": {
                  "summary": "Filter by title and country with a limit",
                  "value": {
                    "company_domain": "notion.so",
                    "limit": 10,
                    "full_description": false,
                    "job_title_keywords": [
                      "engineer",
                      "developer"
                    ],
                    "excluded_job_title_keywords": [
                      "intern"
                    ],
                    "job_country_codes": [
                      "US",
                      "FR"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully retrieved job postings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total_jobs": {
                      "type": "integer",
                      "description": "Total number of matching job postings (may exceed the number returned)",
                      "example": 42
                    },
                    "truncated": {
                      "type": "boolean",
                      "description": "True when more jobs matched than were returned (because of the limit, the 100-job ceiling, or your available credits).",
                      "example": true
                    },
                    "company": {
                      "type": "object",
                      "description": "The hiring company, resolved from the first matching job.",
                      "properties": {
                        "name": {
                          "type": "string",
                          "example": "Acme"
                        },
                        "domain": {
                          "type": "string",
                          "example": "acme.com"
                        },
                        "linkedin_url": {
                          "type": "string",
                          "format": "uri",
                          "example": "https://linkedin.com/company/acme"
                        }
                      }
                    },
                    "jobs": {
                      "type": "array",
                      "description": "List of job postings",
                      "items": {
                        "type": "object",
                        "properties": {
                          "job_title": {
                            "type": "string",
                            "description": "Title of the job posting",
                            "example": "Senior Backend Engineer"
                          },
                          "job_url": {
                            "type": "string",
                            "format": "uri",
                            "description": "URL of the job posting",
                            "example": "https://example.com/jobs/1"
                          },
                          "job_location": {
                            "type": "string",
                            "description": "Location of the job posting",
                            "example": "Paris France"
                          },
                          "employment_statuses": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Employment statuses for the job (e.g. full_time, part_time)",
                            "example": [
                              "full_time"
                            ]
                          },
                          "date_posted": {
                            "type": "string",
                            "format": "date",
                            "description": "Date the job was posted",
                            "example": "2026-05-30"
                          },
                          "description": {
                            "type": "string",
                            "description": "Job description. Truncated to a 300-character snippet unless full_description is true.",
                            "example": "Build cool stuff with Rails."
                          },
                          "hiring_team": {
                            "type": "array",
                            "description": "List of people involved in hiring for this job",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "example": "Alice Doe"
                                },
                                "title": {
                                  "type": "string",
                                  "example": "Engineering Manager"
                                },
                                "linkedin_url": {
                                  "type": "string",
                                  "format": "uri",
                                  "example": "https://linkedin.com/in/alice"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "total_jobs": 42,
                  "truncated": true,
                  "company": {
                    "name": "Acme",
                    "domain": "acme.com",
                    "linkedin_url": "https://linkedin.com/company/acme"
                  },
                  "jobs": [
                    {
                      "job_title": "Senior Backend Engineer",
                      "job_url": "https://example.com/jobs/1",
                      "job_location": "Paris France",
                      "employment_statuses": [
                        "full_time"
                      ],
                      "date_posted": "2026-05-30",
                      "description": "Build cool stuff with Rails.",
                      "hiring_team": [
                        {
                          "name": "Alice Doe",
                          "title": "Engineering Manager",
                          "linkedin_url": "https://linkedin.com/in/alice"
                        }
                      ]
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Missing required company identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Provide at least one of: company_domain, company_name, company_linkedin_url"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Invalid API key"
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits to pay for the lookup. Returned before any job is fetched, and also when a concurrent request drains the balance before this one is charged. Nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits left",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "The workspace weekly enrichment credit limit is reached. Buying credits does not lift it, so no `top_up_url` is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceLimitError"
                },
                "example": {
                  "error": "You have reached your weekly enrichment credit limit for this workspace",
                  "code": "workspace_limit_exceeded"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Unprocessable entity. Returned for an invalid filter (each keyword filter must be an array of strings), an invalid country code (use 2-letter ISO 3166-1 alpha-2 codes), or a non-positive or non-integer limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Invalid country code(s): USA. Use 2-letter ISO 3166-1 alpha-2 codes (e.g. US, FR)."
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (5 requests per second)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Accounts"
        ],
        "operationId": "getCompanyJobPostings"
      }
    },
    "/accounts/company_stack": {
      "post": {
        "summary": "Get company technographics stack",
        "description": "Retrieve a company's technology stack.\n\n**Credits:** 3 credits per request\n\n**Rate limit:** none, credit-spending endpoints are exempt",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_domain": {
                    "type": "string",
                    "description": "Company website domain",
                    "example": "notion.so"
                  },
                  "company_name": {
                    "type": "string",
                    "description": "Company name",
                    "example": "Notion"
                  },
                  "company_linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn company URL",
                    "example": "https://www.linkedin.com/company/notionhq/"
                  }
                }
              },
              "examples": {
                "by_domain": {
                  "summary": "Lookup by domain",
                  "value": {
                    "company_domain": "notion.so"
                  }
                },
                "by_linkedin_url": {
                  "summary": "Lookup by LinkedIn URL",
                  "value": {
                    "company_linkedin_url": "https://www.linkedin.com/company/notionhq/"
                  }
                },
                "by_name": {
                  "summary": "Lookup by name",
                  "value": {
                    "company_name": "Notion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully retrieved company stack",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "technologies": {
                      "type": "array",
                      "description": "List of technology names detected for the company",
                      "items": {
                        "type": "string"
                      }
                    },
                    "technologies_with_confidence": {
                      "type": "array",
                      "description": "List of technologies with confidence scores",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Technology name"
                          },
                          "confidence": {
                            "type": "number",
                            "description": "Confidence score returned by provider"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "technologies": [
                    "Amazon Web Services",
                    "React",
                    "Segment"
                  ],
                  "technologies_with_confidence": [
                    {
                      "name": "Amazon Web Services",
                      "confidence": 0.97
                    },
                    {
                      "name": "React",
                      "confidence": 0.93
                    },
                    {
                      "name": "Segment",
                      "confidence": 0.74
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Missing required company identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Provide at least one of: company_domain, company_name, company_linkedin_url"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "Invalid API key"
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits for the 3-credit stack lookup. Returned before the provider is called, so nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits left",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "The workspace weekly enrichment credit limit is reached. Buying credits does not lift it, so no `top_up_url` is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceLimitError"
                },
                "example": {
                  "error": "You have reached your weekly enrichment credit limit for this workspace",
                  "code": "workspace_limit_exceeded"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "The technology provider rejected the lookup",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "TheirStack API error 422: <provider response body>"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Accounts"
        ],
        "operationId": "getCompanyTechnographicsStack"
      }
    },
    "/accounts/technologies": {
      "get": {
        "summary": "Technology slug lookup",
        "description": "Resolve a technology name to the slugs used by the tech-stack company search endpoints (`POST /intents/accounts/stack` and its preview).",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Technology name to search for.",
            "example": "hubspot"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching technologies",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "technologies"
                  ],
                  "properties": {
                    "technologies": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string",
                            "description": "Slug to use in `stacks` / `excluded_stacks`.",
                            "example": "hubspot"
                          },
                          "name": {
                            "type": "string",
                            "example": "HubSpot"
                          },
                          "category": {
                            "type": "string",
                            "example": "Marketing Automation"
                          },
                          "logo": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://cdn.theirstack.com/logos/hubspot.png"
                          },
                          "description": {
                            "type": "string",
                            "example": "Inbound marketing, sales, and CRM platform."
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Bad request (query missing)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity (technology lookup failed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ],
        "operationId": "technologySlugLookup"
      }
    },
    "/alerts": {
      "get": {
        "summary": "List alerts",
        "description": "Returns the alerts (signal trackings) created by your account (or by every member of your workspace when you authenticate with a workspace key), newest first.",
        "parameters": [
          {
            "name": "alert_type",
            "in": "query",
            "required": false,
            "description": "Only return alerts of this type",
            "schema": {
              "type": "string",
              "enum": [
                "NEW_HIRES",
                "JOB_CHANGES",
                "JOB_POSTING",
                "SOCIAL_LISTENING",
                "STACK",
                "CUSTOM_LEAD",
                "CUSTOM_ACCOUNT",
                "COMPANY_SIGNAL"
              ]
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "`true` returns active alerts only. Any other value is ignored",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The alerts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "alerts"
                  ],
                  "properties": {
                    "alerts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Alert"
                      }
                    }
                  }
                },
                "example": {
                  "alerts": [
                    {
                      "uuid": "3f6c2a1e-9b8d-4c1f-a2e3-5d6f7a8b9c0d",
                      "name": "Signal NEW_HIRES - 2025-01-03 17:35:33",
                      "alert_type": "NEW_HIRES",
                      "frequency": "DAILY",
                      "active": true,
                      "webhook_url": null,
                      "skip_first_run": false,
                      "created_at": "2025-01-03T17:35:33.073Z",
                      "latest_search_at": "2025-01-04T17:35:33.073Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Unknown `alert_type`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "example": {
                  "error": "alert_type must be one of: NEW_HIRES, JOB_CHANGES, JOB_POSTING, SOCIAL_LISTENING, STACK, CUSTOM_LEAD, CUSTOM_ACCOUNT, COMPANY_SIGNAL"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            }
          }
        },
        "tags": [
          "Alerts"
        ],
        "operationId": "listAlerts"
      },
      "post": {
        "summary": "Create an alert",
        "description": "Create a recurring alert. `type` picks what it tracks: `custom` (default, a Sales Navigator search URL), `social_listening` (one person's new posts and their engagers), `job_posting` (companies hiring), `stack` (companies using technologies) `company_signal` (companies newly matching funding, headcount growth or website traffic filters on the Pipecorn database), `new_hires` (people starting a job matching given titles, on the Pipecorn database by default or on a Sales Navigator saved search with `live: true`) or `job_changes` (contacts changing jobs). Each type takes the filters of its one-off endpoint; a key the type doesn't take answers 422 (`custom` ignores unknown keys).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "custom",
                      "social_listening",
                      "job_posting",
                      "stack",
                      "company_signal",
                      "new_hires",
                      "job_changes"
                    ],
                    "default": "custom",
                    "description": "What the alert tracks."
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the alert",
                    "example": "VP Sales in France"
                  },
                  "search_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "`custom` only. Required for it. Sales Navigator search URL, starting with `https://www.linkedin.com/sales/search/people` (leads) or `https://www.linkedin.com/sales/search/company` (accounts)",
                    "example": "https://www.linkedin.com/sales/search/people?query=(filters:List((type:CURRENT_TITLE,values:List((text:VP%20Sales,selectionType:INCLUDED)))))"
                  },
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "daily",
                      "weekly",
                      "monthly"
                    ],
                    "default": "daily",
                    "description": "How often the alert runs. Case-insensitive. A `job_changes` alert only takes `monthly`, its default"
                  },
                  "max_results": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2500,
                    "default": 2500,
                    "description": "`custom` only. Maximum number of results the first run extracts. Later runs pick up every new result"
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL each run posts its results to when it finishes. Lead runs post the same payload as `POST /leads`; company runs post the same payload as `POST /lists`",
                    "example": "https://hooks.example.com/pipecorn"
                  },
                  "webhook_streaming": {
                    "type": "boolean",
                    "default": false,
                    "description": "`custom` only. Lead alerts only. When `true`, leads are posted to `webhook_url` one by one as they are found instead of once the run finishes"
                  },
                  "skip_first_run": {
                    "type": "boolean",
                    "default": false,
                    "description": "When `true`, the alert starts from now: it does not run right away, and its first run, at the next `frequency` tick, only picks up the results that are new since the alert was created"
                  },
                  "live": {
                    "type": "boolean",
                    "default": false,
                    "description": "`new_hires` only. `false` (default) runs the alert on the Pipecorn people database: no LinkedIn connection needed, and locations are Pipecorn database location IDs (`POST /locations` with `\"source\": \"database\"`). `true` runs it on a Sales Navigator saved search instead: it needs a connected LinkedIn account with Sales Navigator, counts against its 50 saved searches, and locations are Sales Navigator location IDs (`\"source\": \"live\"`). `functions`, `seniority_levels`, `excluded_seniority_levels`, `years_in_current_position`, `years_at_current_company`, `keyword` and `hire_type` only work with `live: false`: with `live: true` they return `422`. A non-boolean value returns `422`.",
                    "example": false
                  },
                  "author_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "`social_listening` only. Required for it. LinkedIn profile whose new posts the alert watches.",
                    "example": "https://www.linkedin.com/in/jane-doe"
                  },
                  "engagement_type": {
                    "type": "string",
                    "enum": [
                      "reactions",
                      "comments",
                      "all"
                    ],
                    "default": "all",
                    "description": "`social_listening` only. Which engagers each run extracts."
                  },
                  "exclude_people_from_same_company": {
                    "type": "boolean",
                    "description": "`social_listening` only. Drop the engagers who work at the author's company."
                  },
                  "selected_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`job_posting` only. Job titles of the openings to watch. `selected_titles` or `selected_keywords` is required."
                  },
                  "excluded_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`job_posting` only. Job titles of openings to ignore."
                  },
                  "selected_keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`job_posting` only. Keywords the job postings must mention."
                  },
                  "excluded_keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`job_posting` only. Keywords whose job postings are ignored."
                  },
                  "exclude_consulting_recruiting": {
                    "type": "boolean",
                    "description": "`job_posting` only. Ignore consulting and recruiting companies."
                  },
                  "exclude_internships": {
                    "type": "boolean",
                    "description": "`job_posting` only. Ignore internship postings."
                  },
                  "published_date": {
                    "type": "string",
                    "enum": [
                      "last_24_hours",
                      "last_7_days",
                      "last_15_days",
                      "last_30_days",
                      "last_90_days",
                      "last_180_days",
                      "last_360_days"
                    ],
                    "description": "`job_posting` only. Only count job postings published in this window."
                  },
                  "stacks": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`stack` only. Required for it. Technology slugs, from `GET /accounts/technologies`."
                  },
                  "stack_match": {
                    "type": "string",
                    "enum": [
                      "or",
                      "and"
                    ],
                    "default": "or",
                    "description": "`stack` only. Whether companies use any or all of `stacks`."
                  },
                  "excluded_stacks": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`stack` only. Technology slugs to exclude."
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`stack` only. ISO country codes."
                  },
                  "included_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`job_posting`, `stack`, `company_signal` and `new_hires`. LinkedIn industry IDs to include."
                  },
                  "excluded_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`stack`, `company_signal` and `new_hires`. LinkedIn industry IDs to exclude."
                  },
                  "company_size": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`job_posting`, `stack`, `company_signal` and `new_hires`. Company size buckets."
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "description": "`job_posting`: hiring location IDs. `company_signal`: Pipecorn database location IDs (e.g. `country:fr`). `new_hires`: Pipecorn database location IDs, or Sales Navigator location IDs with `live: true`. An ID from another source returns `422`."
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "description": "Same IDs as `included_locations`, to exclude."
                  },
                  "last_funding_within_days": {
                    "type": "integer",
                    "description": "`company_signal` only. Companies that raised within this many days. A company signal."
                  },
                  "min_headcount_growth": {
                    "type": "number",
                    "description": "`company_signal` only. Minimum company headcount growth, in percent. A company signal. See the account search for the other headcount, funding and traffic filters, which `company_signal` takes too."
                  },
                  "min_monthly_visitors": {
                    "type": "integer",
                    "description": "`company_signal` only. Minimum monthly website visitors. A company signal."
                  },
                  "included_job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`new_hires` only. Required for it. Job titles the new hires must hold."
                  },
                  "excluded_job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "`new_hires` only. Job titles to exclude."
                  },
                  "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": "`new_hires` with `live: false` only. LinkedIn function (department) IDs (`FUNCTION`). Multiple IDs are combined with OR logic.\n\nID → 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": "`new_hires` with `live: false` only. LinkedIn seniority level IDs (`SENIORITY_LEVEL`).\n\nID → 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"
                    ]
                  },
                  "excluded_seniority_levels": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "100",
                        "110",
                        "120",
                        "130",
                        "200",
                        "210",
                        "220",
                        "300",
                        "310",
                        "320"
                      ]
                    },
                    "description": "`new_hires` with `live: false` only. LinkedIn seniority level IDs to exclude, on the same scale as `seniority_levels`.",
                    "example": [
                      "100",
                      "110"
                    ]
                  },
                  "years_in_current_position": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5",
                        "6",
                        "7",
                        "8"
                      ]
                    },
                    "description": "`new_hires` with `live: false` only. Bucketed years in the current position: `\"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.",
                    "example": [
                      "3"
                    ]
                  },
                  "years_at_current_company": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5",
                        "6",
                        "7",
                        "8"
                      ]
                    },
                    "description": "`new_hires` with `live: false` only. Bucketed years at the current company: `\"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.",
                    "example": [
                      "2",
                      "3"
                    ]
                  },
                  "keyword": {
                    "type": "string",
                    "description": "`new_hires` with `live: false` only. Free-text keyword matched against the people database profiles.",
                    "example": "saas"
                  },
                  "hire_type": {
                    "type": "string",
                    "enum": [
                      "new_hire",
                      "promoted"
                    ],
                    "description": "`new_hires` with `live: false` only. `new_hire` keeps only people who joined a new company; `promoted` only people who moved to a new role in the same company. Leave it out to get both.",
                    "example": "new_hire"
                  },
                  "contacts": {
                    "type": "array",
                    "maxItems": 10000,
                    "description": "`job_changes` only. Required for it. Each contact needs `linkedin_url`, or all of `first_name`, `last_name` and `company_name`.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "linkedin_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "first_name": {
                          "type": "string"
                        },
                        "last_name": {
                          "type": "string"
                        },
                        "company_name": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              },
              "examples": {
                "custom": {
                  "summary": "Custom (Sales Navigator search)",
                  "value": {
                    "name": "VP Sales in France",
                    "search_url": "https://www.linkedin.com/sales/search/people?query=(filters:List((type:CURRENT_TITLE,values:List((text:VP%20Sales,selectionType:INCLUDED)))))",
                    "frequency": "daily",
                    "webhook_url": "https://hooks.example.com/pipecorn"
                  }
                },
                "social_listening": {
                  "summary": "Social listening",
                  "value": {
                    "type": "social_listening",
                    "name": "Jane's posts",
                    "author_url": "https://www.linkedin.com/in/jane-doe",
                    "engagement_type": "all"
                  }
                },
                "job_posting": {
                  "summary": "Job posting",
                  "value": {
                    "type": "job_posting",
                    "name": "AE hiring in France",
                    "selected_titles": [
                      "Account Executive"
                    ],
                    "included_locations": [
                      2988507
                    ],
                    "frequency": "weekly"
                  }
                },
                "stack": {
                  "summary": "Tech stack",
                  "value": {
                    "type": "stack",
                    "name": "Shopify stores",
                    "stacks": [
                      "shopify"
                    ],
                    "countries": [
                      "FR"
                    ]
                  }
                },
                "company_signal": {
                  "summary": "Company signal",
                  "value": {
                    "type": "company_signal",
                    "name": "Freshly funded SaaS",
                    "last_funding_within_days": 90,
                    "included_industries": [
                      "4"
                    ],
                    "skip_first_run": true
                  }
                },
                "new_hires": {
                  "summary": "New hires",
                  "value": {
                    "type": "new_hires",
                    "name": "New sales leaders",
                    "included_job_titles": [
                      "VP Sales",
                      "Head of Sales"
                    ],
                    "included_locations": [
                      "country:fr"
                    ],
                    "hire_type": "new_hire",
                    "frequency": "weekly"
                  }
                },
                "new_hires_sales_navigator": {
                  "summary": "New hires on Sales Navigator",
                  "value": {
                    "type": "new_hires",
                    "name": "New sales leaders",
                    "included_job_titles": [
                      "VP Sales",
                      "Head of Sales"
                    ],
                    "included_locations": [
                      "105015875"
                    ],
                    "frequency": "weekly",
                    "live": true
                  }
                },
                "job_changes": {
                  "summary": "Job changes",
                  "value": {
                    "type": "job_changes",
                    "name": "Champions",
                    "contacts": [
                      {
                        "linkedin_url": "https://www.linkedin.com/in/jane-doe"
                      },
                      {
                        "first_name": "John",
                        "last_name": "Roe",
                        "company_name": "Acme"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The alert was created and its first run started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "alert"
                  ],
                  "properties": {
                    "alert": {
                      "$ref": "#/components/schemas/Alert"
                    }
                  }
                },
                "example": {
                  "alert": {
                    "uuid": "3f6c2a1e-9b8d-4c1f-a2e3-5d6f7a8b9c0d",
                    "name": "VP Sales in France",
                    "alert_type": "CUSTOM_LEAD",
                    "frequency": "DAILY",
                    "active": true,
                    "webhook_url": "https://hooks.example.com/pipecorn",
                    "skip_first_run": false,
                    "created_at": "2026-11-03T09:00:00.000Z",
                    "latest_search_at": "2026-11-03T09:00:01.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, or a plan or Sales Navigator limit is reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "examples": {
                  "missing_name": {
                    "summary": "Missing name",
                    "value": {
                      "error": "name is required"
                    }
                  },
                  "invalid_url": {
                    "summary": "Not a Sales Navigator search URL",
                    "value": {
                      "error": "search_url must be a Sales Navigator people or company search URL"
                    }
                  },
                  "invalid_frequency": {
                    "summary": "Unknown frequency",
                    "value": {
                      "error": "frequency must be one of: daily, weekly, monthly"
                    }
                  },
                  "invalid_max_results": {
                    "summary": "max_results out of range",
                    "value": {
                      "error": "max_results must be an integer between 1 and 2500"
                    }
                  },
                  "alert_limit": {
                    "summary": "Alert limit reached",
                    "value": {
                      "error": "You have reached the maximum number of alerts in your plan. Reach out to support if you need more alerts."
                    }
                  },
                  "saved_search_limit": {
                    "summary": "50 Sales Navigator saved searches reached",
                    "value": {
                      "error": "You have reached the maximum number of saved searches"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The plan doesn't include this signal (social listening, job posting and tech stack need the Growth plan; company signals depend on the signal).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "example": {
                  "error": "This signal is part of a higher plan. Upgrade to save these companies to a list."
                }
              }
            }
          },
          "404": {
            "description": "`social_listening`: LinkedIn doesn't return `author_url`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "example": {
                  "error": "author_url was not found on LinkedIn"
                }
              }
            }
          },
          "422": {
            "description": "Invalid `webhook_url`, LinkedIn not connected, or the alert could not be created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "examples": {
                  "invalid_webhook": {
                    "summary": "Invalid webhook_url",
                    "value": {
                      "error": "Invalid webhook_url format"
                    }
                  },
                  "linkedin_missing": {
                    "summary": "LinkedIn not connected",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "creation_failed": {
                    "summary": "Sales Navigator refused the saved search",
                    "value": {
                      "error": "Failed to create alert - Sales Navigator did not create the saved search for this alert"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            }
          }
        },
        "tags": [
          "Alerts"
        ],
        "operationId": "createAnAlert"
      }
    },
    "/alerts/{id}": {
      "get": {
        "summary": "Retrieve an alert and its runs",
        "description": "Returns an alert and its runs, newest first: `searches` for lead runs and `lists` for company runs. Pass `since` to get only the runs created since your last check. With a workspace key, any member's alert can be fetched.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "UUID of the alert",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "ISO 8601 timestamp. Only return runs created at or after this time. Pass the `checked_at` of your previous call",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-11-03T09:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "The alert and its runs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "alert",
                    "checked_at",
                    "searches",
                    "lists"
                  ],
                  "properties": {
                    "alert": {
                      "$ref": "#/components/schemas/Alert"
                    },
                    "checked_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Server time of this call. Pass it as `since` next time to get only newer runs"
                    },
                    "searches": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AlertSearch"
                      },
                      "description": "Lead runs. Fetch each run's leads from its `results_url`"
                    },
                    "lists": {
                      "type": "array",
                      "description": "Company runs (`CUSTOM_ACCOUNT` and other alerts that deliver company lists). Fetch each run's companies from its `results_url`",
                      "items": {
                        "$ref": "#/components/schemas/AlertList"
                      }
                    }
                  }
                },
                "example": {
                  "alert": {
                    "uuid": "3f6c2a1e-9b8d-4c1f-a2e3-5d6f7a8b9c0d",
                    "name": "Signal NEW_HIRES - 2025-01-03 17:35:33",
                    "alert_type": "NEW_HIRES",
                    "frequency": "DAILY",
                    "active": true,
                    "webhook_url": null,
                    "skip_first_run": false,
                    "created_at": "2025-01-03T17:35:33.073Z",
                    "latest_search_at": "2025-01-04T17:35:33.073Z"
                  },
                  "checked_at": "2025-01-05T08:00:00.000Z",
                  "searches": [
                    {
                      "uuid": "598267ec-ac11-41b3-849f-bd360b185b76",
                      "name": "Signal NEW_HIRES - 2025-01-04",
                      "status": "finished",
                      "created_at": "2025-01-04T17:35:33.073Z",
                      "leads_count": 12,
                      "results_url": "https://app.pipecorn.com/api/v2/searches/598267ec-ac11-41b3-849f-bd360b185b76"
                    }
                  ],
                  "lists": []
                }
              }
            }
          },
          "400": {
            "description": "`since` is not an ISO 8601 timestamp",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "example": {
                  "error": "since must be an ISO 8601 timestamp, e.g. 2026-01-31T09:00:00Z"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No alert with this UUID belongs to your account (or, with a workspace key, to your workspace)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "example": {
                  "error": "Alert not found"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            }
          }
        },
        "tags": [
          "Alerts"
        ],
        "operationId": "retrieveAnAlertAndItsRuns"
      },
      "delete": {
        "summary": "Delete an alert",
        "description": "Deletes an alert and its Sales Navigator saved search, so it never runs again. Lead runs still in progress are deleted with it. Finished runs stay available through `GET /searches/{id}` and `GET /lists/{id}`. With a workspace key, any member's alert can be deleted.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "UUID of the alert",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The alert was deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Alert deleted successfully"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No alert with this UUID belongs to your account (or, with a workspace key, to your workspace)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "example": {
                  "error": "Alert not found"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertsError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            }
          }
        },
        "tags": [
          "Alerts"
        ],
        "operationId": "deleteAnAlert"
      }
    },
    "/contacts/{id}": {
      "get": {
        "summary": "Get single contact enrichment result",
        "description": "Retrieves the enrichment result for a single contact by enrichment ID.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the enrichment request to retrieve",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enrichment result retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrichment_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The ID of the enrichment request"
                    },
                    "first_name": {
                      "type": "string",
                      "description": "The contact's first name"
                    },
                    "last_name": {
                      "type": "string",
                      "description": "The contact's last name"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "finished",
                        "failed"
                      ],
                      "description": "`pending` while the waterfall is still running. `finished` once every requested enrichment type has completed (whether or not data was found). `failed` when the enrichment stopped because the credit balance or the workspace weekly credit limit ran out; `code` then says which."
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "insufficient_credits",
                        "workspace_limit_exceeded"
                      ],
                      "description": "Present only when `status` is `failed`: `insufficient_credits` when the credit balance ran out, `workspace_limit_exceeded` when the workspace weekly credit limit was reached. Top up or raise the limit, then send a new enrichment request."
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "The enriched professional email address (present if enrichment_type included email). `null` when none was found.",
                      "nullable": true
                    },
                    "email_status": {
                      "type": "string",
                      "description": "Deliverability of `email`: `deliverable` or `catch-all` (the domain accepts every address, so the mailbox could not be confirmed). `null` when no email was found. Pipecorn does not verify an email taken from your CRM (`email_source: \"crm\"`), so its status stays `null` unless Pipecorn had already checked that address.",
                      "nullable": true
                    },
                    "email_source": {
                      "type": "string",
                      "enum": [
                        "crm",
                        "pipecorn"
                      ],
                      "description": "Where `email` comes from. `crm`: your HubSpot or Salesforce already held it, so no search ran and no credit was charged. `pipecorn`: found by the waterfall. `null` when there is no email. See [Values from your CRM](/api-reference/endpoints/enrichments/single#values-from-your-crm).",
                      "nullable": true
                    },
                    "personal_email": {
                      "type": "string",
                      "format": "email",
                      "description": "The enriched personal email address (present if enrichment_type included personal_email). `null` when none was found.",
                      "nullable": true
                    },
                    "personal_email_status": {
                      "type": "string",
                      "description": "Deliverability of `personal_email`: `deliverable` or `catch-all`. `null` when no personal email was found.",
                      "nullable": true
                    },
                    "phone": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "Phone number in E.164 format, without spaces (e.g. `+33622222222`). A number your workspace has suppressed is returned as the literal string `Contacts not shared`."
                      },
                      "description": "Array of enriched phone numbers, after the `phone_type` filter is applied (empty array when none found)"
                    },
                    "phone_details": {
                      "type": "array",
                      "description": "Phone numbers found, each with its line type. Same numbers and order as `phone`, after the `phone_type` filter is applied (empty array when none found).",
                      "items": {
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": "string",
                            "description": "Phone number in E.164 format, without spaces (e.g. `+33622222222`). A number your workspace has suppressed is returned as the literal string `Contacts not shared`."
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "mobile",
                              "fixed_or_mobile",
                              "fixed_line",
                              "voip",
                              "toll_free",
                              "premium_rate",
                              "shared_cost",
                              "personal_number",
                              "pager",
                              "uan",
                              "voicemail",
                              "unknown"
                            ],
                            "description": "Line type derived from the number's numbering plan. `fixed_or_mobile` is used in countries where mobile and landline numbers share the same ranges (e.g. the US and Canada); it counts as mobile for the `phone_type` filter and for billing. `unknown` means the number could not be classified."
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "crm",
                              "pipecorn"
                            ],
                            "description": "Where the number comes from. `crm`: only your HubSpot or Salesforce gave it, so no credit was charged for it and Pipecorn did not verify it. `pipecorn`: found by the waterfall."
                          },
                          "dnc": {
                            "type": "string",
                            "enum": [
                              "on_list",
                              "not_on_list",
                              "unknown"
                            ],
                            "description": "Do Not Call screening result. Present only when your workspace has DNC screening enabled and the number is a US number."
                          },
                          "dnc_lists": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Codes of the Do Not Call lists the number is on (e.g. `FED` for the federal list). Empty unless `dnc` is `on_list`. Present with `dnc`.",
                            "example": [
                              "FED"
                            ]
                          },
                          "dnc_checked_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true,
                            "description": "When the number was last screened. `null` if it was never checked. Present with `dnc`."
                          }
                        }
                      }
                    },
                    "custom": {
                      "type": "object",
                      "description": "The custom fields you sent with the enrichment request, and only those. Omitted when you sent none.",
                      "additionalProperties": true
                    }
                  }
                },
                "examples": {
                  "finished": {
                    "summary": "Finished",
                    "value": {
                      "enrichment_id": "123e4567-e89b-12d3-a456-426614174000",
                      "first_name": "Mathieu",
                      "last_name": "Brun-Picard",
                      "status": "finished",
                      "email": "mathieu@pipecorn.com",
                      "email_status": "deliverable",
                      "email_source": "pipecorn",
                      "personal_email": "mathieu.bp@gmail.com",
                      "personal_email_status": "deliverable",
                      "phone": [
                        "+12015550123"
                      ],
                      "phone_details": [
                        {
                          "number": "+12015550123",
                          "type": "fixed_or_mobile",
                          "source": "pipecorn"
                        }
                      ],
                      "custom": {
                        "hubspot_id": "4447901"
                      }
                    }
                  },
                  "from_crm": {
                    "summary": "Finished: email and phone from your CRM",
                    "value": {
                      "enrichment_id": "123e4567-e89b-12d3-a456-426614174000",
                      "first_name": "Mathieu",
                      "last_name": "Brun-Picard",
                      "status": "finished",
                      "email": "mathieu@pipecorn.com",
                      "email_status": null,
                      "email_source": "crm",
                      "personal_email": null,
                      "personal_email_status": null,
                      "phone": [
                        "+33612345678"
                      ],
                      "phone_details": [
                        {
                          "number": "+33612345678",
                          "type": "mobile",
                          "source": "crm"
                        }
                      ]
                    }
                  },
                  "failed": {
                    "summary": "Failed: out of credits",
                    "value": {
                      "enrichment_id": "123e4567-e89b-12d3-a456-426614174000",
                      "first_name": "Mathieu",
                      "last_name": "Brun-Picard",
                      "status": "failed",
                      "code": "insufficient_credits",
                      "email": null,
                      "email_status": null,
                      "email_source": null,
                      "personal_email": null,
                      "personal_email_status": null,
                      "phone": [],
                      "phone_details": []
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Enrichment not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentsError"
                },
                "example": {
                  "error": "Enrichment not found"
                }
              }
            }
          }
        },
        "tags": [
          "Enrichments"
        ],
        "operationId": "getSingleContactEnrichmentResult"
      }
    },
    "/contacts/single_enrich": {
      "post": {
        "summary": "Enrich a single contact",
        "description": "Enriches a single contact with specified data points.",
        "requestBody": {
          "description": "Contact information for enrichment",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnrichmentRequest"
              },
              "example": {
                "firstname": "Mathieu",
                "lastname": "Brun-Picard",
                "domain": "pipecorn.com",
                "company_name": "Pipecorn",
                "linkedin_url": "https://www.linkedin.com/in/mathieu-brun-picard/",
                "webhook_url": "https://webhook.site/8b53c96f-f2cd-4c24-bc09-b3c2176d7ea8",
                "enrichment_type": [
                  "phone"
                ],
                "phone_type": [
                  "mobile"
                ],
                "custom": {
                  "hubspot_id": "4447901"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Enrichment request accepted. The waterfall runs asynchronously: poll the URL in the `Location` header (`GET /contacts/{id}`, using the returned `enrichment_id`) or wait for the `webhook_url` callback. The callback body is close to, but not the same as, the `GET /contacts/{id}` response: it carries `status: \"completed\"`, phone numbers under `phones` (not `phone`), and the company `domain`. If the enrichment stops because credits run out, the callback is `{\"enrichment_id\", \"first_name\", \"last_name\", \"status\": \"failed\", \"code\": \"insufficient_credits\" | \"workspace_limit_exceeded\", \"custom\"}` instead (`custom` only when you sent it).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrichment_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The ID of the enrichment request. Use it to poll `GET /contacts/{id}`."
                    },
                    "first_name": {
                      "type": "string",
                      "description": "The contact's first name"
                    },
                    "last_name": {
                      "type": "string",
                      "description": "The contact's last name"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending"
                      ],
                      "description": "Always `pending` on creation; the waterfall runs asynchronously."
                    },
                    "custom": {
                      "type": "object",
                      "description": "Custom fields passed in the request",
                      "additionalProperties": true
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the result: `GET /contacts/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/contacts/123e4567-e89b-12d3-a456-426614174000"
                    }
                  }
                },
                "example": {
                  "enrichment_id": "123e4567-e89b-12d3-a456-426614174000",
                  "first_name": "Mathieu",
                  "last_name": "Brun-Picard",
                  "status": "pending",
                  "custom": {
                    "hubspot_id": "4447901"
                  },
                  "status_url": "https://app.pipecorn.com/api/v2/contacts/123e4567-e89b-12d3-a456-426614174000"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this enrichment, `GET /contacts/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits to cover the request. Credits are checked up-front for the whole request, so nothing is enqueued and nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits left",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "The workspace weekly enrichment credit limit is reached. Buying credits does not lift it, so no `top_up_url` is returned, and nothing is enqueued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceLimitError"
                },
                "example": {
                  "error": "You have reached your weekly enrichment credit limit for this workspace",
                  "code": "workspace_limit_exceeded"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Unprocessable Entity. Returned when validation fails (e.g. unsupported `enrichment_type` or `phone_type` value, missing required identifiers), or when the user has not consented to personal email enrichment but requested `personal_email`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentsError"
                },
                "examples": {
                  "invalid_phone_type": {
                    "summary": "Unsupported phone_type value",
                    "value": {
                      "error": "phone_type must be [\"all\"] or [\"mobile\"]"
                    }
                  },
                  "personal_email_consent_missing": {
                    "summary": "Personal email consent missing",
                    "value": {
                      "error": "You can't use the personal email enrichment feature without consenting with our terms of use"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Enrichments"
        ],
        "operationId": "enrichASingleContact"
      }
    },
    "/contacts/bulk_enrich": {
      "post": {
        "summary": "Enrich multiple contacts (deprecated)",
        "description": "**Deprecated.** Use `POST /contacts/single_enrich` (async, with `webhook_url`) once per contact instead. This endpoint keeps working for existing integrations but receives no new features (such as `phone_type` or `phone_details`).",
        "requestBody": {
          "description": "Bulk contact information for enrichment",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "enrichment_type",
                  "contacts"
                ],
                "properties": {
                  "enrichment_type": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 3,
                    "items": {
                      "type": "string",
                      "enum": [
                        "email",
                        "phone",
                        "personal_email"
                      ]
                    },
                    "description": "What to look for, applied to every contact in the batch: any combination of `email`, `phone` and `personal_email`. `phone` and `personal_email` need each contact's `linkedin_url`; `personal_email` also needs account-level GDPR consent."
                  },
                  "contacts": {
                    "type": "array",
                    "minItems": 2,
                    "items": {
                      "type": "object",
                      "properties": {
                        "firstname": {
                          "type": "string",
                          "description": "First name of the contact."
                        },
                        "lastname": {
                          "type": "string",
                          "description": "Last name of the contact."
                        },
                        "linkedin_url": {
                          "type": "string",
                          "format": "uri",
                          "description": "LinkedIn profile URL of the contact.",
                          "example": "https://www.linkedin.com/in/mathieu-brun-picard/"
                        },
                        "domain": {
                          "type": "string",
                          "description": "Company domain.",
                          "example": "pipecorn.com"
                        },
                        "company_name": {
                          "type": "string",
                          "description": "Company name.",
                          "example": "Pipecorn"
                        },
                        "custom": {
                          "type": "object",
                          "description": "Custom fields to include with the enrichment.",
                          "additionalProperties": true
                        }
                      },
                      "anyOf": [
                        {
                          "required": [
                            "linkedin_url"
                          ]
                        },
                        {
                          "required": [
                            "firstname",
                            "lastname"
                          ],
                          "anyOf": [
                            {
                              "required": [
                                "domain"
                              ]
                            },
                            {
                              "required": [
                                "company_name"
                              ]
                            }
                          ]
                        }
                      ],
                      "description": "Send `linkedin_url`, or `firstname` + `lastname` with `domain` or `company_name`. A `linkedin_url` alone is enough for every enrichment type; without it, only `email` can run."
                    },
                    "description": "At least 2 contacts; for a single contact use `POST /contacts/single_enrich`."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Webhook URL to receive enrichment results"
                  },
                  "phone_country_codes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": "ISO 3166-1 alpha-2 country code (e.g. \"US\", \"FR\", \"GB\")"
                    },
                    "description": "Optional. Restrict phone enrichment to phone numbers from these countries (applies to every contact in the batch). When omitted, the user's account-level default phone country codes are applied."
                  },
                  "skip_crm": {
                    "type": "boolean",
                    "default": false,
                    "description": "Optional. When your HubSpot or Salesforce already holds a contact's email or phone, it is returned without a search and costs no credit. Send `true` to run the paid search for every contact in the batch anyway."
                  }
                }
              },
              "example": {
                "contacts": [
                  {
                    "firstname": "Mathieu",
                    "lastname": "Brun-Picard",
                    "domain": "pipecorn.com",
                    "company_name": "Pipecorn",
                    "linkedin_url": "https://www.linkedin.com/in/mathieu-brun-picard/",
                    "custom": {
                      "hubspot_id": "4447901"
                    }
                  },
                  {
                    "firstname": "Nicolas",
                    "lastname": "Fernandez-Le Follic",
                    "domain": "pipecorn.com",
                    "company_name": "Pipecorn",
                    "linkedin_url": "https://www.linkedin.com/in/nicolasfernandezlefollic/",
                    "custom": {
                      "hubspot_id": "4447902"
                    }
                  }
                ],
                "webhook_url": "https://webhook.site/8b53c96f-f2cd-4c24-bc09-b3c2176d7ea8",
                "enrichment_type": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk enrichment request accepted. Contacts are enriched asynchronously, and `webhook_url` receives one POST once the whole batch has finished: `{\"id\": \"<enrichment_id>\", \"data\": [ ...one entry per contact ]}`. Each entry has `first_name`, `last_name`, `email`, `email_status`, `email_source`, `phones` and `custom` (plus `personal_email` and `personal_email_status` when personal email enrichment is enabled on the account). In this payload the statuses are capitalised: `Deliverable`, `Catch-All`, or `null`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrichment_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The ID of the bulk enrichment job"
                    }
                  }
                },
                "example": {
                  "enrichment_id": "123e4567-e89b-12d3-a456-426614174000"
                }
              }
            },
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "The request body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentsError"
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits to cover the request. Credits are checked up-front for the whole request, so nothing is enqueued and nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits left",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "The workspace weekly enrichment credit limit is reached. Buying credits does not lift it, so no `top_up_url` is returned, and nothing is enqueued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceLimitError"
                },
                "example": {
                  "error": "You have reached your weekly enrichment credit limit for this workspace",
                  "code": "workspace_limit_exceeded"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Unprocessable Entity. Returned when validation fails (e.g. unsupported `enrichment_type` value, missing required identifiers), or when the user has not consented to personal email enrichment but requested `personal_email`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentsError"
                },
                "examples": {
                  "personal_email_consent_missing": {
                    "summary": "Personal email consent missing",
                    "value": {
                      "error": "You can't use the personal email enrichment feature without consenting with our terms of use"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": true,
        "x-hidden": true,
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Enrichments"
        ],
        "operationId": "enrichMultipleContactsDeprecated"
      }
    },
    "/contacts/report_phone": {
      "post": {
        "summary": "Report a wrong phone number",
        "description": "Tell Pipecorn that a phone number it returned for a contact is wrong, and search for another one.\n\nThe number is removed from the contact: [`GET /contacts/{id}`](/api-reference/endpoints/contacts/single_enrich), the enrichment webhook and later enrichments of the same person no longer return it. Unless `find_replacement` is `false`, a new phone search starts at once. It skips the providers that gave the wrong number, and runs only when no other mobile is left on the contact.\n\n**Credits:** reporting is free, and so is the new search, even when it finds a number. With `find_replacement: false`, the credits you paid for the number come back, unless the contact still has another mobile; `credits_refunded` says whether they did.\n\n**Result:** the response comes back right away. While the search runs, `GET /contacts/{id}` answers `status: \"pending\"`. When it ends, the `webhook_url` (or the one sent with the original enrichment) receives the same payload as [single enrichment](/api-reference/endpoints/enrichments/single#receiving-results), with the new number in `phones` or none.\n\nThe report always lands when the contact and number are found: a plan without phone enrichment still removes the number and says in `replacement` why no search ran. An empty credit balance does not block the search. Reporting the same number again while its search runs does not start a second one.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_url",
                  "phone",
                  "reason"
                ],
                "properties": {
                  "linkedin_url": {
                    "type": "string",
                    "description": "LinkedIn profile URL of the contact, as sent to the enrichment.",
                    "example": "https://www.linkedin.com/in/william-hewish"
                  },
                  "phone": {
                    "type": "string",
                    "description": "The wrong number, as Pipecorn returned it. Any international format works: spaces, dots, dashes and parentheses are ignored.",
                    "example": "+33612345678"
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "wrong_person",
                      "disconnected"
                    ],
                    "description": "`wrong_person`: the number belongs to someone else. `disconnected`: the number no longer works."
                  },
                  "find_replacement": {
                    "type": "boolean",
                    "default": true,
                    "description": "Search for another number. Send `false` to only report the number."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Where to send the result of the new search. Defaults to the `webhook_url` of the original enrichment."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The number is reported",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrichment_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The contact's enrichment ID, for `GET /contacts/{id}`"
                    },
                    "reported": {
                      "type": "boolean",
                      "description": "Always `true`"
                    },
                    "replacement": {
                      "type": "string",
                      "enum": [
                        "searching",
                        "other_mobile_kept",
                        "not_allowed",
                        "skipped"
                      ],
                      "description": "`searching`: a new phone search is running. `other_mobile_kept`: the contact still has another mobile, so no search ran. `not_allowed`: your plan or role does not allow phone enrichment. `skipped`: you sent `find_replacement: false`."
                    },
                    "credits_refunded": {
                      "type": "boolean",
                      "description": "`true` when the report gave back the credits paid for the reported contact. Only with `find_replacement: false`"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "`GET /contacts/{id}` for this contact"
                    }
                  }
                },
                "example": {
                  "enrichment_id": "8f1c2a4e-5b6d-4e7f-9a0b-1c2d3e4f5a6b",
                  "reported": true,
                  "replacement": "searching",
                  "credits_refunded": false,
                  "status_url": "https://app.pipecorn.com/api/v2/contacts/8f1c2a4e-5b6d-4e7f-9a0b-1c2d3e4f5a6b"
                }
              }
            }
          },
          "400": {
            "description": "`linkedin_url`, `phone` or `reason` is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentsError"
                },
                "example": {
                  "error": "Missing required keys: reason"
                }
              }
            }
          },
          "404": {
            "description": "No contact with this LinkedIn URL is reachable with your key, or the number is not on it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentsError"
                },
                "example": {
                  "error": "Phone not found on this contact"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "`linkedin_url` is not a public profile URL, `phone` is not a valid number, `reason` is not `wrong_person` or `disconnected`, `find_replacement` is not a boolean, or `webhook_url` is not an http(s) URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentsError"
                },
                "example": {
                  "error": "Invalid reason, use one of: wrong_person, disconnected"
                }
              }
            }
          }
        },
        "tags": [
          "Enrichments"
        ],
        "operationId": "reportAWrongPhoneNumber"
      }
    },
    "/contacts/report_email": {
      "post": {
        "summary": "Report a wrong email address",
        "description": "Tell Pipecorn that an email address it returned for a contact is wrong, and search for another one.\n\nThe address is removed from the contact: [`GET /contacts/{id}`](/api-reference/endpoints/contacts/single_enrich), the enrichment webhook and later enrichments of the same person no longer return it. Unless `find_replacement` is `false`, a new search of the same type starts at once: a work email starts a work email search, a personal email a personal email search. It skips the providers that gave the wrong address, and runs only when no other verified email of the same type is left on the contact.\n\n**Credits:** reporting is free, and so is the new search, even when it finds an address. With `find_replacement: false`, the credits you paid for the address come back, unless the contact still has another verified email of the same type; `credits_refunded` says whether they did. A personal email search still needs account-level GDPR consent, like `personal_email` in [single enrichment](/api-reference/endpoints/enrichments/single).\n\n**Result:** the response comes back right away. While the search runs, `GET /contacts/{id}` answers `status: \"pending\"`. When it ends, the `webhook_url` (or the one sent with the original enrichment) receives the same payload as [single enrichment](/api-reference/endpoints/enrichments/single#receiving-results), with the new address in `email` (or `personal_email`) or none.\n\nThe report always lands when the contact and address are found: a plan without email enrichment, or a personal email without the consent, still removes the address and says in `replacement` why no search ran. An empty credit balance does not block the search. Reporting the same address again while its search runs does not start a second one.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_url",
                  "email",
                  "reason"
                ],
                "properties": {
                  "linkedin_url": {
                    "type": "string",
                    "description": "LinkedIn profile URL of the contact, as sent to the enrichment.",
                    "example": "https://www.linkedin.com/in/william-hewish"
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "The wrong address, as Pipecorn returned it: a work email or a personal email. Use the full address.",
                    "example": "william.hewish@acme.com"
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "invalid_address",
                      "wrong_domain",
                      "wrong_person"
                    ],
                    "description": "`invalid_address`: the address bounces or does not exist. `wrong_domain`: the address is at a company the person no longer works for, or at the wrong company. `wrong_person`: the address belongs to someone else."
                  },
                  "find_replacement": {
                    "type": "boolean",
                    "default": true,
                    "description": "Search for another address. Send `false` to only report the address."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Where to send the result of the new search. Defaults to the `webhook_url` of the original enrichment."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The address is reported",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrichment_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "The contact's enrichment ID, for `GET /contacts/{id}`"
                    },
                    "reported": {
                      "type": "boolean",
                      "description": "Always `true`"
                    },
                    "replacement": {
                      "type": "string",
                      "enum": [
                        "searching",
                        "other_email_kept",
                        "not_allowed",
                        "skipped"
                      ],
                      "description": "`searching`: a new email search of the same type is running. `other_email_kept`: the contact still has another verified email of the same type, so no search ran. `not_allowed`: your plan or role does not allow this email enrichment, or the account has not consented to personal email enrichment. `skipped`: you sent `find_replacement: false`."
                    },
                    "credits_refunded": {
                      "type": "boolean",
                      "description": "`true` when the report gave back the credits paid for the reported contact. Only with `find_replacement: false`"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "`GET /contacts/{id}` for this contact"
                    }
                  }
                },
                "example": {
                  "enrichment_id": "8f1c2a4e-5b6d-4e7f-9a0b-1c2d3e4f5a6b",
                  "reported": true,
                  "replacement": "searching",
                  "credits_refunded": false,
                  "status_url": "https://app.pipecorn.com/api/v2/contacts/8f1c2a4e-5b6d-4e7f-9a0b-1c2d3e4f5a6b"
                }
              }
            }
          },
          "400": {
            "description": "`linkedin_url`, `email` or `reason` is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentsError"
                },
                "example": {
                  "error": "Missing required keys: reason"
                }
              }
            }
          },
          "404": {
            "description": "No contact with this LinkedIn URL is reachable with your key, or the address is not on it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentsError"
                },
                "example": {
                  "error": "Email not found on this contact"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "`linkedin_url` is not a public profile URL, `email` is not a full address, `reason` is not `invalid_address`, `wrong_domain` or `wrong_person`, `find_replacement` is not a boolean, or `webhook_url` is not an http(s) URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentsError"
                },
                "example": {
                  "error": "Invalid email, use a full address (e.g. jane@acme.com)"
                }
              }
            }
          }
        },
        "tags": [
          "Enrichments"
        ],
        "operationId": "reportAWrongEmailAddress"
      }
    },
    "/intents/leads/posts": {
      "post": {
        "summary": "Extract posts from a LinkedIn profile or company page",
        "description": "Returns up to the specified limit of posts for a LinkedIn person profile or company page. The URL is detected automatically: company page URLs use the organization feed; profile URLs use the member profile feed. Results can be narrowed with `posted_within`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_url",
                  "limit"
                ],
                "properties": {
                  "linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn profile URL (e.g. `/in/...`) or company page URL (e.g. `/company/...`)",
                    "example": "https://www.linkedin.com/in/john-doe"
                  },
                  "linkedin_profile_url": {
                    "type": "string",
                    "format": "uri",
                    "deprecated": true,
                    "description": "Alias of `linkedin_url`, still accepted. Use `linkedin_url` in new integrations."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of posts to return",
                    "minimum": 1,
                    "example": 5
                  },
                  "posted_within": {
                    "type": "string",
                    "enum": [
                      "last_24_hours",
                      "last_7_days",
                      "last_30_days"
                    ],
                    "description": "Only include posts published within this window. Omit for no recency filter."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully extracted posts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "author": {
                            "type": "string",
                            "description": "Post author name",
                            "example": "Jane Smith"
                          },
                          "author_url": {
                            "type": "string",
                            "format": "uri",
                            "description": "LinkedIn profile URL of the post author",
                            "example": "https://www.linkedin.com/in/jane-smith"
                          },
                          "content": {
                            "type": "string",
                            "description": "Post text content",
                            "example": "Post content text..."
                          },
                          "id": {
                            "type": "string",
                            "description": "Post ID",
                            "example": "1234567890123456789"
                          },
                          "urn": {
                            "type": "string",
                            "description": "LinkedIn URN for the post",
                            "example": "urn:li:activity:1234567890123456789"
                          },
                          "base_url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Base post URL",
                            "example": "https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789"
                          },
                          "post_url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Full post URL",
                            "example": "https://www.linkedin.com/posts/jane-smith_post-title-activity-1234567890123456789-abcd"
                          },
                          "published_at": {
                            "type": "string",
                            "format": "date",
                            "description": "Date when the post was published (YYYY-MM-DD)",
                            "example": "2026-03-11"
                          },
                          "engagement_count": {
                            "type": "integer",
                            "description": "Total engagement on the post (reactions + comments)",
                            "example": 142
                          },
                          "reactions_count": {
                            "type": "integer",
                            "description": "Number of reactions on the post",
                            "example": 128
                          },
                          "comments_count": {
                            "type": "integer",
                            "description": "Number of comments on the post",
                            "example": 14
                          }
                        }
                      },
                      "description": "Posts from the profile or company page, after optional recency filtering"
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "missing_limit": {
                    "value": {
                      "error": "Missing required keys: limit"
                    }
                  },
                  "missing_linkedin_url": {
                    "value": {
                      "error": "Missing required keys: linkedin_url"
                    }
                  },
                  "invalid_posted_within": {
                    "value": {
                      "error": "Invalid posted_within. Use last_24_hours, last_7_days, last_30_days, or omit the key."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "LinkedIn answered not found while the posts were fetched. A profile or company page that cannot be resolved from the URL is not an error: it returns `200` with an empty `posts` array.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "Couldn't find resource on LinkedIn. Please make sure it exists and that you have the right permissions to access it."
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "The LinkedIn connection is missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "linkedin_not_found": {
                    "summary": "No LinkedIn connection",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "linkedin_expired": {
                    "summary": "LinkedIn credentials expired",
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "extractPostsFromALinkedinProfileOrCompanyPage"
      }
    },
    "/intents/leads/comments": {
      "post": {
        "summary": "Extract comments from a LinkedIn profile",
        "description": "Extract comments left by a LinkedIn profile on other posts. Uses the voyagerFeedDashProfileUpdates endpoint and paginates until all comments are retrieved or the requested limit is reached.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_url",
                  "limit"
                ],
                "properties": {
                  "linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn profile URL to extract comments from",
                    "example": "https://www.linkedin.com/in/john-doe"
                  },
                  "linkedin_profile_url": {
                    "type": "string",
                    "format": "uri",
                    "deprecated": true,
                    "description": "Alias of `linkedin_url`, still accepted. Use `linkedin_url` in new integrations."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of comments to extract, from 1 to 20. Larger values are treated as 20.",
                    "minimum": 1,
                    "example": 10,
                    "maximum": 20
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully extracted comments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "comments": {
                      "type": "array",
                      "description": "Array of comments left by the LinkedIn profile",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Numeric activity ID extracted from the URN",
                            "example": "1234567890123456789"
                          },
                          "comment_url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Full LinkedIn URL with commentUrn query parameter linking directly to the comment",
                            "example": "https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789?commentUrn=urn%3Ali%3Acomment%3A%28urn%3Ali%3Aactivity%3A1234567890123456789%2C9876543210987654321%29"
                          },
                          "author": {
                            "type": "string",
                            "description": "Full name of the commenter",
                            "example": "John Doe"
                          },
                          "author_url": {
                            "type": "string",
                            "format": "uri",
                            "description": "LinkedIn profile URL of the commenter",
                            "example": "https://www.linkedin.com/in/john-doe"
                          },
                          "comment_text": {
                            "type": "string",
                            "description": "Text content of the comment",
                            "example": "Great point - we've been seeing the same pattern."
                          },
                          "commented_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "ISO 8601 timestamp of when the comment was posted",
                            "example": "2026-03-11T14:17:00Z"
                          },
                          "urn": {
                            "type": "string",
                            "description": "LinkedIn URN identifying the comment",
                            "example": "urn:li:comment:(urn:li:activity:1234567890123456789,9876543210987654321)"
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "missing_required": {
                    "value": {
                      "error": "Missing required keys: linkedin_url, limit"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "LinkedIn profile not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "Couldn't find resource on LinkedIn. Please make sure it exists and that you have the right permissions to access it."
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "The LinkedIn connection is missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "linkedin_not_found": {
                    "summary": "No LinkedIn connection",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "linkedin_expired": {
                    "summary": "LinkedIn credentials expired",
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "extractCommentsFromALinkedinProfile"
      }
    },
    "/intents/leads/reactions": {
      "post": {
        "summary": "Extract reactions from a LinkedIn profile",
        "description": "Extract reactions left by a LinkedIn profile on other posts. Paginates through the profile's feed activity and filters for reaction-type elements, returning up to the specified limit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_url",
                  "limit"
                ],
                "properties": {
                  "linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn profile URL to extract reactions from",
                    "example": "https://www.linkedin.com/in/john-doe"
                  },
                  "linkedin_profile_url": {
                    "type": "string",
                    "format": "uri",
                    "deprecated": true,
                    "description": "Alias of `linkedin_url`, still accepted. Use `linkedin_url` in new integrations."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of reactions to extract, from 1 to 20. Larger values are treated as 20.",
                    "minimum": 1,
                    "example": 10,
                    "maximum": 20
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully extracted reactions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reactions": {
                      "type": "array",
                      "description": "Array of reactions left by the LinkedIn profile on other posts",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Numeric activity ID extracted from the URN",
                            "example": "1234567890123456789"
                          },
                          "reaction_type": {
                            "type": "string",
                            "enum": [
                              "LIKE",
                              "CELEBRATE",
                              "INSIGHTFUL",
                              "FUNNY",
                              "SUPPORT",
                              "LOVE"
                            ],
                            "description": "Type of LinkedIn reaction",
                            "example": "CELEBRATE"
                          },
                          "post_url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Full LinkedIn URL of the post that was reacted to",
                            "example": "https://www.linkedin.com/posts/jane-smith_post-title-activity-1234567890123456789-abcd"
                          },
                          "author": {
                            "type": "string",
                            "description": "Full name of the post author",
                            "example": "Jane Smith"
                          },
                          "author_url": {
                            "type": "string",
                            "format": "uri",
                            "description": "LinkedIn profile URL of the post author (tracking params stripped)",
                            "example": "https://www.linkedin.com/in/jane-smith"
                          },
                          "reacted_at": {
                            "type": "string",
                            "format": "date",
                            "description": "Date when the reaction was made (YYYY-MM-DD)",
                            "example": "2026-03-11"
                          },
                          "urn": {
                            "type": "string",
                            "description": "LinkedIn URN identifying the activity",
                            "example": "urn:li:activity:1234567890123456789"
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "missing_required": {
                    "value": {
                      "error": "Missing required keys: linkedin_url, limit"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "LinkedIn profile not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "Couldn't find resource on LinkedIn. Please make sure it exists and that you have the right permissions to access it."
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "The LinkedIn connection is missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "linkedin_not_found": {
                    "summary": "No LinkedIn connection",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "linkedin_expired": {
                    "summary": "LinkedIn credentials expired",
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "extractReactionsFromALinkedinProfile"
      }
    },
    "/intents/leads/posts_engagers": {
      "post": {
        "summary": "Extract post engagers",
        "description": "Start an asynchronous extraction of leads that engaged with a LinkedIn post.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "post_url",
                  "webhook_url",
                  "engagement_type"
                ],
                "properties": {
                  "post_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Valid LinkedIn post URL (use the link from the \"share\" button)",
                    "example": "https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789"
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to receive the extracted engagers when the job completes",
                    "example": "https://your-company.com/webhooks/post-engagers"
                  },
                  "engagement_type": {
                    "type": "string",
                    "enum": [
                      "reactions",
                      "comments",
                      "all"
                    ],
                    "description": "Which engagements to extract: reactions only, comments only, or all",
                    "example": "all"
                  },
                  "persona": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional persona UUID to filter engagers",
                    "example": "550e8400-e29b-41d4-a716-446655440000"
                  },
                  "lead_list_name": {
                    "type": "string",
                    "description": "Custom name for the search (defaults to \"Social Post Tracking - <timestamp>\")",
                    "example": "Q1 campaign post engagers"
                  },
                  "company_size": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Optional company size filters for engagers"
                  },
                  "exclude_people_from_same_company": {
                    "type": "boolean",
                    "description": "Whether to exclude engagers from the same company as the post author",
                    "example": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Post engagement extraction started; results will be sent to the webhook",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Post engagement extraction will begin shortly."
                        },
                        "search_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier for the search",
                          "example": "550e8400-e29b-41d4-a716-446655440000"
                        },
                        "post_url": {
                          "type": "string",
                          "format": "uri",
                          "description": "The post URL being tracked"
                        },
                        "expected_profiles_count": {
                          "type": "integer",
                          "description": "Number of profiles that will be extracted and sent to the webhook",
                          "example": 150
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the search: `GET /searches/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                },
                "example": {
                  "message": {
                    "message": "Post engagement extraction will begin shortly.",
                    "search_id": "550e8400-e29b-41d4-a716-446655440000",
                    "post_url": "https://www.linkedin.com/posts/activity-7123456789012345678",
                    "expected_profiles_count": 150
                  },
                  "status_url": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this search, `GET /searches/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "202": {
            "description": "Scale plan only: your daily profile scraping quota cannot cover the request right now, so it is queued instead of refused. It starts automatically once the quota resets; until then its status URL reports `NOT_STARTED`. The body is the `201` body plus `status` and `notice`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "status_url",
                    "status",
                    "notice"
                  ],
                  "properties": {
                    "message": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Post engagement extraction will begin shortly."
                        },
                        "search_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Unique identifier for the search",
                          "example": "550e8400-e29b-41d4-a716-446655440000"
                        },
                        "post_url": {
                          "type": "string",
                          "format": "uri",
                          "description": "The post URL being tracked"
                        },
                        "expected_profiles_count": {
                          "type": "integer",
                          "description": "Number of profiles that will be extracted and sent to the webhook",
                          "example": 150
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the search: `GET /searches/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ],
                      "description": "Always `queued`: the request waits for the quota to reset.",
                      "example": "queued"
                    },
                    "notice": {
                      "type": "string",
                      "description": "Why the request is queued.",
                      "example": "Plan limit reached. The request is queued and starts automatically once your quota resets."
                    }
                  }
                },
                "example": {
                  "message": {
                    "message": "Post engagement extraction will begin shortly.",
                    "search_id": "550e8400-e29b-41d4-a716-446655440000",
                    "post_url": "https://www.linkedin.com/posts/activity-7123456789012345678",
                    "expected_profiles_count": 150
                  },
                  "status": "queued",
                  "notice": "Plan limit reached. The request is queued and starts automatically once your quota resets.",
                  "status_url": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this search, `GET /searches/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad request (missing required keys, invalid post URL, or invalid engagement_type)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "missing_keys": {
                    "value": {
                      "error": "Missing required keys: post_url, webhook_url, engagement_type"
                    }
                  },
                  "invalid_post_url": {
                    "value": {
                      "error": "Valid LinkedIn post URL is required. Use the link obtained after clicking on \"share\" button"
                    }
                  },
                  "invalid_engagement_type": {
                    "value": {
                      "error": "Invalid engagement_type. Must be one of: reactions, comments, all"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Post engager extraction is part of the Growth plan; accounts below it are refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "This signal is part of the Growth plan. Upgrade to save these leads to a list."
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Unprocessable (persona not found, post ID not found, plan limit reached (on the Scale plan the request is queued with `202` instead, unless it is larger than a whole period's quota), or the LinkedIn connection is missing or expired)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "persona_not_found": {
                    "value": {
                      "error": "Persona not found"
                    }
                  },
                  "post_id_not_found": {
                    "value": {
                      "error": "Post ID not found"
                    }
                  },
                  "plan_limit": {
                    "value": {
                      "error": "Can't proceed with the request. Plan limit reached."
                    }
                  },
                  "linkedin_not_found": {
                    "summary": "No LinkedIn connection",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "linkedin_expired": {
                    "summary": "LinkedIn credentials expired",
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "extractPostEngagers"
      }
    },
    "/intents/leads/competitor_followers/preview": {
      "post": {
        "summary": "Preview competitor followers",
        "description": "Look up a company's LinkedIn page and return its follower count and the price of extracting its followers. Free: spends no credits. Requires a connected LinkedIn account. The extract-only keys (`limit`, `persona`, `webhook_url`, `name`) are accepted and ignored, so one body works for both the preview and `POST /intents/leads/competitor_followers`. Unknown keys return 422.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "company_linkedin_url"
                ],
                "properties": {
                  "company_linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn company page URL of the competitor: `/company/<name>`, `/school/<name>` or `/showcase/<name>`. A numeric `/company/<id>` URL works when the LinkedIn account has Sales Navigator.",
                    "example": "https://www.linkedin.com/company/pipecorn"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Accepted and ignored."
                  },
                  "persona": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Accepted and ignored."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Accepted and ignored."
                  },
                  "name": {
                    "type": "string",
                    "description": "Accepted and ignored."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The company and the price of extracting its followers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "company",
                    "follower_count",
                    "credits_per_follower",
                    "minimum_credits",
                    "estimated_credits"
                  ],
                  "properties": {
                    "company": {
                      "type": "object",
                      "description": "The company LinkedIn returned. Fields LinkedIn leaves blank are omitted.",
                      "properties": {
                        "name": {
                          "type": "string",
                          "example": "Pipecorn"
                        },
                        "linkedin_id": {
                          "type": "string",
                          "example": "12345678"
                        },
                        "linkedin_url": {
                          "type": "string",
                          "format": "uri",
                          "example": "https://www.linkedin.com/company/pipecorn"
                        },
                        "industry": {
                          "type": "string",
                          "example": "Software Development"
                        },
                        "employee_range": {
                          "type": "string",
                          "example": "11-50"
                        },
                        "location": {
                          "type": "string",
                          "example": "Paris, Île-de-France"
                        }
                      }
                    },
                    "follower_count": {
                      "type": "integer",
                      "description": "People following the company page on LinkedIn.",
                      "example": 4210
                    },
                    "credits_per_follower": {
                      "type": "integer",
                      "description": "Enrichment credits charged per extracted follower.",
                      "example": 1
                    },
                    "minimum_credits": {
                      "type": "integer",
                      "description": "Minimum charge per extraction, whatever the number of followers.",
                      "example": 1000
                    },
                    "estimated_credits": {
                      "type": "integer",
                      "description": "Credits to extract every follower: `max(follower_count, minimum_credits)`.",
                      "example": 4210
                    }
                  }
                },
                "example": {
                  "company": {
                    "name": "Pipecorn",
                    "linkedin_id": "12345678",
                    "linkedin_url": "https://www.linkedin.com/company/pipecorn",
                    "industry": "Software Development",
                    "employee_range": "11-50",
                    "location": "Paris, Île-de-France"
                  },
                  "follower_count": 4210,
                  "credits_per_follower": 1,
                  "minimum_credits": 1000,
                  "estimated_credits": 4210
                }
              }
            }
          },
          "400": {
            "description": "`company_linkedin_url` is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "company_linkedin_url is required"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized (missing or invalid API key)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "404": {
            "description": "LinkedIn has no company page at this URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "Company not found on LinkedIn"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity: `company_linkedin_url` is not a LinkedIn company page URL, or the body has keys the endpoint does not accept (listed in `unauthorized_params`, next to every accepted key in `permitted_params`), or no usable LinkedIn connection on the account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "invalid_url": {
                    "summary": "Not a company page URL",
                    "value": {
                      "error": "company_linkedin_url must be a LinkedIn company page URL (e.g. https://www.linkedin.com/company/pipecorn)"
                    }
                  },
                  "unknown_parameter": {
                    "summary": "Unknown key in the body",
                    "value": {
                      "error": "Unauthorized parameters detected",
                      "unauthorized_params": [
                        "company"
                      ],
                      "permitted_params": [
                        "company_linkedin_url",
                        "limit",
                        "persona",
                        "webhook_url",
                        "name"
                      ]
                    }
                  },
                  "linkedin_not_connected": {
                    "summary": "No usable LinkedIn connection",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "LinkedIn rate limited the connected account during the company lookup. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "502": {
            "description": "The LinkedIn company lookup failed. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "LinkedIn request failed. Please retry later."
                }
              }
            }
          }
        },
        "tags": [
          "Signals"
        ],
        "operationId": "previewCompetitorFollowers"
      }
    },
    "/intents/leads/competitor_followers": {
      "post": {
        "summary": "Extract competitor followers",
        "description": "Start an asynchronous extraction of the people who follow a company's LinkedIn page. Costs 1 enrichment credit per follower with a minimum of 1,000 credits per extraction; the credits are reserved when the request is accepted and the unused part is refunded when fewer followers come back. Part of the Growth plan. Requires a connected LinkedIn account. Poll `status_url` (`GET /searches/{id}`) until `status` is `finished`; with `webhook_url` the leads are also posted there. Unknown keys return 422.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "company_linkedin_url",
                  "limit"
                ],
                "properties": {
                  "company_linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn company page URL of the competitor: `/company/<name>`, `/school/<name>` or `/showcase/<name>`. A numeric `/company/<id>` URL works when the LinkedIn account has Sales Navigator.",
                    "example": "https://www.linkedin.com/company/pipecorn"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Number of followers to extract. Capped to the company's follower count. Any value below 1,000 is still charged 1,000 credits.",
                    "example": 2000
                  },
                  "persona": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Persona UUID: keep only the followers who match its Sales Navigator search.",
                    "example": "550e8400-e29b-41d4-a716-446655440000"
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL that receives the leads when the extraction finishes, in the same payload as other searches.",
                    "example": "https://your-company.com/webhooks/competitor-followers"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 75,
                    "description": "Name of the lead list. Defaults to `Followers of <company>`.",
                    "example": "Followers of Pipecorn - Q4"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Extraction started",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "search_id",
                    "company",
                    "follower_count",
                    "expected_profiles_count",
                    "credits_reserved",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Competitor followers extraction started. Results land on the search once the scrape finishes."
                    },
                    "search_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "ID of the search the followers land on.",
                      "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    },
                    "company": {
                      "type": "object",
                      "description": "The company LinkedIn returned. Fields LinkedIn leaves blank are omitted.",
                      "properties": {
                        "name": {
                          "type": "string",
                          "example": "Pipecorn"
                        },
                        "linkedin_id": {
                          "type": "string",
                          "example": "12345678"
                        },
                        "linkedin_url": {
                          "type": "string",
                          "format": "uri",
                          "example": "https://www.linkedin.com/company/pipecorn"
                        },
                        "industry": {
                          "type": "string",
                          "example": "Software Development"
                        },
                        "employee_range": {
                          "type": "string",
                          "example": "11-50"
                        },
                        "location": {
                          "type": "string",
                          "example": "Paris, Île-de-France"
                        }
                      }
                    },
                    "follower_count": {
                      "type": "integer",
                      "example": 4210
                    },
                    "expected_profiles_count": {
                      "type": "integer",
                      "description": "Followers that will be extracted: `limit`, capped to `follower_count`.",
                      "example": 2000
                    },
                    "credits_reserved": {
                      "type": "integer",
                      "description": "Credits reserved for this extraction: `max(expected_profiles_count, 1000)`.",
                      "example": 2000
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the extraction: `GET /searches/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                },
                "example": {
                  "message": "Competitor followers extraction started. Results land on the search once the scrape finishes.",
                  "search_id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                  "company": {
                    "name": "Pipecorn",
                    "linkedin_id": "12345678",
                    "linkedin_url": "https://www.linkedin.com/company/pipecorn",
                    "industry": "Software Development",
                    "employee_range": "11-50",
                    "location": "Paris, Île-de-France"
                  },
                  "follower_count": 4210,
                  "expected_profiles_count": 2000,
                  "credits_reserved": 2000,
                  "status_url": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this extraction, `GET /searches/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "`company_linkedin_url` or `limit` is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "limit is required"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized (missing or invalid API key)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits for the extraction. No extraction starts and nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits. You need 2000 credits but only have 350 available.",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "Competitor followers is part of the Growth plan; accounts below it are refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "This signal is part of the Growth plan. Upgrade to save these leads to a list."
                }
              }
            }
          },
          "404": {
            "description": "LinkedIn has no company page at this URL, or `persona` is not a persona of the account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "company": {
                    "summary": "Unknown company",
                    "value": {
                      "error": "Company not found on LinkedIn"
                    }
                  },
                  "persona": {
                    "summary": "Unknown persona",
                    "value": {
                      "error": "Persona not found"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity: invalid `company_linkedin_url`, `limit` or `webhook_url`, a company with no followers, or keys the endpoint does not accept, or no usable LinkedIn connection on the account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "no_followers": {
                    "summary": "Company without followers",
                    "value": {
                      "error": "This company has no followers to extract"
                    }
                  },
                  "invalid_limit": {
                    "summary": "limit is not a positive integer",
                    "value": {
                      "error": "Limit must be greater than 0"
                    }
                  },
                  "unknown_parameter": {
                    "summary": "Unknown key in the body",
                    "value": {
                      "error": "Unauthorized parameters detected",
                      "unauthorized_params": [
                        "company"
                      ],
                      "permitted_params": [
                        "company_linkedin_url",
                        "limit",
                        "persona",
                        "webhook_url",
                        "name"
                      ]
                    }
                  },
                  "linkedin_not_connected": {
                    "summary": "No usable LinkedIn connection",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "LinkedIn rate limited the connected account during the company lookup. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "502": {
            "description": "The LinkedIn company lookup failed. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "LinkedIn request failed. Please retry later."
                }
              }
            }
          }
        },
        "tags": [
          "Signals"
        ],
        "operationId": "extractCompetitorFollowers"
      }
    },
    "/intents/leads/lookalikes/preview": {
      "post": {
        "summary": "Preview lookalike leads",
        "description": "Build the Sales Navigator search for people similar to a LinkedIn profile (similar titles, same industry, company size and tenure) and return its count, URL and up to 25 sample leads. Free. Requires a connected Sales Navigator account. The extract-only keys (`limit`, `webhook_url`, `name`) are accepted and ignored. Unknown keys return 422.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_url"
                ],
                "properties": {
                  "linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn profile of the person to find lookalikes of.",
                    "example": "https://www.linkedin.com/in/jane-doe"
                  },
                  "extended": {
                    "type": "boolean",
                    "default": false,
                    "description": "Widen the search: drop the tenure filter and include the neighbouring company sizes."
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Sales Navigator location IDs (numeric). Get them from POST /locations with live results. An ID from another source returns `422`.",
                    "example": [
                      "105015875"
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Sales Navigator location IDs to exclude.",
                    "example": [
                      "105015875"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Accepted and ignored."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Accepted and ignored."
                  },
                  "name": {
                    "type": "string",
                    "description": "Accepted and ignored."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The lookalike search",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total_count",
                    "search_url",
                    "preview"
                  ],
                  "properties": {
                    "total_count": {
                      "type": "integer",
                      "example": 840
                    },
                    "search_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Sales Navigator people search built from the profile."
                    },
                    "preview": {
                      "type": "array",
                      "maxItems": 25,
                      "items": {
                        "type": "object",
                        "properties": {
                          "full_name": {
                            "type": "string"
                          },
                          "headline": {
                            "type": "string"
                          },
                          "current_company": {
                            "type": "string"
                          },
                          "current_title": {
                            "type": "string"
                          },
                          "linkedin_id": {
                            "type": "string"
                          },
                          "profile_url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "total_count": 840,
                  "search_url": "https://www.linkedin.com/sales/search/people?query=(filters%3AList(...))",
                  "preview": [
                    {
                      "full_name": "John Roe",
                      "headline": "VP Sales at Acme",
                      "current_company": "Acme",
                      "current_title": "VP Sales",
                      "linkedin_id": "123456789",
                      "profile_url": "https://www.linkedin.com/in/ACwAAA..."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`linkedin_url` is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "linkedin_url is required"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized (missing or invalid API key)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "404": {
            "description": "LinkedIn does not return this profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "Profile not found on LinkedIn"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity: invalid `linkedin_url`, `extended`, locations, `limit` or `webhook_url`; no usable LinkedIn or Sales Navigator connection; or keys the endpoint does not accept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "invalid_url": {
                    "summary": "Not a profile URL",
                    "value": {
                      "error": "linkedin_url must be a LinkedIn profile URL (e.g. https://www.linkedin.com/in/jane-doe)"
                    }
                  },
                  "unknown_parameter": {
                    "summary": "Unknown key in the body",
                    "value": {
                      "error": "Unauthorized parameters detected",
                      "unauthorized_params": [
                        "job_titles"
                      ],
                      "permitted_params": [
                        "linkedin_url",
                        "extended",
                        "included_locations",
                        "excluded_locations",
                        "limit",
                        "webhook_url",
                        "name"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "LinkedIn rate limited the connected account. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          }
        },
        "tags": [
          "Signals"
        ],
        "operationId": "previewLookalikeLeads"
      }
    },
    "/intents/leads/lookalikes": {
      "post": {
        "summary": "Extract lookalike leads",
        "description": "Save the lookalike search for a LinkedIn profile as an API lead search and extract its leads, like POST /leads/advanced_search. Uses the daily profile-extraction plan quota, not credits. Requires a connected Sales Navigator account. Poll `status_url` (`GET /searches/{id}`) or receive the leads on `webhook_url`. Unknown keys return 422.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_url"
                ],
                "properties": {
                  "linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn profile of the person to find lookalikes of.",
                    "example": "https://www.linkedin.com/in/jane-doe"
                  },
                  "extended": {
                    "type": "boolean",
                    "default": false,
                    "description": "Widen the search: drop the tenure filter and include the neighbouring company sizes."
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Sales Navigator location IDs (numeric). Get them from POST /locations with live results. An ID from another source returns `422`.",
                    "example": [
                      "105015875"
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Sales Navigator location IDs to exclude.",
                    "example": [
                      "105015875"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2500,
                    "description": "Leads to extract. Defaults to every match, capped at 2,500.",
                    "example": 200
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Receives the leads as the search runs.",
                    "example": "https://your-company.com/webhooks/lookalikes"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the search.",
                    "example": "Lookalikes of Jane"
                  },
                  "position": {
                    "type": "string",
                    "enum": [
                      "start",
                      "end"
                    ],
                    "default": "end",
                    "description": "With a workspace key, where the search joins the workspace queue: `end` behind the searches already waiting, or `start` to run it next. Ignored with a personal key."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "No one matches; no search was created.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total_count": {
                      "type": "integer",
                      "example": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "No similar profiles found, so no search was created"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Search created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "UUID of the search."
                        },
                        "search_name": {
                          "type": "string"
                        },
                        "search_url": {
                          "type": "string",
                          "format": "uri",
                          "description": "Sales Navigator search built from the profile."
                        },
                        "expected_profiles_count": {
                          "type": "integer",
                          "description": "People matching before `limit`, capped at 2,500."
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "`GET /searches/{id}`. Same value as the `Location` header."
                    }
                  }
                },
                "example": {
                  "message": {
                    "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                    "search_name": "Lookalikes - API - 18/11/2026 15:02",
                    "search_url": "https://www.linkedin.com/sales/search/people?query=(filters%3AList(...))",
                    "expected_profiles_count": 840,
                    "created_at": "2026-11-18T15:02:11Z"
                  },
                  "status_url": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "`GET /searches/{id}`",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "`linkedin_url` is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "linkedin_url is required"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized (missing or invalid API key)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "404": {
            "description": "LinkedIn does not return this profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "example": {
                  "error": "Profile not found on LinkedIn"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity: invalid `linkedin_url`, `extended`, locations, `limit` or `webhook_url`; no usable LinkedIn or Sales Navigator connection; or keys the endpoint does not accept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "invalid_url": {
                    "summary": "Not a profile URL",
                    "value": {
                      "error": "linkedin_url must be a LinkedIn profile URL (e.g. https://www.linkedin.com/in/jane-doe)"
                    }
                  },
                  "unknown_parameter": {
                    "summary": "Unknown key in the body",
                    "value": {
                      "error": "Unauthorized parameters detected",
                      "unauthorized_params": [
                        "job_titles"
                      ],
                      "permitted_params": [
                        "linkedin_url",
                        "extended",
                        "included_locations",
                        "excluded_locations",
                        "limit",
                        "webhook_url",
                        "name"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "LinkedIn rate limited the connected account. Retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          }
        },
        "tags": [
          "Signals"
        ],
        "operationId": "extractLookalikeLeads"
      }
    },
    "/intents/accounts/hiring": {
      "post": {
        "summary": "Create hiring intent for accounts",
        "description": "Start a company hiring-intent search based on job posting activity. Only documented fields are allowed; unknown keys return 422.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "webhook_url"
                ],
                "properties": {
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to receive hiring intent notifications",
                    "example": "https://your-company.com/webhooks/hiring"
                  },
                  "streaming": {
                    "type": "boolean",
                    "description": "When `true`, the companies are posted to the webhook one request per company once the search finishes, instead of in one payload. Default `false`.",
                    "example": false
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Maximum number of companies to return",
                    "example": 100
                  },
                  "published_date": {
                    "type": "string",
                    "description": "Relative publish-date filter for jobs",
                    "enum": [
                      "last_24_hours",
                      "last_7_days",
                      "last_15_days",
                      "last_30_days",
                      "last_90_days",
                      "last_180_days",
                      "last_360_days"
                    ],
                    "example": "last_30_days"
                  },
                  "exclude_consulting_recruiting": {
                    "type": "boolean",
                    "description": "Exclude consulting and recruiting job postings",
                    "example": true
                  },
                  "exclude_internships": {
                    "type": "boolean",
                    "description": "Exclude internship job postings",
                    "example": true
                  },
                  "company_size": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn-style company size ranges (en-dashes are normalized to hyphens server-side)",
                    "example": [
                      "51-200",
                      "201-500"
                    ]
                  },
                  "selected_keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Keywords to match in job postings",
                    "example": [
                      "sales",
                      "account executive"
                    ]
                  },
                  "excluded_keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Keywords to exclude from job postings",
                    "example": [
                      "intern",
                      "junior"
                    ]
                  },
                  "selected_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Job titles to include",
                    "example": [
                      "Account Executive",
                      "Sales Development Representative"
                    ]
                  },
                  "excluded_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Job titles to exclude",
                    "example": [
                      "Intern",
                      "Manager"
                    ]
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Hiring location IDs; only jobs posted in these locations count. Get them from `POST /locations` with `\"source\": \"hiring\"` (the integer `id` of each result). Location names are not accepted, and IDs from the `live` or `database` location sources return `422`.",
                    "example": [
                      4671654
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "Hiring location IDs whose jobs are ignored. Same catalog as `included_locations`: `POST /locations` with `\"source\": \"hiring\"`. An ID from another source returns `422`.",
                    "example": [
                      5128581
                    ]
                  },
                  "included_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Industry IDs to include",
                    "example": [
                      "4"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "No matching companies; no import created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total_count",
                    "total_available",
                    "message"
                  ],
                  "properties": {
                    "total_count": {
                      "type": "integer",
                      "example": 0
                    },
                    "total_available": {
                      "type": "integer",
                      "example": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "No results found"
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Hiring intent search started successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "object",
                      "required": [
                        "total_count",
                        "total_available",
                        "message",
                        "id"
                      ],
                      "properties": {
                        "total_count": {
                          "type": "integer",
                          "description": "Companies that will be imported (capped by `limit`).",
                          "example": 42
                        },
                        "total_available": {
                          "type": "integer",
                          "description": "Full match count.",
                          "example": 128
                        },
                        "message": {
                          "type": "string",
                          "example": "Hiring intent search started successfully. You will receive the results on your webhook shortly."
                        },
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Import job UUID",
                          "example": "5d4fabd2-e26d-47d1-b0de-4bf370f7b799"
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the import: `GET /lists/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                },
                "example": {
                  "message": {
                    "total_count": 42,
                    "total_available": 128,
                    "message": "Hiring intent search started successfully. You will receive the results on your webhook shortly.",
                    "id": "5d4fabd2-e26d-47d1-b0de-4bf370f7b799"
                  },
                  "status_url": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this import, `GET /lists/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized (missing or invalid API key)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits for the companies that would be imported (3 credits per company). No import is created and nothing is spent. The message reports the shortfall.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits. You need 30 credits but only have 5 available.",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "The workspace weekly enrichment credit limit is reached. Buying credits does not lift it, so no `top_up_url` is returned, and no import is created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceLimitError"
                },
                "example": {
                  "error": "You have reached your weekly enrichment credit limit for this workspace",
                  "code": "workspace_limit_exceeded"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Unprocessable entity (invalid published_date, unknown parameters, or invalid optional filters)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "unknown_parameter": {
                    "summary": "Unknown key in the body (permitted_params lists the accepted keys you sent)",
                    "value": {
                      "error": "Unauthorized parameters detected",
                      "unauthorized_params": [
                        "country"
                      ],
                      "permitted_params": [
                        "webhook_url",
                        "selected_titles"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "createHiringIntentForAccounts"
      }
    },
    "/intents/accounts/growth": {
      "post": {
        "summary": "Create growth intent for accounts",
        "description": "Start a LinkedIn account (company) search by growth criteria. Only documented fields are allowed; unknown keys return 422.\n\n**Valid criteria (choose one mode):**\n1. **Company-wide headcount growth:** Provide at least one of `min_headcount_growth_percentage` or `max_headcount_growth_percentage`. Do not send `department` in this mode.\n2. **Department metrics:** Send `department` (LinkedIn function ID as a string, e.g. `\"1\"`) plus at least one of `min_department_headcount`, `max_department_headcount`, `min_department_headcount_growth_percentage`, or `max_department_headcount_growth_percentage`.\n\nDepartment fields cannot be combined with company-wide headcount growth fields.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "webhook_url"
                ],
                "properties": {
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to receive growth intent results when processing completes",
                    "example": "https://your-company.com/webhooks/growth"
                  },
                  "streaming": {
                    "type": "boolean",
                    "description": "Whether to stream results to the webhook as they are processed",
                    "example": false
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Maximum number of companies to import. If omitted, import volume is capped at 1000 even when the search finds more; response `total` reflects the effective count",
                    "example": 500
                  },
                  "min_headcount_growth_percentage": {
                    "type": "number",
                    "description": "Minimum company-wide headcount growth percentage (use with or without `max_headcount_growth_percentage`; not valid together with `department`)",
                    "example": 10
                  },
                  "max_headcount_growth_percentage": {
                    "type": "number",
                    "description": "Maximum company-wide headcount growth percentage (use with or without `min_headcount_growth_percentage`; not valid together with `department`)",
                    "example": 50
                  },
                  "department": {
                    "type": "string",
                    "description": "LinkedIn function ID to target (string, e.g. `\"1\"`). Required when using any department headcount or department growth field; must not be set together with company-wide headcount growth fields",
                    "example": "1"
                  },
                  "min_department_headcount": {
                    "type": "integer",
                    "description": "Minimum headcount in the selected department (requires `department`)",
                    "example": 5
                  },
                  "max_department_headcount": {
                    "type": "integer",
                    "description": "Maximum headcount in the selected department (requires `department`)",
                    "example": 100
                  },
                  "min_department_headcount_growth_percentage": {
                    "type": "number",
                    "description": "Minimum department headcount growth percentage (requires `department`)",
                    "example": 15
                  },
                  "max_department_headcount_growth_percentage": {
                    "type": "number",
                    "description": "Maximum department headcount growth percentage (requires `department`)",
                    "example": 80
                  },
                  "company_size": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn-style company size range strings (e.g. `51-200`). Unicode en-dashes in values are normalized to hyphens on the server",
                    "example": [
                      "51-200",
                      "201-500"
                    ]
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "LinkedIn Sales Navigator location IDs to include, from `POST /locations` with `\"source\": \"live\"`. An ID from another source returns `422`.",
                    "example": [
                      103644278
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "LinkedIn Sales Navigator location IDs to exclude, from the same source as `included_locations`.",
                    "example": []
                  },
                  "included_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Industry IDs to include",
                    "example": [
                      "4"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Search started; results are delivered to the webhook",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "id",
                    "total",
                    "preview",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation that the account search started",
                      "example": "Account search started successfully. You will receive the results on your webhook shortly."
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUID of the import job",
                      "example": "5d4fabd2-e26d-47d1-b0de-4bf370f7b799"
                    },
                    "total": {
                      "type": "integer",
                      "description": "Number of companies for this run: if `limit` is set, the lesser of search size and `limit`; otherwise the full search size (import may still cap at 1000)",
                      "example": 150
                    },
                    "preview": {
                      "type": "array",
                      "maxItems": 10,
                      "description": "Up to 10 sample companies from the search",
                      "items": {
                        "type": "object",
                        "properties": {
                          "company_name": {
                            "type": "string",
                            "example": "Acme Inc"
                          },
                          "industry": {
                            "type": "string",
                            "example": "Software Development"
                          },
                          "linkedin_id": {
                            "type": "string",
                            "description": "Numeric company ID extracted from the result",
                            "example": "123456"
                          },
                          "linkedin_url": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://www.linkedin.com/company/123456"
                          }
                        }
                      }
                    },
                    "account_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Present only in development environments (debugging)"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the import: `GET /lists/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this import, `GET /lists/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "202": {
            "description": "Scale plan only: your company import quota cannot cover the request right now, so it is queued instead of refused. It starts automatically once the quota resets; until then its status URL reports `NOT_STARTED`. The body is the `201` body plus `status` and `notice`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "id",
                    "total",
                    "preview",
                    "status_url",
                    "status",
                    "notice"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation that the account search started",
                      "example": "Account search started successfully. You will receive the results on your webhook shortly."
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUID of the import job",
                      "example": "5d4fabd2-e26d-47d1-b0de-4bf370f7b799"
                    },
                    "total": {
                      "type": "integer",
                      "description": "Number of companies for this run: if `limit` is set, the lesser of search size and `limit`; otherwise the full search size (import may still cap at 1000)",
                      "example": 150
                    },
                    "preview": {
                      "type": "array",
                      "maxItems": 10,
                      "description": "Up to 10 sample companies from the search",
                      "items": {
                        "type": "object",
                        "properties": {
                          "company_name": {
                            "type": "string",
                            "example": "Acme Inc"
                          },
                          "industry": {
                            "type": "string",
                            "example": "Software Development"
                          },
                          "linkedin_id": {
                            "type": "string",
                            "description": "Numeric company ID extracted from the result",
                            "example": "123456"
                          },
                          "linkedin_url": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://www.linkedin.com/company/123456"
                          }
                        }
                      }
                    },
                    "account_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Present only in development environments (debugging)"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the import: `GET /lists/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ],
                      "description": "Always `queued`: the request waits for the quota to reset.",
                      "example": "queued"
                    },
                    "notice": {
                      "type": "string",
                      "description": "Why the request is queued.",
                      "example": "Plan limit reached. The request is queued and starts automatically once your quota resets."
                    }
                  }
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this import, `GET /lists/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized (missing or invalid API key)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Unprocessable entity (invalid growth parameter combinations, unknown parameters, invalid `department`, invalid optional filters, plan limit reached for the result size (on the Scale plan the request is queued with `202` instead, unless it is larger than a whole period's quota), or Sales Navigator connection expired). The body carries a string `error`, usually a `message`, and details such as `unauthorized_params`, `valid_combinations` or `valid_departments` at the top level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "invalid_combination": {
                    "summary": "Invalid parameter combination",
                    "value": {
                      "error": "Invalid parameter combination",
                      "message": "Cannot combine department parameters with headcount growth parameters"
                    }
                  },
                  "unknown_parameter": {
                    "summary": "Unknown key in the body (permitted_params lists the accepted keys you sent)",
                    "value": {
                      "error": "Unauthorized parameters detected",
                      "unauthorized_params": [
                        "country"
                      ],
                      "permitted_params": [
                        "webhook_url",
                        "company_size"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "createGrowthIntentForAccounts"
      }
    },
    "/intents/accounts/lookalikes": {
      "post": {
        "summary": "Find company lookalikes",
        "description": "Find companies that look like your target accounts. Provide one or more LinkedIn company URLs; the API uses them to generate a lookalike search and streams results to your webhook.\n\nBy default (`live: true`) the search runs live on LinkedIn Sales Navigator, so a connected Sales Navigator account is required, and at most 1000 companies are imported (`total` is capped at 1000, then at `limit`). With `live: false` it runs on the Pipecorn companies database and needs no integration.\n\nLocation IDs come from the Location IDs endpoint, with the source matching `live`: `live` for `live: true`, `database` for `live: false`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "webhook_url"
                ],
                "properties": {
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL to receive lookalike results",
                    "example": "https://your-company.com/webhooks/lookalikes"
                  },
                  "company_linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Single LinkedIn company URL to use as reference (use this or company_linkedin_urls)",
                    "example": "https://www.linkedin.com/company/acme-corp"
                  },
                  "company_linkedin_urls": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    },
                    "description": "LinkedIn company URLs to use as reference, up to 3 used for LLM keyword generation (use this or company_linkedin_url)",
                    "example": [
                      "https://www.linkedin.com/company/acme-corp",
                      "https://www.linkedin.com/company/example-inc"
                    ]
                  },
                  "streaming": {
                    "type": "boolean",
                    "description": "Whether to stream results to the webhook as they are found",
                    "example": false
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of companies to import. Must be a positive integer.",
                    "minimum": 1,
                    "example": 100
                  },
                  "company_size": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Company size range filters (e.g. headcount bands)",
                    "example": [
                      "51-200",
                      "201-500"
                    ]
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to include, from `POST /locations` with the source matching `live` (`live` by default, `database` with `live: false`). An ID from another source returns `422`.",
                    "example": [
                      "103644278"
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to exclude, from the same source as `included_locations`",
                    "example": []
                  },
                  "live": {
                    "type": "boolean",
                    "default": true,
                    "example": true,
                    "description": "Data source. `true` (default) searches live on LinkedIn Sales Navigator and needs a connected Sales Navigator account. `false` uses the Pipecorn companies database. A non-boolean value returns `422`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Lookalike search started; results will be sent to the webhook",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message",
                      "example": "Lookalike search started successfully. You will receive the results on your webhook shortly."
                    },
                    "id": {
                      "type": "string",
                      "description": "Unique identifier for the import/search",
                      "example": "550e8400-e29b-41d4-a716-446655440000"
                    },
                    "total": {
                      "type": "integer",
                      "description": "Number of companies that will be imported: the match count, capped at 1000 with `live: true`, then at `limit`",
                      "example": 100
                    },
                    "preview": {
                      "type": "array",
                      "description": "First 10 matching companies as a preview",
                      "items": {
                        "type": "object",
                        "properties": {
                          "company_name": {
                            "type": "string",
                            "example": "Acme Corp"
                          },
                          "industry": {
                            "type": "string",
                            "example": "Software Development"
                          },
                          "linkedin_id": {
                            "type": "string",
                            "description": "LinkedIn company numeric ID",
                            "example": "12345"
                          },
                          "linkedin_url": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://www.linkedin.com/company/12345"
                          }
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the import: `GET /lists/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this import, `GET /lists/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "202": {
            "description": "Scale plan only: your company import quota cannot cover the request right now, so it is queued instead of refused. It starts automatically once the quota resets; until then its status URL reports `NOT_STARTED`. The body is the `201` body plus `status` and `notice`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Confirmation message",
                      "example": "Lookalike search started successfully. You will receive the results on your webhook shortly."
                    },
                    "id": {
                      "type": "string",
                      "description": "Unique identifier for the import/search",
                      "example": "550e8400-e29b-41d4-a716-446655440000"
                    },
                    "total": {
                      "type": "integer",
                      "description": "Number of companies that will be imported: the match count, capped at 1000 with `live: true`, then at `limit`",
                      "example": 100
                    },
                    "preview": {
                      "type": "array",
                      "description": "First 10 matching companies as a preview",
                      "items": {
                        "type": "object",
                        "properties": {
                          "company_name": {
                            "type": "string",
                            "example": "Acme Corp"
                          },
                          "industry": {
                            "type": "string",
                            "example": "Software Development"
                          },
                          "linkedin_id": {
                            "type": "string",
                            "description": "LinkedIn company numeric ID",
                            "example": "12345"
                          },
                          "linkedin_url": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://www.linkedin.com/company/12345"
                          }
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the import: `GET /lists/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ],
                      "description": "Always `queued`: the request waits for the quota to reset.",
                      "example": "queued"
                    },
                    "notice": {
                      "type": "string",
                      "description": "Why the request is queued.",
                      "example": "Plan limit reached. The request is queued and starts automatically once your quota resets."
                    }
                  }
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this import, `GET /lists/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad request (e.g. missing company URL, invalid URLs, or processing error)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "missing_url": {
                    "value": {
                      "error": "Either company_linkedin_url or company_linkedin_urls is required in your payload"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Invalid `live`, `limit`, `company_size` or locations, plan limit reached (on the Scale plan the request is queued with `202` instead, unless it is larger than a whole period's quota), or (`live: true`) the Sales Navigator connection is missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "invalid_live": {
                    "summary": "live is not a boolean",
                    "value": {
                      "error": "Invalid live value. Must be a boolean (true/false)"
                    }
                  },
                  "invalid_limit": {
                    "summary": "limit is not a whole number",
                    "value": {
                      "error": "Limit must be an integer"
                    }
                  },
                  "limit_not_positive": {
                    "summary": "limit is 0 or negative",
                    "value": {
                      "error": "Limit must be greater than 0"
                    }
                  },
                  "invalid_company_size": {
                    "summary": "company_size is not an array",
                    "value": {
                      "error": "Invalid company_size format",
                      "message": "Company size must be provided as an array"
                    }
                  },
                  "invalid_company_size_values": {
                    "summary": "Unknown company_size value",
                    "value": {
                      "error": "Invalid company_size values"
                    }
                  },
                  "invalid_location": {
                    "summary": "Locations are not arrays",
                    "value": {
                      "error": "Invalid location format",
                      "message": "Locations must be provided as an array of ids"
                    }
                  },
                  "sales_navigator_expired": {
                    "summary": "Sales Navigator credentials expired (live: true)",
                    "value": {
                      "error": "Sales Navigator credentials expired. Refresh your connection on Pipecorn interface, or set parameter 'live' to false in your request body"
                    }
                  },
                  "plan_limit": {
                    "summary": "Plan limit reached",
                    "value": {
                      "error": "Can't proceed with the request. Plan limit reached."
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "findCompanyLookalikes"
      }
    },
    "/intents/leads/find_new_hires": {
      "post": {
        "summary": "Find new hires",
        "description": "Creates a tracking task, run daily by default, that sends people who recently started a job matching your filters to your webhook.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "included_job_titles",
                  "webhook_url"
                ],
                "properties": {
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL that receives the new hires",
                    "example": "https://your-company.com/webhooks/new_hires"
                  },
                  "included_job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Job titles the new hires must hold",
                    "example": [
                      "VP of Sales",
                      "Head of Sales"
                    ]
                  },
                  "excluded_job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Job titles to exclude",
                    "example": [
                      "Assistant"
                    ]
                  },
                  "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": "`live: false` only. LinkedIn function (department) IDs (`FUNCTION`). Multiple IDs are combined with OR logic.\n\nID → 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": "`live: false` only. LinkedIn seniority level IDs (`SENIORITY_LEVEL`).\n\nID → 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"
                    ]
                  },
                  "excluded_seniority_levels": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "100",
                        "110",
                        "120",
                        "130",
                        "200",
                        "210",
                        "220",
                        "300",
                        "310",
                        "320"
                      ]
                    },
                    "description": "`live: false` only. LinkedIn seniority level IDs to exclude, on the same scale as `seniority_levels`.",
                    "example": [
                      "100",
                      "110"
                    ]
                  },
                  "years_in_current_position": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5",
                        "6",
                        "7",
                        "8"
                      ]
                    },
                    "description": "`live: false` only. Bucketed years in the current position: `\"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.",
                    "example": [
                      "3"
                    ]
                  },
                  "years_at_current_company": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "1",
                        "2",
                        "3",
                        "4",
                        "5",
                        "6",
                        "7",
                        "8"
                      ]
                    },
                    "description": "`live: false` only. Bucketed years at the current company: `\"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.",
                    "example": [
                      "2",
                      "3"
                    ]
                  },
                  "keyword": {
                    "type": "string",
                    "description": "`live: false` only. Free-text keyword matched against the people database profiles.",
                    "example": "saas"
                  },
                  "hire_type": {
                    "type": "string",
                    "enum": [
                      "new_hire",
                      "promoted"
                    ],
                    "description": "`live: false` only. `new_hire` keeps only people who joined a new company; `promoted` only people who moved to a new role in the same company. Leave it out to get both.",
                    "example": "new_hire"
                  },
                  "company_size": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn company size ranges: `Self-employed`, `1-10`, `11-50`, `51-200`, `201-500`, `501-1000`, `1001-5000`, `5001-10000`, `10001+`. En-dashes are normalized to hyphens",
                    "example": [
                      "51-200",
                      "201-500"
                    ]
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to include: Pipecorn database location IDs (`POST /locations` with `\"source\": \"database\"`), or Sales Navigator location IDs (`\"source\": \"live\"`) with `live: true`. An ID from the other source returns `422`.",
                    "example": [
                      "country:fr"
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to exclude, from the same source as `included_locations`.",
                    "example": []
                  },
                  "included_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn industry IDs to include",
                    "example": [
                      "4"
                    ]
                  },
                  "excluded_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn industry IDs to exclude",
                    "example": []
                  },
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "daily",
                      "weekly",
                      "monthly"
                    ],
                    "default": "daily",
                    "description": "How often the tracking runs. Case-insensitive",
                    "example": "weekly"
                  },
                  "live": {
                    "type": "boolean",
                    "default": false,
                    "description": "`false` (default) runs the alert on the Pipecorn people database: no LinkedIn connection needed, and locations are Pipecorn database location IDs (`POST /locations` with `\"source\": \"database\"`). `true` runs it on a Sales Navigator saved search instead: it needs a connected LinkedIn account with Sales Navigator, counts against its 50 saved searches, and locations are Sales Navigator location IDs (`\"source\": \"live\"`). `functions`, `seniority_levels`, `excluded_seniority_levels`, `years_in_current_position`, `years_at_current_company`, `keyword` and `hire_type` only work with `live: false`: with `live: true` they return `422`. A non-boolean value returns `422`.",
                    "example": false
                  },
                  "skip_first_run": {
                    "type": "boolean",
                    "default": false,
                    "description": "When `true`, the tracking starts from now: it does not run right away, and its first run only brings the people who are new since it was created. When `false`, a database tracking runs right away on everyone matching who started their role in the last 90 days.",
                    "example": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "New hires tracking created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "alert_id",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "New hires tracking created successfully. It runs daily."
                    },
                    "alert_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUID of the alert this created. Read its runs with `GET /alerts/{id}`."
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "`GET /alerts/{id}` for this alert. Same value as the `Location` header."
                    }
                  }
                },
                "example": {
                  "message": "New hires tracking created successfully. It runs daily.",
                  "alert_id": "6f1d2c3b-0000-4000-8000-000000000001",
                  "status_url": "https://app.pipecorn.com/api/v2/alerts/6f1d2c3b-0000-4000-8000-000000000001"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "`GET /alerts/{id}` for the created alert.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Missing key, saved-search or alert limit reached, or the task could not be created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "missing_titles": {
                    "summary": "Missing required keys: included_job_titles",
                    "value": {
                      "error": "Missing required keys: included_job_titles"
                    }
                  },
                  "missing_webhook": {
                    "summary": "webhook_url key is required in your payload",
                    "value": {
                      "error": "webhook_url key is required in your payload"
                    }
                  },
                  "saved_searches": {
                    "summary": "You have reached the maximum number of saved searches",
                    "value": {
                      "error": "You have reached the maximum number of saved searches"
                    }
                  },
                  "alert_limit": {
                    "summary": "You have reached the maximum number of alerts in your plan. Reach out to support if you need more alerts.",
                    "value": {
                      "error": "You have reached the maximum number of alerts in your plan. Reach out to support if you need more alerts."
                    }
                  },
                  "failed": {
                    "summary": "Failed to create task - <reason>",
                    "value": {
                      "error": "Failed to create task - <reason>"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Invalid `frequency`, `company_size`, industries or locations (company size errors also carry details such as `invalid_sizes` and `valid_formats`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "size_format": {
                    "summary": "Invalid company_size format",
                    "value": {
                      "error": "Invalid company_size format"
                    }
                  },
                  "size_values": {
                    "summary": "Invalid company_size values",
                    "value": {
                      "error": "Invalid company_size values"
                    }
                  },
                  "frequency": {
                    "summary": "Unsupported frequency",
                    "value": {
                      "error": "frequency must be one of: daily, weekly, monthly"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "deprecated": true,
        "tags": [
          "Signals"
        ],
        "operationId": "findNewHires"
      }
    },
    "/intents/leads/track_job_changes": {
      "post": {
        "summary": "Track job changes",
        "description": "Track job changes for a list of contacts. Each contact is identified by its LinkedIn URL, or by its first name, last name and current company. Contacts are matched in the background; the first check runs once matching is done, then every month. Contacts who changed company or were promoted are sent to your webhook.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "contacts",
                  "webhook_url"
                ],
                "properties": {
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL that receives the job changes",
                    "example": "https://your-company.com/webhooks/job_changes"
                  },
                  "contacts": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10000,
                    "description": "Contacts to track, up to 10,000 per request. Each contact needs either `linkedin_url`, or all of `first_name`, `last_name` and `company_name`.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "linkedin_url": {
                          "type": "string",
                          "format": "uri",
                          "description": "LinkedIn profile URL of the contact.",
                          "example": "https://www.linkedin.com/in/john-doe"
                        },
                        "first_name": {
                          "type": "string",
                          "description": "First name of the contact. Required with `last_name` and `company_name` when `linkedin_url` is not provided.",
                          "example": "Jane"
                        },
                        "last_name": {
                          "type": "string",
                          "description": "Last name of the contact. Required with `first_name` and `company_name` when `linkedin_url` is not provided.",
                          "example": "Smith"
                        },
                        "company_name": {
                          "type": "string",
                          "description": "Current company of the contact. Required with `first_name` and `last_name` when `linkedin_url` is not provided.",
                          "example": "Acme"
                        }
                      }
                    },
                    "example": [
                      {
                        "linkedin_url": "https://www.linkedin.com/in/john-doe"
                      },
                      {
                        "first_name": "Jane",
                        "last_name": "Smith",
                        "company_name": "Acme"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Job change tracking created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "alert_id",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Job changes tracking created successfully. Contacts are being matched; the initial check runs once matching is done, then every 30 days."
                    },
                    "alert_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUID of the alert this created. Read its runs with `GET /alerts/{id}`."
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "`GET /alerts/{id}` for this alert. Same value as the `Location` header."
                    }
                  }
                },
                "example": {
                  "message": "Job changes tracking created successfully. Contacts are being matched; the initial check runs once matching is done, then every 30 days.",
                  "alert_id": "6f1d2c3b-0000-4000-8000-000000000002",
                  "status_url": "https://app.pipecorn.com/api/v2/alerts/6f1d2c3b-0000-4000-8000-000000000002"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "`GET /alerts/{id}` for the created alert.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Missing or invalid contacts, more than 10,000 contacts, missing webhook, alert limit reached, or the tracking could not be created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "missing_contacts": {
                    "summary": "Missing required keys: contacts",
                    "value": {
                      "error": "Missing required keys: contacts"
                    }
                  },
                  "missing_webhook": {
                    "summary": "webhook_url key is required in your payload",
                    "value": {
                      "error": "webhook_url key is required in your payload"
                    }
                  },
                  "empty_contacts": {
                    "summary": "Contacts are required. Please provide at least one contact to track job changes.",
                    "value": {
                      "error": "Contacts are required. Please provide at least one contact to track job changes."
                    }
                  },
                  "too_many_contacts": {
                    "summary": "You can track up to 10000 contacts per request.",
                    "value": {
                      "error": "You can track up to 10000 contacts per request."
                    }
                  },
                  "invalid_contact": {
                    "summary": "Either first_name, last_name and company_name or linkedin_url must be provided",
                    "value": {
                      "error": "Either first_name, last_name and company_name or linkedin_url must be provided"
                    }
                  },
                  "alert_limit": {
                    "summary": "You have reached the maximum number of alerts in your plan. Reach out to support if you need more alerts.",
                    "value": {
                      "error": "You have reached the maximum number of alerts in your plan. Reach out to support if you need more alerts."
                    }
                  },
                  "failed": {
                    "summary": "Failed to create job changes tracking - <reason>",
                    "value": {
                      "error": "Failed to create job changes tracking - <reason>"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "deprecated": true,
        "tags": [
          "Signals"
        ],
        "operationId": "trackJobChanges"
      }
    },
    "/intents/leads/connections": {
      "post": {
        "summary": "Find who can introduce you to a LinkedIn lead",
        "description": "Returns your 1st-degree connections who can introduce you to a target lead, via LinkedIn Sales Navigator. Each connection comes with the paths that link it to the target, the companies both worked at (overlap, location, headcount) and a relationship strength. Connections are sorted strongest first. Requires a connected LinkedIn account with Sales Navigator access.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_url"
                ],
                "properties": {
                  "linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn profile URL of the target person. Accepts public profile URLs (`/in/...`), Sales Navigator URLs (`/sales/lead/...`), or internal LinkedIn URNs.",
                    "example": "https://www.linkedin.com/in/john-doe"
                  },
                  "linkedin_profile_url": {
                    "type": "string",
                    "format": "uri",
                    "deprecated": true,
                    "description": "Alias of `linkedin_url`, still accepted. Use `linkedin_url` in new integrations."
                  },
                  "spotlights": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "SHARED_CONNECTION",
                        "SHARED_EXPERIENCE",
                        "SHARED_EDUCATION",
                        "SHARED_GROUP"
                      ]
                    },
                    "minItems": 1,
                    "default": [
                      "SHARED_CONNECTION"
                    ],
                    "description": "Optional. Kinds of warm path to look for. `SHARED_CONNECTION`: your connection is connected to the target. `SHARED_EXPERIENCE`: they worked at the same company. `SHARED_EDUCATION`: same school. `SHARED_GROUP`: same LinkedIn group. Each kind runs one more Sales Navigator lookup. TeamLink is not supported.",
                    "example": [
                      "SHARED_CONNECTION",
                      "SHARED_EXPERIENCE"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connections found successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "description": "Number of warm paths found across the requested spotlights. A connection reached through two spotlights counts twice.",
                      "example": 3
                    },
                    "connections": {
                      "type": "array",
                      "description": "Your 1st-degree connections who can introduce you to the target, strongest relationship first. A person found through several spotlights appears once.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "first_name": {
                            "type": "string",
                            "description": "First name of the connection",
                            "example": "Jane"
                          },
                          "last_name": {
                            "type": "string",
                            "description": "Last name of the connection",
                            "example": "Doe"
                          },
                          "full_name": {
                            "type": "string",
                            "description": "Full name of the connection",
                            "example": "Jane Doe"
                          },
                          "degree": {
                            "type": "integer",
                            "description": "LinkedIn connection degree with the authenticated user (always 1)",
                            "example": 1
                          },
                          "profile_urn": {
                            "type": "string",
                            "description": "LinkedIn Sales Navigator profile URN",
                            "example": "urn:li:fs_salesProfile:(ACwAABD5FBQ,NAME_SEARCH,vIqI)"
                          },
                          "sales_navigator_url": {
                            "type": "string",
                            "format": "uri",
                            "description": "URL to the connection's Sales Navigator profile",
                            "example": "https://www.linkedin.com/sales/lead/ACwAABD5FBQ,NAME_SEARCH,vIqI/"
                          },
                          "linkedin_url": {
                            "type": "string",
                            "format": "uri",
                            "nullable": true,
                            "description": "URL to the connection's public LinkedIn profile (null if not available)",
                            "example": "https://www.linkedin.com/in/jane-doe/"
                          },
                          "profile_picture_url": {
                            "type": "string",
                            "format": "uri",
                            "nullable": true,
                            "description": "URL to the connection's profile picture (null if not available)",
                            "example": "https://media.licdn.com/dms/image/..."
                          },
                          "current_position": {
                            "type": "object",
                            "nullable": true,
                            "description": "Current job position of the connection",
                            "properties": {
                              "title": {
                                "type": "string",
                                "nullable": true,
                                "description": "Current job title",
                                "example": "VP Sales"
                              },
                              "company": {
                                "type": "string",
                                "nullable": true,
                                "description": "Current company name",
                                "example": "Acme Corp"
                              }
                            }
                          },
                          "paths": {
                            "type": "array",
                            "description": "How this connection is linked to the target, one entry per spotlight it was found through.",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "SHARED_CONNECTION",
                                    "SHARED_EXPERIENCE",
                                    "SHARED_EDUCATION",
                                    "SHARED_GROUP"
                                  ],
                                  "description": "Spotlight that found this path.",
                                  "example": "SHARED_CONNECTION"
                                },
                                "reason": {
                                  "type": "string",
                                  "nullable": true,
                                  "description": "LinkedIn's explanation of the path, when it gives one.",
                                  "example": "You both know Ada Lovelace"
                                }
                              }
                            }
                          },
                          "shared_experiences": {
                            "type": "array",
                            "description": "Every company both the connection and the target worked at, read from their LinkedIn positions. Empty when they never worked at the same company.",
                            "items": {
                              "type": "object",
                              "properties": {
                                "company_id": {
                                  "type": "string",
                                  "description": "LinkedIn company id.",
                                  "example": "1035"
                                },
                                "company": {
                                  "type": "string",
                                  "description": "Company name.",
                                  "example": "Sellsy"
                                },
                                "overlap_months": {
                                  "type": "integer",
                                  "nullable": true,
                                  "description": "Months both were at the company at the same time. `0` means they worked there at different times. `null` when a start date is missing.",
                                  "example": 18
                                },
                                "approximate_dates": {
                                  "type": "boolean",
                                  "description": "`true` when a position only gives years: the overlap then counts each year as a whole and can be overstated.",
                                  "example": false
                                },
                                "same_location": {
                                  "type": "boolean",
                                  "nullable": true,
                                  "description": "Whether both positions list the same city. `null` when one of them has no location.",
                                  "example": true
                                },
                                "company_size": {
                                  "type": "integer",
                                  "nullable": true,
                                  "description": "The company's headcount today, as reported by LinkedIn. `null` when unknown.",
                                  "example": 45
                                }
                              }
                            }
                          },
                          "relationship_strength": {
                            "type": "object",
                            "description": "How likely the connection is to know the target well. See [relationship strength](/api-reference/endpoints/signals/connections#relationship-strength).",
                            "properties": {
                              "score": {
                                "type": "integer",
                                "description": "Higher means a stronger tie.",
                                "example": 7
                              },
                              "level": {
                                "type": "string",
                                "enum": [
                                  "strong",
                                  "medium",
                                  "weak"
                                ],
                                "description": "`strong` from 4, `medium` from 2, `weak` below.",
                                "example": "strong"
                              }
                            }
                          }
                        }
                      }
                    },
                    "totals_by_spotlight": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer"
                      },
                      "description": "Number of warm paths found per requested spotlight.",
                      "example": {
                        "SHARED_CONNECTION": 3,
                        "SHARED_EXPERIENCE": 1
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad request — missing required `linkedin_url`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "missing_keys": {
                    "value": {
                      "error": "Missing required keys: linkedin_url"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Unprocessable — invalid spotlights, LinkedIn account not connected or Sales Navigator credentials expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "invalid_spotlights": {
                    "value": {
                      "error": "spotlights must be a non-empty array of: SHARED_CONNECTION, SHARED_EXPERIENCE, SHARED_EDUCATION, SHARED_GROUP"
                    }
                  },
                  "no_linkedin_credentials": {
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "linkedin_expired": {
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface"
                    }
                  },
                  "no_sales_nav": {
                    "value": {
                      "error": "Sales Navigator credentials expired. Refresh your connection on Pipecorn interface"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit), or rate limited by LinkedIn",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "findWhoCanIntroduceYouToALinkedinLead"
      }
    },
    "/intents/accounts/stack/preview": {
      "post": {
        "summary": "Preview companies by tech stack",
        "description": "Return the total number of companies matching a technology-stack query plus a blurred sample. Free — spends no credits. Only documented fields are allowed; unknown keys return 422. The extract-only keys (`webhook_url`, `limit`, `streaming`, `name`) are accepted and ignored, so one body works for both the preview and `POST /intents/accounts/stack`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "stacks"
                ],
                "properties": {
                  "stacks": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Technology slugs to match. Resolve names to slugs with GET /accounts/technologies.",
                    "example": [
                      "shopify",
                      "webflow"
                    ]
                  },
                  "stack_match": {
                    "type": "string",
                    "enum": [
                      "or",
                      "and"
                    ],
                    "default": "or",
                    "description": "How `stacks` combine. `or` matches companies using any listed technology; `and` requires all of them.",
                    "example": "or"
                  },
                  "excluded_stacks": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Technology slugs to exclude.",
                    "example": [
                      "wordpress"
                    ]
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "ISO country codes, OR-matched against the company's country.",
                    "example": [
                      "US",
                      "FR"
                    ]
                  },
                  "included_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn industry IDs to include, OR-matched.",
                    "example": [
                      "2190",
                      "34"
                    ]
                  },
                  "excluded_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn industry IDs to exclude.",
                    "example": [
                      "27"
                    ]
                  },
                  "company_size": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "Self-employed",
                        "1-10",
                        "11-50",
                        "51-200",
                        "201-500",
                        "501-1000",
                        "1001-5000",
                        "5001-10000",
                        "10001+"
                      ]
                    },
                    "description": "Company size display buckets to include.",
                    "example": [
                      "11-50",
                      "51-200"
                    ]
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Accepted and ignored, so the same body works for the preview and the extract.",
                    "example": "https://your-company.com/webhooks/stack"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "default": 1000,
                    "description": "Accepted and ignored, so the same body works for the preview and the extract. `limit` is still validated: it must be a positive integer.",
                    "example": 200
                  },
                  "streaming": {
                    "type": "boolean",
                    "description": "Accepted and ignored, so the same body works for the preview and the extract.",
                    "example": false
                  },
                  "name": {
                    "type": "string",
                    "description": "Accepted and ignored, so the same body works for the preview and the extract.",
                    "example": "Shopify prospects"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview count and blurred company sample",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total_count",
                    "preview"
                  ],
                  "properties": {
                    "total_count": {
                      "type": "integer",
                      "description": "Exact number of matching companies.",
                      "example": 428
                    },
                    "preview": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "example": "Acme"
                          },
                          "domain": {
                            "type": "string",
                            "example": "acme.com"
                          },
                          "website": {
                            "type": "string",
                            "example": "https://acme.com"
                          },
                          "industry": {
                            "type": "string",
                            "example": "Software Development"
                          },
                          "location": {
                            "type": "string",
                            "example": "Paris France"
                          },
                          "city": {
                            "type": "string",
                            "example": "Paris"
                          },
                          "country": {
                            "type": "string",
                            "example": "France"
                          },
                          "linkedin_url": {
                            "type": "string",
                            "example": "https://linkedin.com/company/acme"
                          },
                          "technologies_found": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "technology_name": {
                                  "type": "string",
                                  "example": "Shopify"
                                },
                                "confidence": {
                                  "type": "string",
                                  "example": "high"
                                },
                                "job_mentions": {
                                  "type": "integer",
                                  "example": 3
                                }
                              }
                            }
                          }
                        }
                      },
                      "description": "Sample of matching companies (up to 25). Company identifiers may be blurred; the count is exact."
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad request (stacks missing or empty)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Unprocessable entity (invalid filters, or keys the endpoint does not accept: the body lists them in `unauthorized_params`, next to every accepted key in `permitted_params`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "unknown_parameter": {
                    "summary": "Unknown key in the body",
                    "value": {
                      "error": "Unauthorized parameters detected",
                      "unauthorized_params": [
                        "country"
                      ],
                      "permitted_params": [
                        "stacks",
                        "stack_match",
                        "excluded_stacks",
                        "countries",
                        "included_industries",
                        "excluded_industries",
                        "company_size",
                        "webhook_url",
                        "limit",
                        "streaming",
                        "name"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "previewCompaniesByTechStack"
      }
    },
    "/intents/accounts/stack": {
      "post": {
        "summary": "Find companies by tech stack",
        "description": "Start an async import of companies matching a technology-stack query. Results are delivered to `webhook_url`. Spends 3 enrichment credits per imported company. Only documented fields are allowed; unknown keys return 422.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "stacks",
                  "webhook_url"
                ],
                "properties": {
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL that receives the imported company records.",
                    "example": "https://your-company.com/webhooks/stack"
                  },
                  "stacks": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Technology slugs to match. Resolve names to slugs with GET /accounts/technologies.",
                    "example": [
                      "shopify",
                      "webflow"
                    ]
                  },
                  "stack_match": {
                    "type": "string",
                    "enum": [
                      "or",
                      "and"
                    ],
                    "default": "or",
                    "description": "How `stacks` combine. `or` matches companies using any listed technology; `and` requires all of them.",
                    "example": "or"
                  },
                  "excluded_stacks": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Technology slugs to exclude.",
                    "example": [
                      "wordpress"
                    ]
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "ISO country codes, OR-matched against the company's country.",
                    "example": [
                      "US",
                      "FR"
                    ]
                  },
                  "included_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn industry IDs to include, OR-matched.",
                    "example": [
                      "2190",
                      "34"
                    ]
                  },
                  "excluded_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn industry IDs to exclude.",
                    "example": [
                      "27"
                    ]
                  },
                  "company_size": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "Self-employed",
                        "1-10",
                        "11-50",
                        "51-200",
                        "201-500",
                        "501-1000",
                        "1001-5000",
                        "5001-10000",
                        "10001+"
                      ]
                    },
                    "description": "Company size display buckets to include.",
                    "example": [
                      "11-50",
                      "51-200"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "default": 1000,
                    "description": "Caps how many companies are imported (and billed). Defaults to 1000, which is also the hard ceiling.",
                    "example": 200
                  },
                  "streaming": {
                    "type": "boolean",
                    "description": "When true, companies are POSTed to the webhook one at a time instead of in a single payload.",
                    "example": false
                  },
                  "name": {
                    "type": "string",
                    "description": "Optional import name.",
                    "example": "Shopify prospects"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "No matching companies; no import created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total_count",
                    "total_available",
                    "message"
                  ],
                  "properties": {
                    "total_count": {
                      "type": "integer",
                      "example": 0
                    },
                    "total_available": {
                      "type": "integer",
                      "example": 0
                    },
                    "message": {
                      "type": "string",
                      "example": "No results found"
                    }
                  }
                }
              }
            },
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "201": {
            "description": "Stack intent search started successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "object",
                      "required": [
                        "total_count",
                        "total_available",
                        "message",
                        "id"
                      ],
                      "properties": {
                        "total_count": {
                          "type": "integer",
                          "description": "Companies that will be imported (capped by `limit`, then the 1000 ceiling).",
                          "example": 200
                        },
                        "total_available": {
                          "type": "integer",
                          "description": "Full match count.",
                          "example": 428
                        },
                        "message": {
                          "type": "string",
                          "example": "Stack intent search started successfully. You will receive the results on your webhook shortly."
                        },
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Import job UUID.",
                          "example": "b3f1c2d4-0000-0000-0000-000000000000"
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the import: `GET /lists/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                },
                "example": {
                  "message": {
                    "total_count": 200,
                    "total_available": 428,
                    "message": "Stack intent search started successfully. You will receive the results on your webhook shortly.",
                    "id": "b3f1c2d4-0000-0000-0000-000000000000"
                  },
                  "status_url": "https://app.pipecorn.com/api/v2/lists/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this import, `GET /lists/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad request (stacks or webhook_url missing)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized (missing or invalid API key)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits for the companies that would be imported (3 credits per company). No import is created and nothing is spent. The message reports the shortfall.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits. You need 30 credits but only have 5 available.",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "The workspace weekly enrichment credit limit is reached. Buying credits does not lift it, so no `top_up_url` is returned, and no import is created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceLimitError"
                },
                "example": {
                  "error": "You have reached your weekly enrichment credit limit for this workspace",
                  "code": "workspace_limit_exceeded"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Unprocessable entity (invalid filters, or keys the endpoint does not accept: the body lists them in `unauthorized_params`, next to every accepted key in `permitted_params`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "unknown_parameter": {
                    "summary": "Unknown key in the body",
                    "value": {
                      "error": "Unauthorized parameters detected",
                      "unauthorized_params": [
                        "country"
                      ],
                      "permitted_params": [
                        "stacks",
                        "stack_match",
                        "excluded_stacks",
                        "countries",
                        "included_industries",
                        "excluded_industries",
                        "company_size",
                        "webhook_url",
                        "limit",
                        "streaming",
                        "name"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "findCompaniesByTechStack"
      }
    },
    "/intents/leads/warm_intros": {
      "post": {
        "summary": "Find warm intros to a LinkedIn profile",
        "description": "Finds, for one of your 1st-degree LinkedIn connections, the people connected to them (1st, 2nd or 3rd degree from you) who worked at one of the target's past companies — the colleagues most likely to introduce you. Optionally narrowed to a persona or to job titles. Runs a live LinkedIn Sales Navigator search and returns the results synchronously.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "linkedin_url"
                ],
                "properties": {
                  "linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn profile URL of the person you want an intro to. Must be one of your 1st-degree connections. Accepts public profile URLs (`/in/...`), Sales Navigator URLs (`/sales/lead/...`), or internal LinkedIn URNs.",
                    "example": "https://www.linkedin.com/in/john-doe"
                  },
                  "linkedin_profile_url": {
                    "type": "string",
                    "format": "uri",
                    "deprecated": true,
                    "description": "Alias of `linkedin_url`, still accepted. Use `linkedin_url` in new integrations."
                  },
                  "persona_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional. Id of one of your personas (see `GET /personas`). Its job titles, locations, industries and company sizes are added to the search. Cannot be combined with `job_titles` or `excluded_job_titles`.",
                    "example": "8f2c1b7e-3a4d-4e5f-9a6b-1c2d3e4f5a6b"
                  },
                  "job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Optional. Keep only people whose current title matches one of these. Use it instead of `persona_id`.",
                    "example": [
                      "Head of Sales",
                      "VP Sales"
                    ]
                  },
                  "excluded_job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Optional. Drop people whose current title matches one of these. Requires `job_titles`.",
                    "example": [
                      "Intern"
                    ]
                  },
                  "target_company_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 100,
                    "description": "Optional. LinkedIn company ids (numeric). Keep only the people who work at one of these companies today, e.g. the accounts in your open pipeline.",
                    "example": [
                      "1441",
                      "1035"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 25,
                    "description": "Maximum number of leads to return.",
                    "example": 25
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Warm intro search completed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of matching people on Sales Navigator. Can exceed the number of `leads` returned.",
                      "example": 12
                    },
                    "past_companies": {
                      "type": "array",
                      "description": "The target's past companies used as the past-company filter: every company of an ended position, except the company the target works at today. Empty when the target has none, in which case no search is run and `leads` is empty.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "LinkedIn company id",
                            "example": "1035"
                          },
                          "name": {
                            "type": "string",
                            "description": "Company name as shown on the target's profile",
                            "example": "BNP Paribas"
                          }
                        }
                      }
                    },
                    "leads": {
                      "type": "array",
                      "description": "People connected to the target who previously worked at one of `past_companies`, strongest relationship first",
                      "items": {
                        "type": "object",
                        "properties": {
                          "first_name": {
                            "type": "string",
                            "example": "Jane"
                          },
                          "last_name": {
                            "type": "string",
                            "example": "Doe"
                          },
                          "full_name": {
                            "type": "string",
                            "example": "Jane Doe"
                          },
                          "headline": {
                            "type": "string",
                            "nullable": true,
                            "example": "VP Sales at Acme Corp"
                          },
                          "degree": {
                            "type": "integer",
                            "description": "Connection degree between you and the lead (1, 2 or 3)",
                            "example": 2
                          },
                          "current_title": {
                            "type": "string",
                            "nullable": true,
                            "example": "VP Sales"
                          },
                          "current_company": {
                            "type": "string",
                            "nullable": true,
                            "example": "Acme Corp"
                          },
                          "linkedin_id": {
                            "type": "string",
                            "description": "LinkedIn Sales Navigator member id",
                            "example": "ACwAABD5FBQ"
                          },
                          "sales_navigator_url": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://www.linkedin.com/sales/lead/ACwAABD5FBQ,NAME_SEARCH,vIqI/"
                          },
                          "shared_experiences": {
                            "type": "array",
                            "description": "Every company both the lead and the target worked at, read from their LinkedIn positions. Empty when the lead's positions could not be read.",
                            "items": {
                              "type": "object",
                              "properties": {
                                "company_id": {
                                  "type": "string",
                                  "description": "LinkedIn company id.",
                                  "example": "1035"
                                },
                                "company": {
                                  "type": "string",
                                  "description": "Company name.",
                                  "example": "Sellsy"
                                },
                                "overlap_months": {
                                  "type": "integer",
                                  "nullable": true,
                                  "description": "Months both were at the company at the same time. `0` means they worked there at different times. `null` when a start date is missing.",
                                  "example": 18
                                },
                                "approximate_dates": {
                                  "type": "boolean",
                                  "description": "`true` when a position only gives years: the overlap then counts each year as a whole and can be overstated.",
                                  "example": false
                                },
                                "same_location": {
                                  "type": "boolean",
                                  "nullable": true,
                                  "description": "Whether both positions list the same city. `null` when one of them has no location.",
                                  "example": true
                                },
                                "company_size": {
                                  "type": "integer",
                                  "nullable": true,
                                  "description": "The company's headcount today, as reported by LinkedIn. `null` when unknown.",
                                  "example": 45
                                }
                              }
                            }
                          },
                          "relationship_strength": {
                            "type": "object",
                            "description": "How likely the lead is to know the target well. Every lead counts as a shared connection with a shared experience; see [relationship strength](/api-reference/endpoints/signals/warm_intros#relationship-strength).",
                            "properties": {
                              "score": {
                                "type": "integer",
                                "description": "Higher means a stronger tie.",
                                "example": 7
                              },
                              "level": {
                                "type": "string",
                                "enum": [
                                  "strong",
                                  "medium",
                                  "weak"
                                ],
                                "description": "`strong` from 4, `medium` from 2, `weak` below.",
                                "example": "strong"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad request — missing `linkedin_url`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "missing_keys": {
                    "value": {
                      "error": "Missing required keys: linkedin_url"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "404": {
            "description": "The profile or the persona was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "profile_not_found": {
                    "value": {
                      "error": "Profile doesn't exist"
                    }
                  },
                  "persona_not_found": {
                    "value": {
                      "error": "Persona not found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Invalid parameters, the profile is not one of your 1st-degree connections, LinkedIn account not connected, or Sales Navigator not connected / expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "invalid_limit": {
                    "value": {
                      "error": "limit must be an integer between 1 and 100"
                    }
                  },
                  "persona_and_titles": {
                    "value": {
                      "error": "persona_id cannot be combined with job_titles or excluded_job_titles"
                    }
                  },
                  "excluded_without_titles": {
                    "value": {
                      "error": "excluded_job_titles requires job_titles"
                    }
                  },
                  "invalid_target_companies": {
                    "value": {
                      "error": "target_company_ids must be an array of at most 100 LinkedIn company ids"
                    }
                  },
                  "not_connected": {
                    "value": {
                      "error": "You are not connected to this profile on LinkedIn. Warm intros only work for your 1st-degree connections."
                    }
                  },
                  "no_linkedin_credentials": {
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "linkedin_expired": {
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface"
                    }
                  },
                  "no_sales_nav": {
                    "value": {
                      "error": "Sales Navigator credentials expired. Refresh your connection on Pipecorn interface"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (1 request per second per user, or your plan's per-minute limit).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "findWarmIntrosToALinkedinProfile"
      }
    },
    "/intents/accounts/warm_intros": {
      "post": {
        "summary": "Find warm intros into an account",
        "description": "Finds the decision makers of a company in your 2nd-degree network, then who among your 1st-degree connections can introduce you to each of them, with the same paths, shared experiences and relationship strength as `POST /intents/leads/connections`. Runs in the background and posts the result to `webhook_url`. Requires a connected LinkedIn account with Sales Navigator access. Doesn't consume credits.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "company_linkedin_id",
                  "webhook_url"
                ],
                "properties": {
                  "company_linkedin_id": {
                    "type": "string",
                    "pattern": "^\\d+$",
                    "description": "Numeric LinkedIn company id of the account (the `linkedin_id` returned by `POST /accounts/single_enrich`). A number is accepted too.",
                    "example": "1441"
                  },
                  "persona_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional. Id of one of your personas (see `GET /personas`). Its job titles, locations, industries and company sizes select the decision makers. Cannot be combined with `job_titles` or `excluded_job_titles`.",
                    "example": "8f2c1b7e-3a4d-4e5f-9a6b-1c2d3e4f5a6b"
                  },
                  "job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Optional. Keep only decision makers whose current title matches one of these. Use it instead of `persona_id`.",
                    "example": [
                      "CFO",
                      "VP Finance"
                    ]
                  },
                  "excluded_job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Optional. Drop people whose current title matches one of these. Requires `job_titles`.",
                    "example": [
                      "Intern"
                    ]
                  },
                  "spotlights": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "SHARED_CONNECTION",
                        "SHARED_EXPERIENCE",
                        "SHARED_EDUCATION",
                        "SHARED_GROUP"
                      ]
                    },
                    "minItems": 1,
                    "default": [
                      "SHARED_CONNECTION"
                    ],
                    "description": "Optional. Kinds of warm path to look for. `SHARED_CONNECTION`: your connection is connected to the target. `SHARED_EXPERIENCE`: they worked at the same company. `SHARED_EDUCATION`: same school. `SHARED_GROUP`: same LinkedIn group. Each kind runs one more Sales Navigator lookup. TeamLink is not supported.",
                    "example": [
                      "SHARED_CONNECTION",
                      "SHARED_EXPERIENCE"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 25,
                    "default": 10,
                    "description": "Maximum number of decision makers to look up.",
                    "example": 10
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL that receives the result as a `POST` once the search is done.",
                    "example": "https://hooks.example.com/pipecorn/warm-intros"
                  },
                  "context": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Optional. Any JSON object, sent back untouched in the webhook payload (e.g. your CRM deal id).",
                    "example": {
                      "deal_id": "42"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Search started. The result is posted to `webhook_url`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Warm path search will begin shortly."
                        },
                        "request_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "Sent back as `request_id` in the webhook payload.",
                          "example": "6f1c2a9e-4b7d-4c1e-9a2b-3d4e5f6a7b8c"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "message": {
                    "message": "Warm path search will begin shortly.",
                    "request_id": "6f1c2a9e-4b7d-4c1e-9a2b-3d4e5f6a7b8c"
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Bad request — missing `company_linkedin_id` or `webhook_url`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "missing_company": {
                    "value": {
                      "error": "Missing required keys: company_linkedin_id"
                    }
                  },
                  "missing_webhook": {
                    "value": {
                      "error": "webhook_url key is required in your payload"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            }
          },
          "404": {
            "description": "Persona not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "persona_not_found": {
                    "value": {
                      "error": "Persona not found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Invalid parameters, LinkedIn account not connected, or Sales Navigator not connected / expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                },
                "examples": {
                  "invalid_company": {
                    "value": {
                      "error": "company_linkedin_id must be a LinkedIn company id"
                    }
                  },
                  "invalid_webhook": {
                    "value": {
                      "error": "Invalid webhook_url format"
                    }
                  },
                  "invalid_context": {
                    "value": {
                      "error": "context must be a JSON object"
                    }
                  },
                  "invalid_limit": {
                    "value": {
                      "error": "limit must be an integer between 1 and 25"
                    }
                  },
                  "invalid_spotlights": {
                    "value": {
                      "error": "spotlights must be a non-empty array of: SHARED_CONNECTION, SHARED_EXPERIENCE, SHARED_EDUCATION, SHARED_GROUP"
                    }
                  },
                  "persona_and_titles": {
                    "value": {
                      "error": "persona_id cannot be combined with job_titles or excluded_job_titles"
                    }
                  },
                  "no_linkedin_credentials": {
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "linkedin_expired": {
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface"
                    }
                  },
                  "no_sales_nav": {
                    "value": {
                      "error": "Sales Navigator credentials expired. Refresh your connection on Pipecorn interface"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (1 request per second per user, or your plan's per-minute limit).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalsError"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Signals"
        ],
        "operationId": "findWarmIntrosIntoAnAccount"
      }
    },
    "/leads/single_enrich": {
      "post": {
        "summary": "Enrich a single person",
        "description": "Enrich a single person with profile and firmographic data.\n\n**Credits:** 1 credit per enrichment. You are only charged when a person is actually resolved — a lookup that matches nothing costs nothing.\n\nIdentify the person either by `linkedin_url` (or its alias `profile_linkedin_url`), or by `first_name` + `last_name` + `company_name`.\n\nThis endpoint returns the profile only. Email and phone come from [waterfall enrichment](/api-reference/endpoints/contacts/single_enrich) and are never part of this response.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": "string",
                    "description": "First name",
                    "example": "Mathieu"
                  },
                  "last_name": {
                    "type": "string",
                    "description": "Last name",
                    "example": "Brun-Picard"
                  },
                  "company_name": {
                    "type": "string",
                    "description": "Company name",
                    "example": "Pipecorn"
                  },
                  "linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "LinkedIn profile URL: a public profile (`https://www.linkedin.com/in/<handle>`) or a Sales Navigator lead URL (`https://www.linkedin.com/sales/lead/<id>`).",
                    "example": "https://www.linkedin.com/in/mathieu-brun-picard/"
                  },
                  "profile_linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Alias of `linkedin_url`.",
                    "example": "https://www.linkedin.com/in/mathieu-brun-picard/"
                  },
                  "live": {
                    "type": "boolean",
                    "default": false,
                    "example": false,
                    "description": "Data source. `false` (default) resolves the person from the Pipecorn people database, without calling LinkedIn. `true` looks the profile up live on LinkedIn and needs a connected LinkedIn account. A non-boolean value returns `422`."
                  }
                },
                "anyOf": [
                  {
                    "required": [
                      "linkedin_url"
                    ]
                  },
                  {
                    "required": [
                      "profile_linkedin_url"
                    ]
                  },
                  {
                    "required": [
                      "first_name",
                      "last_name",
                      "company_name"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The enriched person, or `{\"data\": null, \"message\": \"No lead found\"}` when nobody matches (nothing is charged)",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/LeadEnrichment"
                    },
                    {
                      "$ref": "#/components/schemas/LeadsNoMatch"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "missing_keys": {
                    "summary": "Identity keys missing",
                    "value": {
                      "error": "Missing required keys: first_name, last_name, company_name"
                    }
                  },
                  "missing_values": {
                    "summary": "Identity values empty",
                    "value": {
                      "error": "Missing required values: company_name"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key, or (`live: true`) LinkedIn rejected the session of the connected account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  },
                  "linkedin_invalid": {
                    "summary": "LinkedIn session rejected (live: true)",
                    "value": {
                      "error": "LinkedIn credentials are invalid or expired"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits for the 1-credit enrichment. Returned before any lookup runs, so nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits left",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "The workspace weekly enrichment credit limit is reached. Buying credits does not lift it, so no `top_up_url` is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceLimitError"
                },
                "example": {
                  "error": "You have reached your weekly enrichment credit limit for this workspace",
                  "code": "workspace_limit_exceeded"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "`live` is not a boolean, or `live: true` and the LinkedIn connection is missing or expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "invalid_live": {
                    "summary": "live is not a boolean",
                    "value": {
                      "error": "Invalid live value. Must be a boolean (true/false)"
                    }
                  },
                  "linkedin_not_found": {
                    "summary": "No LinkedIn connection (live: true)",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "linkedin_expired": {
                    "summary": "LinkedIn credentials expired (live: true)",
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface, or set parameter 'live' to false in your request body"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "LinkedIn rate-limited the lookup (`live: true`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "rate_limited": {
                    "summary": "Rate limited",
                    "value": {
                      "error": "Rate limit exceeded. Please wait before retrying."
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Leads"
        ],
        "operationId": "enrichASinglePerson"
      }
    },
    "/contacts/reverse_lookup": {
      "post": {
        "summary": "Reverse email lookup",
        "description": "Find the person behind an email address, professional or personal.\n\n**Credits:** 1 credit per match. You are only charged when a person is found — an email that matches nobody costs nothing and returns `{\"data\": null, \"message\": \"No lead found\"}` with a `200`.\n\nOn a match, the response is the same profile payload as [Enrich people](/api-reference/endpoints/leads/single) (database mode): name, headline, LinkedIn URLs, current position, positions, location and company. It does not include contact data.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email address to look up, professional or personal. Case-insensitive.",
                    "example": "mathieu@pipecorn.com"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The person holding this email, or `{\"data\": null, \"message\": \"No lead found\"}` when nobody matches",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadEnrichment"
                }
              }
            },
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "`email` is missing or is not a valid email address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits for the 1-credit lookup. Returned before any lookup runs, so nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits left",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "The workspace weekly enrichment credit limit is reached. Buying credits does not lift it, so no `top_up_url` is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceLimitError"
                },
                "example": {
                  "error": "You have reached your weekly enrichment credit limit for this workspace",
                  "code": "workspace_limit_exceeded"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "429": {
            "description": "Rate limit exceeded: 60 requests per minute per user. The request is refused before any lookup runs, so nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Leads"
        ],
        "operationId": "reverseEmailLookup"
      }
    },
    "/contacts/reverse_phone_lookup": {
      "post": {
        "summary": "Reverse phone lookup",
        "description": "Find the person behind a phone number.\n\n**Credits:** 30 credits per match, the price of a phone. You are only charged when a person is found — a number that matches nobody costs nothing and returns `{\"data\": null, \"message\": \"No lead found\"}` with a `200`.\n\nThe number is matched against the phone numbers found by Pipecorn enrichments. Numbers reported as belonging to someone else, and numbers whose owner opted out, never match.\n\nOn a match, the response is the same profile payload as [Enrich people](/api-reference/endpoints/leads/single) (database mode): name, headline, LinkedIn URLs, current position, positions, location and company. It does not include contact data.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phone": {
                    "type": "string",
                    "description": "Phone number to look up, in international format with its country code. Spaces, dots, dashes and parentheses are ignored.",
                    "example": "+33612345678"
                  }
                },
                "required": [
                  "phone"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The person holding this phone number, or `{\"data\": null, \"message\": \"No lead found\"}` when nobody matches",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadEnrichment"
                }
              }
            },
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "`phone` is missing, is not a valid phone number, or has no country code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "example": {
                  "error": "Invalid phone, use the international format (e.g. +33612345678)"
                }
              }
            }
          },
          "402": {
            "description": "Not enough enrichment credits for the 30-credit lookup. Returned before any lookup runs, so nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                },
                "example": {
                  "error": "Not enough enrichment credits left",
                  "code": "insufficient_credits",
                  "top_up_url": "https://app.pipecorn.com/settings/subscriptions/credits"
                }
              }
            }
          },
          "403": {
            "description": "The workspace weekly enrichment credit limit is reached. Buying credits does not lift it, so no `top_up_url` is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceLimitError"
                },
                "example": {
                  "error": "You have reached your weekly enrichment credit limit for this workspace",
                  "code": "workspace_limit_exceeded"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "429": {
            "description": "Rate limit exceeded: 60 requests per minute per user. The request is refused before any lookup runs, so nothing is spent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Leads"
        ],
        "operationId": "reversePhoneLookup"
      }
    },
    "/leads": {
      "post": {
        "summary": "Create a new lead search",
        "description": "Initiates a new lead search based on the provided parameters.\n\nWith a workspace key, the search joins your workspace's queue instead of starting on one member's account: the first member whose LinkedIn session is free and whose scraping quota covers it runs it. `expected_profiles_count` is then counted from the Pipecorn people database, and saved, recent or shared Sales Navigator searches are refused. See [Lead search queue](/essentials/authentication#lead-search-queue).\n\n**Rate limit:** 1 request per second, on top of your plan's per-minute request limit. With a workspace key, only the workspace's per-minute limit applies, shared by every `POST /leads` made with the key.",
        "requestBody": {
          "description": "Lead search parameters",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewLeadSearch"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Lead search created. Results will be delivered to `webhook_url`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The ID of the created lead search"
                        },
                        "search_name": {
                          "type": "string",
                          "description": "Name of the lead search"
                        },
                        "search_url": {
                          "type": "string",
                          "format": "uri",
                          "description": "The LinkedIn search URL used for extraction"
                        },
                        "expected_profiles_count": {
                          "type": "integer",
                          "description": "Estimated number of matching profiles. With a workspace key it is counted from the Pipecorn people database, capped at 2500, because no LinkedIn session is attached to the search yet."
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When the search was created"
                        },
                        "custom": {
                          "type": "object",
                          "description": "Custom attributes included with the search",
                          "additionalProperties": true
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the search: `GET /searches/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                },
                "example": {
                  "message": {
                    "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                    "search_name": "Lead search - API - 04/05/2026 12:34",
                    "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"
                    }
                  },
                  "status_url": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this search, `GET /searches/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "No `search_url` given (and no `persona_id` to take it from)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "example": {
                  "error": "Missing required parameters: Search URL"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — the account is closed, or LinkedIn refused access to the requested resource. There are no per-key permission scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "account_closed": {
                    "summary": "Account closed",
                    "value": {
                      "error": "Account closed"
                    }
                  },
                  "linkedin_forbidden": {
                    "summary": "LinkedIn refused access",
                    "value": {
                      "error": "You don't have access to this LinkedIn resource."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "`persona_id` does not match any of your personas",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "persona_not_found": {
                    "summary": "Persona not found",
                    "value": {
                      "error": "Persona not found"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "`search_url` is not a LinkedIn Sales Navigator search URL, or the LinkedIn connection is missing or expired. With a workspace key: `position` is not `start` or `end`, `search_url` is a saved, recent or shared Sales Navigator search, or it uses a filter the Pipecorn people database cannot count.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "invalid_search_url": {
                    "summary": "Not a Sales Navigator search URL",
                    "value": {
                      "error": "Invalid search url. Provide a LinkedIn Sales Navigator search URL (linkedin.com/sales/search/...)"
                    }
                  },
                  "linkedin_not_found": {
                    "summary": "No LinkedIn connection",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "linkedin_expired": {
                    "summary": "LinkedIn credentials expired",
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface"
                    }
                  },
                  "invalid_position": {
                    "summary": "Unknown queue position (workspace key)",
                    "value": {
                      "error": "position must be start or end"
                    }
                  },
                  "unresolved_search": {
                    "summary": "Saved, recent or shared search (workspace key)",
                    "value": {
                      "error": "Saved, recent, and shared Sales Navigator searches need a LinkedIn session."
                    }
                  },
                  "uncountable_filter": {
                    "summary": "Filter the people database cannot count (workspace key)",
                    "value": {
                      "error": "These filters cannot be counted from the people database: POSTED_ON_LINKEDIN"
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded: 1 request per second, or your plan's per-minute limit. With a workspace key, only the workspace's per-minute limit applies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Leads"
        ],
        "operationId": "createANewLeadSearch"
      }
    },
    "/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`.\n\nAt least one filter (or `keyword`) **must** be provided in addition to `webhook_url`.\n\nBy 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 Pipecorn's people database (Elasticsearch) instead, with no integration required. See the `live` parameter for the filters that database mode does not support.\n\n**Rate limit:** 1 request per second per user, on top of your plan's per-minute request limit.",
        "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 Pipecorn's people database (Elasticsearch) instead, with no integration required. These filters are **not supported** with `live: false` and return `422`: the relationship/signal filters that only exist in LinkedIn's graph (`connections_of_profile`, `relationship`, `follows_your_company`, `viewed_your_profile`, `with_shared_experiences`, `posted_on_linkedin`, `past_colleague`) and the filters the people database has no field for (`past_titles`, `excluded_past_titles`, `years_of_experience`, `company_type`, `company_headquarters`). 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, from 1 to 2500; any other value returns `422`. If omitted, the estimated search size is used, up to 2500.",
                    "minimum": 1,
                    "maximum": 2500,
                    "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"
                    ]
                  },
                  "persona_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of a saved Pipecorn Persona (`GET /personas`). Its included and excluded job titles become `job_titles` and `excluded_job_titles`, so those must not be passed with it — doing so returns `422`. Names the search after the persona when `name` is omitted. Works with `live: true` and `live: false`, and combines with every other filter. An unknown persona, or one outside your workspace, returns `404`.",
                    "example": "1f6b0f5a-2d8e-4c3a-9b8f-1a2b3c4d5e6f"
                  },
                  "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"
                    ]
                  },
                  "first_name": {
                    "type": "string",
                    "description": "Lead first name (`FIRST_NAME` INCLUDED). Single string; surrounding whitespace is trimmed. A non-string value returns `422`.",
                    "example": "Jane"
                  },
                  "last_name": {
                    "type": "string",
                    "description": "Lead last name (`LAST_NAME` INCLUDED). Single string; surrounding whitespace is trimmed. A non-string value returns `422`.",
                    "example": "Doe"
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to include (`REGION` INCLUDED). With `live: true` (the default), LinkedIn Sales Navigator location IDs (`\"source\": \"live\"` in the [Location IDs endpoint](/api-reference/endpoints/miscellaneous/location-ids), e.g. `\"105015875\"`); with `live: false`, Pipecorn database location IDs (`\"source\": \"database\"`, e.g. `\"country:fr\"`). An ID of the other kind returns `422`.",
                    "example": [
                      "101452733",
                      "105015875"
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to exclude (`REGION` EXCLUDED), of the same kind as `included_locations`.",
                    "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.\n\nID → 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`).\n\nID → 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`).\n\nID → 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`).\n\nID → value: `F` 1st degree; `S` 2nd degree; `O` 3rd degree and beyond; `A` Group members.",
                    "example": [
                      "S"
                    ]
                  },
                  "connections_of_profile": {
                    "type": "string",
                    "format": "uri",
                    "description": "Only the 1st-degree connections of this LinkedIn member (`CONNECTION_OF`, Sales Navigator's \"Connections of\" filter). A LinkedIn profile URL: `https://www.linkedin.com/in/<handle>`, `https://www.linkedin.com/in/<member-urn>` (`ACo…`/`ACw…`), or `https://www.linkedin.com/sales/lead/<id>`. Resolved to the member's internal id before the search runs. Requires `live: true`. Returns `422` if the URL is not a LinkedIn profile URL or cannot be resolved.",
                    "example": "https://www.linkedin.com/in/jane-doe"
                  },
                  "recently_changed_jobs": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "RPC"
                      ]
                    },
                    "description": "Restrict to leads who started a new role in the last 90 days (`RECENTLY_CHANGED_JOBS`, Sales Navigator's \"Changed jobs in the last 90 days\" filter). Pass `[\"RPC\"]` to enable; it is the only accepted value and the 90-day window is fixed.",
                    "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 the connected LinkedIn account's profile in the last 30 days (`VIEW_YOUR_PROFILE`, id `VYP`). The 30-day window is fixed by LinkedIn.",
                    "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."
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the search: `GET /searches/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                },
                "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"
                    }
                  },
                  "status_url": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this search, `GET /searches/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "Missing `webhook_url`, or no filter / keyword provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — the account is closed, or LinkedIn refused access to the requested resource (live requests). There are no per-key permission scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "account_closed": {
                    "summary": "Account closed",
                    "value": {
                      "error": "Account closed"
                    }
                  },
                  "linkedin_forbidden": {
                    "summary": "LinkedIn refused access",
                    "value": {
                      "error": "You don't have access to this LinkedIn resource."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "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, a filter unsupported in database mode (see `live`) was sent with `live: false`, `webhook_url` is not an `http(s)` URL, `limit` is outside 1–2500, or (with `live: true`) the Sales Navigator connection is missing or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (1 request per second per user, or your plan's per-minute limit).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Leads"
        ],
        "operationId": "searchLeadsByFilters"
      }
    },
    "/leads/advanced_search/preview": {
      "post": {
        "summary": "Preview",
        "description": "Run the same filters as `POST /leads/advanced_search` and return a synchronous preview: the total estimated profile count plus the first 25 matching leads. No `Search` is created, no webhook is called, and no credits are consumed.\n\nThis is intended for UI previews, filter validation, and audience sizing before kicking off the real search.\n\nWith `live: true` (the default) a connected Sales Navigator account is required; with `live: false` the preview runs on the Pipecorn database and needs no integration. At least one filter (or `keyword`) **must** be provided. Unlike `POST /leads/advanced_search`, **`webhook_url` is not required**.\n\n**Rate limit:** 1 request per second per user (5 per second with `live: false`), on top of your plan's per-minute request limit.",
        "requestBody": {
          "description": "Same filter parameters as `POST /leads/advanced_search`, including `live` (default `true`) to preview from Pipecorn's people database instead of LinkedIn Sales Navigator. `webhook_url`, `name`, `limit`, `streaming`, `scale`, and `custom` are accepted but ignored — the response is always the first 25 results.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Accepts the same filter object as `POST /leads/advanced_search`. See that endpoint for the full list of supported filters.",
                "additionalProperties": true
              },
              "example": {
                "job_titles": [
                  "VP of Sales",
                  "Chief Revenue Officer"
                ],
                "seniority_levels": [
                  "300",
                  "310"
                ],
                "functions": [
                  "25"
                ],
                "included_industries": [
                  "96"
                ],
                "included_locations": [
                  "101452733"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview generated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total_count": {
                      "type": "integer",
                      "description": "Estimated total number of leads matching the filters (not capped to 25)."
                    },
                    "preview": {
                      "type": "array",
                      "description": "Up to 25 matching leads.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "full_name": {
                            "type": "string",
                            "example": "Ada Lovelace"
                          },
                          "headline": {
                            "type": "string",
                            "example": "VP of Sales at Acme"
                          },
                          "current_company": {
                            "type": "string",
                            "example": "Acme"
                          },
                          "current_title": {
                            "type": "string",
                            "example": "VP of Sales"
                          },
                          "linkedin_id": {
                            "type": "string",
                            "description": "Numeric LinkedIn member id parsed from the profile entity URN.",
                            "example": "104885158"
                          },
                          "profile_url": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://www.linkedin.com/in/urn:li:fs_salesProfile:(ACoAAAxxxx,NAME_SEARCH,abcde)"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "total_count": 1234,
                  "preview": [
                    {
                      "full_name": "Ada Lovelace",
                      "headline": "VP of Sales at Acme",
                      "current_company": "Acme",
                      "current_title": "VP of Sales",
                      "linkedin_id": "104885158",
                      "profile_url": "https://www.linkedin.com/in/urn:li:fs_salesProfile:(ACoAAAxxxx,NAME_SEARCH,abcde)"
                    }
                  ]
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "No filter or `keyword` provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized — missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — the account is closed, or LinkedIn refused access to the requested resource (live requests). There are no per-key permission scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "account_closed": {
                    "summary": "Account closed",
                    "value": {
                      "error": "Account closed"
                    }
                  },
                  "linkedin_forbidden": {
                    "summary": "LinkedIn refused access",
                    "value": {
                      "error": "You don't have access to this LinkedIn resource."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Validation error — a filter has the wrong shape or contains an ID outside the authorized list, or (with `live: true`) the Sales Navigator connection is missing or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (1 request per second per user, 5 with `live: false`, or your plan's per-minute limit).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Leads"
        ],
        "operationId": "preview2"
      }
    },
    "/leads/search": {
      "post": {
        "summary": "Search leads by job title for a specific company",
        "description": "Searches for leads based on job titles and a company (LinkedIn company ID or URL). Optionally narrow results by location, LinkedIn **function** (department), and **seniority** level using the authorized ID lists below.\n\nBy default the search runs live through LinkedIn (`live: true`) and requires a connected integration. Set `live: false` to resolve the company and matching people from Pipecorn's people database (Elasticsearch) instead, with no LinkedIn call and no integration required.\n\nWith a workspace key, a live search joins your workspace's queue instead of starting on one member's account: the first member whose LinkedIn session is free and whose scraping quota covers its `limit` (10 when omitted) runs it. See [Lead search queue](/essentials/authentication#lead-search-queue).",
        "requestBody": {
          "description": "Parameters for lead search by job title",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the lead search. **Required**, unless `persona_id` is passed, in which case it defaults to the persona's name. Without it the request returns `400`.",
                    "example": "Software Engineer Search"
                  },
                  "webhook_url": {
                    "type": "string",
                    "description": "Optional webhook URL to receive results when the search is complete",
                    "example": "https://example.com/webhook"
                  },
                  "company_linkedin_id": {
                    "type": "string",
                    "description": "The LinkedIn ID of the company (required if company_linkedin_url is not provided)",
                    "example": "1234567890"
                  },
                  "company_linkedin_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "The LinkedIn URL of the company. Required if company_linkedin_id is not provided)",
                    "example": "https://www.linkedin.com/company/pipecorn"
                  },
                  "job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of job titles to search for. Cannot be combined with `persona_id` — pass one or the other.",
                    "example": [
                      "Software Engineer",
                      "Product Manager"
                    ]
                  },
                  "excluded_job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of job titles to exclude from the search. Cannot be combined with `persona_id` — pass one or the other.",
                    "example": [
                      "Intern",
                      "Contractor"
                    ]
                  },
                  "persona_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional. UUID of a saved Pipecorn Persona. When provided, `job_titles` and `excluded_job_titles` are derived from the persona and must not be passed in the request — doing so returns `422`. The persona must belong to the authenticated user.",
                    "example": "1f6b0f5a-2d8e-4c3a-9b8f-1a2b3c4d5e6f"
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to include. With `live: true` (the default), LinkedIn Sales Navigator location IDs (`\"source\": \"live\"` in the [Location IDs endpoint](/api-reference/endpoints/miscellaneous/location-ids), e.g. `\"105015875\"`); with `live: false`, Pipecorn database location IDs (`\"source\": \"database\"`, e.g. `\"country:fr\"`). An ID of the other kind returns `422`.",
                    "example": [
                      "105015875",
                      "102221843"
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to exclude, of the same kind as `included_locations`.",
                    "example": [
                      "103644278"
                    ]
                  },
                  "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": "Optional. Filter by LinkedIn function (job function / department). Each value must be one of the authorized function IDs below. Omit or pass an empty array to not filter by function. Multiple IDs are combined with OR logic.\n\nID → 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": [
                      "13",
                      "15"
                    ]
                  },
                  "seniority_levels": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "100",
                        "110",
                        "120",
                        "130",
                        "200",
                        "210",
                        "220",
                        "300",
                        "310",
                        "320"
                      ]
                    },
                    "description": "Optional. Filter by LinkedIn seniority level. Each value must be one of the authorized seniority IDs below. Omit or pass an empty array to not filter by seniority. Multiple IDs are combined with OR logic.\n\nID → 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": [
                      "220",
                      "300"
                    ]
                  },
                  "streaming": {
                    "type": "boolean",
                    "description": "When set to true, leads will be sent individually to the webhook_url as they are found. This is ideal for integration with platforms like Clay that process leads in real-time.",
                    "default": false,
                    "example": true
                  },
                  "custom": {
                    "type": "object",
                    "description": "Custom fields to include with the lead search that will be returned in the webhook (like crm id, etc.)",
                    "additionalProperties": true,
                    "example": {
                      "hubspot_id": "134567"
                    }
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of leads to return, from 1 to 2500; any other value returns `422`. If not specified, all matching leads will be returned.",
                    "minimum": 1,
                    "maximum": 2500,
                    "example": 100
                  },
                  "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": true
                  },
                  "live": {
                    "type": "boolean",
                    "description": "Data source toggle. `true` (default) runs the search live through LinkedIn and requires a connected integration. `false` resolves the company and matching people from Pipecorn's people database (Elasticsearch) instead and streams them to your webhook, with no LinkedIn call and no integration required. A non-boolean value returns `422`.",
                    "default": true,
                    "example": true
                  },
                  "position": {
                    "type": "string",
                    "enum": [
                      "end",
                      "start"
                    ],
                    "default": "end",
                    "description": "Workspace key and `live: true` only. Where the search joins your workspace's lead search queue: `end` (default) behind the searches already waiting, `start` ahead of them. Any other value returns `422`. See [Lead search queue](/essentials/authentication#lead-search-queue).",
                    "example": "start"
                  }
                },
                "allOf": [
                  {
                    "oneOf": [
                      {
                        "required": [
                          "company_linkedin_id"
                        ]
                      },
                      {
                        "required": [
                          "company_linkedin_url"
                        ]
                      }
                    ]
                  },
                  {
                    "anyOf": [
                      {
                        "required": [
                          "job_titles"
                        ]
                      },
                      {
                        "required": [
                          "excluded_job_titles"
                        ]
                      },
                      {
                        "required": [
                          "functions"
                        ]
                      },
                      {
                        "required": [
                          "seniority_levels"
                        ]
                      },
                      {
                        "required": [
                          "included_locations"
                        ]
                      },
                      {
                        "required": [
                          "excluded_locations"
                        ]
                      },
                      {
                        "required": [
                          "persona_id"
                        ]
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With `live: false`, when the company is not in the Pipecorn database: `{\"data\": null, \"message\": \"No company found\"}`. No search is created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsNoMatch"
                },
                "example": {
                  "data": null,
                  "message": "No company found"
                }
              }
            }
          },
          "201": {
            "description": "Search initiated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message",
                    "status_url"
                  ],
                  "properties": {
                    "message": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The ID of the created lead search"
                        },
                        "search_name": {
                          "type": "string",
                          "description": "Name of the lead search"
                        },
                        "search_url": {
                          "type": "string",
                          "format": "uri",
                          "description": "The LinkedIn search URL used for extraction. Omitted with `live: false`."
                        },
                        "expected_profiles_count": {
                          "type": "integer",
                          "description": "Estimated number of matching profiles"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When the search was created"
                        },
                        "custom": {
                          "type": "object",
                          "description": "Custom attributes included with the search",
                          "additionalProperties": true
                        }
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where to poll the search: `GET /searches/{id}`. Same value as the `Location` header.",
                      "example": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                    }
                  }
                },
                "example": {
                  "message": {
                    "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                    "search_name": "Engineering leaders at Acme",
                    "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"
                    }
                  },
                  "status_url": "https://app.pipecorn.com/api/v2/searches/8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
                }
              }
            },
            "headers": {
              "Location": {
                "description": "Status URL of this search, `GET /searches/{id}`.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "A required parameter is missing: `name` (unless `persona_id` is passed), or both `company_linkedin_id` and `company_linkedin_url`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Missing required parameters: name"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — the account is closed, or LinkedIn refused access to the requested resource (live requests). There are no per-key permission scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "account_closed": {
                    "summary": "Account closed",
                    "value": {
                      "error": "Account closed"
                    }
                  },
                  "linkedin_forbidden": {
                    "summary": "LinkedIn refused access",
                    "value": {
                      "error": "You don't have access to this LinkedIn resource."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation error. For example, `functions` or `seniority_levels` is not an array or holds an ID outside the authorized lists, or (workspace key, `live: true`) `position` is not `start` or `end`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Human-readable validation message",
                      "example": "Invalid function IDs: 99. Valid IDs are: 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"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. With `live: false` your plan's per-minute limit applies; live searches are exempt but can be rate limited by LinkedIn.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "tags": [
          "Leads"
        ],
        "operationId": "searchLeadsByJobTitleForASpecificCompany"
      }
    },
    "/leads/bulk_unsave": {
      "post": {
        "summary": "Unsave leads in Sales Navigator",
        "description": "Removes leads from the saved leads of your connected LinkedIn Sales Navigator account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "members"
                ],
                "properties": {
                  "members": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn member URNs of the leads to unsave",
                    "example": [
                      "urn:li:member:123456789"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Leads unsaved on LinkedIn",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Members unsaved successfully"
                    }
                  }
                },
                "example": {
                  "message": "Members unsaved successfully"
                }
              }
            }
          },
          "400": {
            "description": "Missing `members` or invalid body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "missing": {
                    "summary": "Missing required key: members",
                    "value": {
                      "error": "Missing required key: members"
                    }
                  },
                  "invalid_json": {
                    "summary": "Invalid JSON",
                    "value": {
                      "error": "Invalid JSON"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key, or LinkedIn rejected the session while unsaving. An expired LinkedIn connection is normally caught before LinkedIn is called and answers `422` instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  },
                  "linkedin_expired": {
                    "summary": "LinkedIn cookie expired",
                    "value": {
                      "error": "LinkedIn cookie has expired. Please reconnect your LinkedIn account."
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Missing or expired LinkedIn credentials, or plan limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "no_credentials": {
                    "summary": "LinkedIn credentials not found. Please connect your LinkedIn account.",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "expired_credentials": {
                    "summary": "LinkedIn credentials expired. Update your connection on Pipecorn interface",
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface"
                    }
                  },
                  "plan_limit": {
                    "summary": "Can't proceed with the request. Plan limit reached.",
                    "value": {
                      "error": "Can't proceed with the request. Plan limit reached."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded: your plan's per-minute limit, or LinkedIn rate-limited the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "examples": {
                  "plan_rate_limit": {
                    "summary": "Plan rate limit",
                    "value": {
                      "error": "Rate limit exceeded. Please wait before retrying."
                    }
                  },
                  "linkedin_rate_limit": {
                    "summary": "Rate limited by LinkedIn",
                    "value": {
                      "error": "Rate limited by LinkedIn. Please wait a few hours before retrying.",
                      "account_email": "jane@acme.com"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "LinkedIn failed to process the request. Other upstream failures answer their own status (`403`, `404`, `503`, `504`) with the same body shape.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadsError"
                },
                "example": {
                  "error": "LinkedIn request failed. Please retry later."
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Leads"
        ],
        "operationId": "unsaveLeadsInSalesNavigator"
      }
    },
    "/lists": {
      "get": {
        "summary": "Retrieve all lists",
        "description": "Returns the lists of your account (or of every member of your workspace when you authenticate with a workspace key), newest first, one page at a time.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of lists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "lists",
                    "pagination"
                  ],
                  "properties": {
                    "lists": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListSummary"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                },
                "example": {
                  "lists": [
                    {
                      "name": "Tech Companies 2024",
                      "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                      "linkedin_id": "7123456789012345678",
                      "type": "companies",
                      "status": "FINISHED",
                      "created_at": "2024-01-01T00:00:00Z",
                      "updated_at": "2024-01-02T00:00:00Z"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "per_page": 100,
                    "total_count": 1,
                    "has_more": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "tags": [
          "List"
        ],
        "operationId": "retrieveAllLists"
      },
      "post": {
        "summary": "Create a new list",
        "description": "Creates a company list and starts matching the companies in the background. Poll `GET /lists/{id}` or pass a `webhook_url` to know when it is `FINISHED`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewList"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "List created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List"
                },
                "example": {
                  "name": "Tech Companies 2024",
                  "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                  "linkedin_id": "7123456789012345678",
                  "type": "companies",
                  "status": "NOT_STARTED",
                  "companies_requested_count": 2,
                  "companies_found_count": 0,
                  "companies_not_found": [],
                  "created_at": "2024-01-01T00:00:00Z",
                  "updated_at": "2024-01-02T00:00:00Z",
                  "companies": []
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body: malformed JSON, or missing or invalid `name` or `companies`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "examples": {
                  "invalid_json": {
                    "summary": "Invalid JSON",
                    "value": {
                      "error": "Invalid JSON"
                    }
                  },
                  "name_missing": {
                    "summary": "name is required",
                    "value": {
                      "error": "name is required"
                    }
                  },
                  "companies_missing": {
                    "summary": "companies is required",
                    "value": {
                      "error": "companies is required"
                    }
                  },
                  "invalid_company": {
                    "summary": "each company must be an object with a name",
                    "value": {
                      "error": "each company must be an object with a name"
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Invalid `live` or `webhook_url`, missing or expired LinkedIn credentials in live mode, plan limit reached, or the list could not be saved (returns the list of validation messages)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "examples": {
                  "invalid_live": {
                    "summary": "Invalid live value. Must be a boolean (true/false)",
                    "value": {
                      "error": "Invalid live value. Must be a boolean (true/false)"
                    }
                  },
                  "no_credentials": {
                    "summary": "LinkedIn credentials not found. Please connect your LinkedIn account.",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "expired_credentials": {
                    "summary": "LinkedIn credentials expired. Update your connection on Pipecorn interface, or set parameter 'live' to false in your request body",
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface, or set parameter 'live' to false in your request body"
                    }
                  },
                  "plan_limit": {
                    "summary": "Can't proceed with the request. Plan limit reached.",
                    "value": {
                      "error": "Can't proceed with the request. Plan limit reached."
                    }
                  },
                  "invalid_webhook": {
                    "summary": "Invalid webhook_url format",
                    "value": {
                      "error": "Invalid webhook_url format"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "List"
        ],
        "operationId": "createANewList"
      }
    },
    "/lists/{id}": {
      "get": {
        "summary": "Retrieve a specific list",
        "description": "Returns a list with its import progress and matched companies. This endpoint is exempt from the per-plan rate limit so you can poll it while the import runs.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "UUID of the list to retrieve. A numeric LinkedIn (Sales Navigator) list ID is accepted too",
            "schema": {
              "type": "string"
            },
            "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
          }
        ],
        "responses": {
          "200": {
            "description": "The list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List"
                },
                "example": {
                  "name": "Tech Companies 2024",
                  "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                  "linkedin_id": "7123456789012345678",
                  "type": "companies",
                  "status": "FINISHED",
                  "companies_requested_count": 2,
                  "companies_found_count": 1,
                  "companies_not_found": [
                    "google"
                  ],
                  "created_at": "2024-01-01T00:00:00Z",
                  "updated_at": "2024-01-02T00:00:00Z",
                  "companies": [
                    {
                      "linkedin_url": "https://www.linkedin.com/company/pipecorn",
                      "linkedin_id": "12345678",
                      "company_name": "Pipecorn",
                      "company_website": "https://pipecorn.com",
                      "domain": "pipecorn.com",
                      "description": "B2B sales intelligence platform",
                      "industry": "Technology, Information and Internet",
                      "location": "Paris, France",
                      "employee_count": 12,
                      "employee_range": "11-50",
                      "company_type": "Privately Held",
                      "year_founded": 2024
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No list with this ID is accessible to you",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "example": {
                  "error": "List not found"
                }
              }
            }
          }
        },
        "tags": [
          "List"
        ],
        "operationId": "retrieveASpecificList"
      },
      "put": {
        "summary": "Update a list",
        "description": "Appends companies to a list and restarts its import.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "UUID of the list to update. A numeric LinkedIn (Sales Navigator) list ID is accepted too",
            "schema": {
              "type": "string"
            },
            "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "List updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List"
                },
                "example": {
                  "name": "Tech Companies 2024",
                  "id": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                  "linkedin_id": "7123456789012345678",
                  "type": "companies",
                  "status": "ONGOING",
                  "companies_requested_count": 2,
                  "companies_found_count": 1,
                  "companies_not_found": [],
                  "created_at": "2024-01-01T00:00:00Z",
                  "updated_at": "2024-01-02T00:00:00Z",
                  "companies": [
                    {
                      "linkedin_url": "https://www.linkedin.com/company/pipecorn",
                      "linkedin_id": "12345678",
                      "company_name": "Pipecorn",
                      "company_website": "https://pipecorn.com"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "examples": {
                  "invalid_json": {
                    "summary": "Invalid JSON",
                    "value": {
                      "error": "Invalid JSON"
                    }
                  },
                  "invalid_company": {
                    "summary": "each company must be an object with a name",
                    "value": {
                      "error": "each company must be an object with a name"
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No list with this ID is accessible to you",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "example": {
                  "error": "List not found"
                }
              }
            }
          },
          "422": {
            "description": "Invalid `live` or `webhook_url`, missing or expired LinkedIn credentials in live mode, plan limit reached, or the list could not be saved (returns the list of validation messages)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "examples": {
                  "invalid_live": {
                    "summary": "Invalid live value. Must be a boolean (true/false)",
                    "value": {
                      "error": "Invalid live value. Must be a boolean (true/false)"
                    }
                  },
                  "no_credentials": {
                    "summary": "LinkedIn credentials not found. Please connect your LinkedIn account.",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "expired_credentials": {
                    "summary": "LinkedIn credentials expired. Update your connection on Pipecorn interface, or set parameter 'live' to false in your request body",
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface, or set parameter 'live' to false in your request body"
                    }
                  },
                  "plan_limit": {
                    "summary": "Can't proceed with the request. Plan limit reached.",
                    "value": {
                      "error": "Can't proceed with the request. Plan limit reached."
                    }
                  },
                  "invalid_webhook": {
                    "summary": "Invalid webhook_url format",
                    "value": {
                      "error": "Invalid webhook_url format"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "tags": [
          "List"
        ],
        "operationId": "updateAList"
      }
    },
    "/locations": {
      "post": {
        "summary": "Get the location id of a specific location",
        "description": "Resolve location names to IDs used by search endpoints. The `source` parameter selects which catalog to resolve against:\n\n- `live` (default): LinkedIn Sales Navigator. Requires valid LinkedIn credentials on the account.\n- `database`: the internal geo database used by the company/lead database search endpoints. No LinkedIn credentials required.\n- `hiring`: the hiring-signal location catalog, used by `included_locations` and `excluded_locations` of `POST /intents/accounts/hiring`. No LinkedIn credentials required.\n\nThe shape of each returned item depends on the `source` (see the response examples below).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "San Francisco",
                    "description": "The name of the location to get the id of"
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "live",
                      "database",
                      "hiring"
                    ],
                    "default": "live",
                    "example": "live",
                    "description": "Which location catalog to resolve against. `live` uses LinkedIn Sales Navigator (requires LinkedIn credentials); `database` uses the internal geo database; `hiring` uses the hiring-signal catalog. Defaults to `live` when omitted."
                  }
                },
                "example": {
                  "name": "San Francisco",
                  "source": "live"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Locations retrieved successfully. Each item always includes `id` and `name`; additional fields depend on the `source`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "integer"
                          }
                        ],
                        "description": "The ID of the location, to be passed to search endpoints. An integer for `source: hiring`, a string otherwise. IDs only work on the endpoints that use the same source."
                      },
                      "name": {
                        "type": "string",
                        "description": "The name of the location. For `source: live` this is the full display name."
                      },
                      "display_name": {
                        "type": "string",
                        "description": "Full human-readable location name. Returned for `source: hiring` only."
                      },
                      "country_code": {
                        "type": "string",
                        "description": "ISO 3166-1 alpha-2 country code. Returned for `source: hiring` only."
                      },
                      "type": {
                        "type": "string",
                        "description": "Geo-zone kind (e.g. country, region, city). Returned for `source: database` only."
                      },
                      "subtitle": {
                        "type": "string",
                        "description": "Human-readable context such as parent regions and kind. Returned for `source: database` only."
                      }
                    }
                  }
                },
                "examples": {
                  "live": {
                    "summary": "source: live (LinkedIn Sales Navigator)",
                    "value": [
                      {
                        "name": "San Francisco Bay Area",
                        "id": "90000084"
                      },
                      {
                        "name": "San Francisco, California, United States",
                        "id": "102277331"
                      }
                    ]
                  },
                  "database": {
                    "summary": "source: database (internal geo database)",
                    "value": [
                      {
                        "id": "country:fr",
                        "name": "France",
                        "type": "country",
                        "subtitle": "country"
                      }
                    ]
                  },
                  "hiring": {
                    "summary": "source: hiring (hiring-signal catalog)",
                    "value": [
                      {
                        "id": 4671654,
                        "display_name": "Austin, Texas, United States",
                        "name": "Austin",
                        "country_code": "US"
                      },
                      {
                        "id": 5016884,
                        "display_name": "Austin, Minnesota, United States",
                        "name": "Austin",
                        "country_code": "US"
                      }
                    ]
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "The request body is not a JSON object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiscellaneousError"
                },
                "examples": {
                  "invalid_json": {
                    "summary": "Invalid JSON",
                    "value": {
                      "error": "Invalid JSON"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "`name` is missing, `source` is not one of `hiring`, `live`, `database`, the LinkedIn connection is missing or expired (`source: live`, the default), or the hiring catalog could not be reached (`source: hiring`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiscellaneousError"
                },
                "examples": {
                  "missing_name": {
                    "summary": "name is missing",
                    "value": {
                      "error": "Name parameter is required"
                    }
                  },
                  "invalid_source": {
                    "summary": "Unknown source",
                    "value": {
                      "error": "Invalid source. Must be one of: hiring, live, database"
                    }
                  },
                  "linkedin_not_found": {
                    "summary": "No LinkedIn connection (source: live)",
                    "value": {
                      "error": "LinkedIn credentials not found. Please connect your LinkedIn account."
                    }
                  },
                  "linkedin_expired": {
                    "summary": "LinkedIn credentials expired (source: live)",
                    "value": {
                      "error": "LinkedIn credentials expired. Update your connection on Pipecorn interface"
                    }
                  },
                  "hiring_lookup_failed": {
                    "summary": "Hiring catalog unavailable (source: hiring)",
                    "value": {
                      "error": "Location lookup failed. Please try again later."
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Miscellaneous"
        ],
        "operationId": "getTheLocationIdOfASpecificLocation"
      }
    },
    "/credits": {
      "get": {
        "summary": "Retrieve credit balances",
        "description": "Returns the current credit balances and limits for various services",
        "responses": {
          "200": {
            "description": "Remaining credits and quotas, with the plan limits they count against",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credit"
                }
              }
            }
          }
        },
        "tags": [
          "Miscellaneous"
        ],
        "operationId": "retrieveCreditBalances"
      }
    },
    "/credits_consumption": {
      "get": {
        "summary": "Retrieve credit consumption for a date range",
        "description": "Returns your current credit balance and the total enrichment credits consumed between a start and end date (inclusive). Dates are provided as `YYYY-MM-DD` query parameters and are interpreted in UTC, from the start of `start_date` to the end of `end_date`.",
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "description": "Start of the range (inclusive), formatted as YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-01-01"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": true,
            "description": "End of the range (inclusive), formatted as YYYY-MM-DD. Must be on or after start_date.",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-01-31"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current balance and credits consumed over the requested range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditConsumption"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "422": {
            "description": "Missing or invalid date parameters (missing date, malformed date, or start_date after end_date)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiscellaneousError"
                }
              }
            }
          }
        },
        "tags": [
          "Miscellaneous"
        ],
        "operationId": "retrieveCreditConsumptionForADateRange"
      }
    },
    "/account": {
      "get": {
        "summary": "Retrieve account information",
        "description": "Returns the current account information: subscription plan, the email address of the user the API key belongs to, and the integration session status. With a workspace key, it also lists the session status of every workspace member.",
        "responses": {
          "200": {
            "description": "Account information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          }
        },
        "tags": [
          "Miscellaneous"
        ],
        "operationId": "retrieveAccountInformation"
      }
    },
    "/job_title_suggestions": {
      "post": {
        "summary": "Suggest job titles",
        "description": "Expands job titles into variations with AI: other seniority levels with the same responsibility, feminine and masculine forms, and translations into your agent languages (French and English by default). Also suggests keywords to exclude, such as `assistant` or `intern`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "job_titles"
                ],
                "properties": {
                  "job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Job titles to expand (strings)",
                    "example": [
                      "Head of Marketing",
                      "Responsable Communication"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Suggestions. An empty list means no suggestion could be generated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "suggestions"
                  ],
                  "properties": {
                    "suggestions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "jobTitle": {
                            "type": "string",
                            "example": "Chief Marketing Officer"
                          },
                          "selectionType": {
                            "type": "string",
                            "enum": [
                              "INCLUDED",
                              "EXCLUDED"
                            ],
                            "description": "`INCLUDED` for a title variation, `EXCLUDED` for a keyword to exclude",
                            "example": "INCLUDED"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "suggestions": [
                    {
                      "jobTitle": "CMO",
                      "selectionType": "INCLUDED"
                    },
                    {
                      "jobTitle": "Directeur Marketing",
                      "selectionType": "INCLUDED"
                    },
                    {
                      "jobTitle": "Assistant",
                      "selectionType": "EXCLUDED"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request body is not a JSON object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiscellaneousError"
                },
                "examples": {
                  "invalid_json": {
                    "summary": "Invalid JSON",
                    "value": {
                      "error": "Invalid JSON"
                    }
                  },
                  "not_object": {
                    "summary": "Request body must be a JSON object",
                    "value": {
                      "error": "Request body must be a JSON object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiscellaneousError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid `job_titles`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiscellaneousError"
                },
                "examples": {
                  "missing": {
                    "summary": "job_titles is required",
                    "value": {
                      "error": "job_titles is required"
                    }
                  },
                  "not_array": {
                    "summary": "job_titles must be an array",
                    "value": {
                      "error": "job_titles must be an array"
                    }
                  },
                  "not_strings": {
                    "summary": "job_titles must be an array of strings",
                    "value": {
                      "error": "job_titles must be an array of strings"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiscellaneousError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            }
          }
        },
        "tags": [
          "Miscellaneous"
        ],
        "operationId": "suggestJobTitles"
      }
    },
    "/personas": {
      "get": {
        "summary": "List personas",
        "description": "Returns the personas of your account (or of every member of your workspace when you authenticate with a workspace key), newest first.",
        "responses": {
          "200": {
            "description": "The personas",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "personas"
                  ],
                  "properties": {
                    "personas": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Persona"
                      }
                    }
                  }
                },
                "example": {
                  "personas": [
                    {
                      "uuid": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                      "name": "VP Engineering France",
                      "description": "Engineering leaders at French SaaS scale-ups",
                      "included_job_titles": [
                        "VP of Engineering",
                        "CTO"
                      ],
                      "excluded_job_titles": [
                        "Assistant"
                      ],
                      "included_industries": [
                        "4"
                      ],
                      "excluded_industries": [],
                      "included_locations": [
                        "105015875"
                      ],
                      "excluded_locations": [],
                      "company_size": [
                        "51-200",
                        "201-500"
                      ],
                      "sales_nav_url": "https://www.linkedin.com/sales/search/people?query=...",
                      "created_at": "2025-01-03T17:35:33.073Z",
                      "updated_at": "2025-01-03T17:35:33.073Z"
                    }
                  ]
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "tags": [
          "Personas"
        ],
        "operationId": "listPersonas"
      },
      "post": {
        "summary": "Create a persona",
        "description": "Creates a persona from structured filters. The Sales Navigator URL is derived from the filters.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "job_titles"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name of the persona",
                    "example": "VP Engineering France"
                  },
                  "description": {
                    "type": "string",
                    "description": "Free-text description of the persona",
                    "example": "Engineering leaders at French SaaS scale-ups"
                  },
                  "job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Job titles to include. At least one is required",
                    "example": [
                      "VP of Engineering",
                      "CTO"
                    ]
                  },
                  "excluded_job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Job titles to exclude",
                    "example": [
                      "Assistant",
                      "Intern"
                    ]
                  },
                  "ai_expand_job_titles": {
                    "type": "boolean",
                    "default": false,
                    "description": "When `true`, the titles in `job_titles` are expanded with AI into variations (other seniority levels and languages, based on your agent language preferences). Suggested exclusions are added to `excluded_job_titles`."
                  },
                  "included_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn industry IDs to include",
                    "example": [
                      "4"
                    ]
                  },
                  "excluded_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn industry IDs to exclude",
                    "example": []
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to include (see the Location IDs endpoint)",
                    "example": [
                      "105015875"
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to exclude",
                    "example": []
                  },
                  "company_size": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "Self-employed",
                        "1-10",
                        "11-50",
                        "51-200",
                        "201-500",
                        "501-1000",
                        "1001-5000",
                        "5001-10000",
                        "10001+"
                      ]
                    },
                    "description": "Company headcount ranges. The LinkedIn size codes `A`–`I` are also accepted for older integrations, and are returned as sent.",
                    "example": [
                      "51-200",
                      "201-500"
                    ]
                  }
                }
              },
              "example": {
                "name": "VP Engineering France",
                "job_titles": [
                  "VP of Engineering",
                  "CTO"
                ],
                "excluded_job_titles": [
                  "Assistant"
                ],
                "included_locations": [
                  "105015875"
                ],
                "company_size": [
                  "51-200",
                  "201-500"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Persona created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Persona"
                },
                "example": {
                  "uuid": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                  "name": "VP Engineering France",
                  "description": "Engineering leaders at French SaaS scale-ups",
                  "included_job_titles": [
                    "VP of Engineering",
                    "CTO"
                  ],
                  "excluded_job_titles": [
                    "Assistant"
                  ],
                  "included_industries": [
                    "4"
                  ],
                  "excluded_industries": [],
                  "included_locations": [
                    "105015875"
                  ],
                  "excluded_locations": [],
                  "company_size": [
                    "51-200",
                    "201-500"
                  ],
                  "sales_nav_url": "https://www.linkedin.com/sales/search/people?query=...",
                  "created_at": "2025-01-03T17:35:33.073Z",
                  "updated_at": "2025-01-03T17:35:33.073Z"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              }
            }
          },
          "400": {
            "description": "The request body is not a JSON object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "examples": {
                  "invalid_json": {
                    "summary": "Invalid JSON",
                    "value": {
                      "error": "Invalid JSON"
                    }
                  },
                  "not_object": {
                    "summary": "Request body must be a JSON object",
                    "value": {
                      "error": "Request body must be a JSON object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "422": {
            "description": "Validation failed. `job_titles`, `excluded_job_titles`, `included_industries`, `excluded_industries`, `included_locations`, `excluded_locations` and `company_size` must be arrays; a failed save returns the list of validation messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "examples": {
                  "name_missing": {
                    "summary": "name is required",
                    "value": {
                      "error": "name is required"
                    }
                  },
                  "no_job_title": {
                    "summary": "At least one job_title is required",
                    "value": {
                      "error": "At least one job_title is required"
                    }
                  },
                  "not_array": {
                    "summary": "job_titles must be an array",
                    "value": {
                      "error": "job_titles must be an array"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "tags": [
          "Personas"
        ],
        "operationId": "createAPersona"
      }
    },
    "/personas/{uuid}": {
      "get": {
        "summary": "Retrieve a persona",
        "description": "Returns a single persona by UUID.",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "UUID of the persona",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
          }
        ],
        "responses": {
          "200": {
            "description": "The persona",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Persona"
                },
                "example": {
                  "uuid": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                  "name": "VP Engineering France",
                  "description": "Engineering leaders at French SaaS scale-ups",
                  "included_job_titles": [
                    "VP of Engineering",
                    "CTO"
                  ],
                  "excluded_job_titles": [
                    "Assistant"
                  ],
                  "included_industries": [
                    "4"
                  ],
                  "excluded_industries": [],
                  "included_locations": [
                    "105015875"
                  ],
                  "excluded_locations": [],
                  "company_size": [
                    "51-200",
                    "201-500"
                  ],
                  "sales_nav_url": "https://www.linkedin.com/sales/search/people?query=...",
                  "created_at": "2025-01-03T17:35:33.073Z",
                  "updated_at": "2025-01-03T17:35:33.073Z"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No persona with this UUID is accessible to you",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "example": {
                  "error": "Persona not found"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "tags": [
          "Personas"
        ],
        "operationId": "retrieveAPersona"
      },
      "put": {
        "summary": "Update a persona",
        "description": "Updates a persona. Omitted fields keep their current value, including each side of an included/excluded filter pair.",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "UUID of the persona",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Every field is optional; omitted fields keep their current value.",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New name. A blank value keeps the current name",
                    "example": "VP Engineering France"
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "description": "New description. Sending the key (even `null`) replaces the current value"
                  },
                  "job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Job titles to include. Replaces the current list; omit it to keep it. The persona must keep at least one included job title",
                    "example": [
                      "VP of Engineering",
                      "CTO"
                    ]
                  },
                  "excluded_job_titles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Job titles to exclude. Replaces the current list; omit it to keep it, send `[]` to clear it",
                    "example": [
                      "Assistant",
                      "Intern"
                    ]
                  },
                  "ai_expand_job_titles": {
                    "type": "boolean",
                    "default": false,
                    "description": "When `true`, the titles in `job_titles` are expanded with AI into variations (other seniority levels and languages, based on your agent language preferences). Suggested exclusions are added to `excluded_job_titles`."
                  },
                  "included_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn industry IDs to include. Replaces the current list; omit it to keep it, send `[]` to clear it",
                    "example": [
                      "4"
                    ]
                  },
                  "excluded_industries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "LinkedIn industry IDs to exclude. Replaces the current list; omit it to keep it, send `[]` to clear it",
                    "example": []
                  },
                  "included_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to include. Replaces the current list; omit it to keep it, send `[]` to clear it",
                    "example": [
                      "105015875"
                    ]
                  },
                  "excluded_locations": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Location IDs to exclude. Replaces the current list; omit it to keep it, send `[]` to clear it",
                    "example": []
                  },
                  "company_size": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "Self-employed",
                        "1-10",
                        "11-50",
                        "51-200",
                        "201-500",
                        "501-1000",
                        "1001-5000",
                        "5001-10000",
                        "10001+"
                      ]
                    },
                    "description": "Company headcount ranges. Replaces the current list; omit it to keep it. The LinkedIn size codes `A`–`I` are also accepted for older integrations, and are returned as sent.",
                    "example": [
                      "51-200",
                      "201-500"
                    ]
                  }
                }
              },
              "example": {
                "job_titles": [
                  "VP of Engineering",
                  "CTO",
                  "Head of Engineering"
                ],
                "excluded_job_titles": [
                  "Assistant"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persona updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Persona"
                },
                "example": {
                  "uuid": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc",
                  "name": "VP Engineering France",
                  "description": "Engineering leaders at French SaaS scale-ups",
                  "included_job_titles": [
                    "VP of Engineering",
                    "CTO"
                  ],
                  "excluded_job_titles": [
                    "Assistant"
                  ],
                  "included_industries": [
                    "4"
                  ],
                  "excluded_industries": [],
                  "included_locations": [
                    "105015875"
                  ],
                  "excluded_locations": [],
                  "company_size": [
                    "51-200",
                    "201-500"
                  ],
                  "sales_nav_url": "https://www.linkedin.com/sales/search/people?query=...",
                  "created_at": "2025-01-03T17:35:33.073Z",
                  "updated_at": "2025-01-03T17:35:33.073Z"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "The request body is not a JSON object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "examples": {
                  "invalid_json": {
                    "summary": "Invalid JSON",
                    "value": {
                      "error": "Invalid JSON"
                    }
                  },
                  "not_object": {
                    "summary": "Request body must be a JSON object",
                    "value": {
                      "error": "Request body must be a JSON object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No persona with this UUID is accessible to you",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "example": {
                  "error": "Persona not found"
                }
              }
            }
          },
          "422": {
            "description": "Validation failed. `job_titles`, `excluded_job_titles`, `included_industries`, `excluded_industries`, `included_locations`, `excluded_locations` and `company_size` must be arrays; a failed save returns the list of validation messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "examples": {
                  "no_job_title": {
                    "summary": "At least one job_title is required",
                    "value": {
                      "error": "At least one job_title is required"
                    }
                  },
                  "not_array": {
                    "summary": "company_size must be an array",
                    "value": {
                      "error": "company_size must be an array"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "tags": [
          "Personas"
        ],
        "operationId": "updateAPersona"
      },
      "delete": {
        "summary": "Delete a persona",
        "description": "Permanently deletes a persona.",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "UUID of the persona",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
          }
        ],
        "responses": {
          "200": {
            "description": "Persona deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message"
                  ],
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Persona deleted successfully"
                    }
                  }
                },
                "example": {
                  "message": "Persona deleted successfully"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "examples": {
                  "missing_key": {
                    "summary": "No API key present",
                    "value": {
                      "error": "No API key present"
                    }
                  },
                  "invalid_key": {
                    "summary": "Invalid API key",
                    "value": {
                      "error": "Invalid API key"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No persona with this UUID is accessible to you",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "example": {
                  "error": "Persona not found"
                }
              }
            }
          },
          "422": {
            "description": "The persona could not be deleted; returns the list of validation messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonasError"
                },
                "example": {
                  "error": "Rate limit exceeded. Please wait before retrying."
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "tags": [
          "Personas"
        ],
        "operationId": "deleteAPersona"
      }
    },
    "/searches": {
      "get": {
        "summary": "Retrieve all searches",
        "description": "Returns the searches the user has access to, newest first, one page at a time. By default only enriched searches are returned. Pass `enriched=false` to return all searches, enriched or not.",
        "parameters": [
          {
            "name": "enriched",
            "in": "query",
            "required": false,
            "description": "By default (or when set to `true`) only enriched searches are returned. Set to `false` to return all searches, enriched or not.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of searches",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "searches": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Search"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "searches",
                    "pagination"
                  ]
                },
                "example": {
                  "searches": [
                    {
                      "id": "6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d",
                      "name": "Heads of Sales - France",
                      "leads_count": 245,
                      "created_at": "2024-01-01T00:00:00Z"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "per_page": 100,
                    "total_count": 1,
                    "has_more": false
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (your plan's per-minute limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchesError"
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          }
        },
        "tags": [
          "Searches"
        ],
        "operationId": "retrieveAllSearches"
      }
    },
    "/searches/{id}": {
      "get": {
        "summary": "Retrieve a specific search",
        "description": "Returns a specific search and, once it is finished, one page of its leads. While the search is still running the response holds only `search` (with `results_ready: false`), without `leads` or `pagination`. This endpoint is exempt from the per-plan rate limit so you can poll it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the search to retrieve",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter leads by their qualification status",
            "schema": {
              "type": "string",
              "enum": [
                "qualified",
                "disqualified"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "The search, with a page of its leads once it is finished",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "search": {
                      "$ref": "#/components/schemas/SearchDetail"
                    },
                    "leads": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Lead"
                      },
                      "description": "Present only when `search.results_ready` is `true`"
                    },
                    "pagination": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      ],
                      "description": "Present only when `search.results_ready` is `true`"
                    }
                  },
                  "required": [
                    "search"
                  ]
                },
                "examples": {
                  "finished": {
                    "summary": "Finished search",
                    "value": {
                      "search": {
                        "uuid": "6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d",
                        "name": "Heads of Sales - France",
                        "status": "finished",
                        "results_ready": true
                      },
                      "leads": [],
                      "pagination": {
                        "page": 1,
                        "per_page": 100,
                        "total_count": 0,
                        "has_more": false
                      }
                    }
                  },
                  "running": {
                    "summary": "Search still running",
                    "value": {
                      "search": {
                        "uuid": "6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d",
                        "name": "Heads of Sales - France",
                        "status": "ongoing",
                        "results_ready": false
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No search with this ID in your account (or your workspace, with a workspace key)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchesError"
                },
                "example": {
                  "error": "Search not found"
                }
              }
            }
          }
        },
        "tags": [
          "Searches"
        ],
        "operationId": "retrieveASpecificSearch"
      },
      "delete": {
        "summary": "Delete a search",
        "description": "Deletes a specific search by its ID. This operation will permanently remove the search and all associated tasks from the system. You can delete your own searches, or those of your workspace members when you authenticate with a workspace key.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the search to delete",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Search deleted successfully"
                    }
                  }
                }
              }
            },
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Search not found. Also returned for a search that belongs to another user outside your account (or outside your workspace, with a workspace key)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Search not found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Searches"
        ],
        "operationId": "deleteASearch"
      }
    },
    "/searches/{id}/leads/status": {
      "patch": {
        "summary": "Update the status of leads",
        "description": "Marks leads of a search as qualified or disqualified, the same status the app shows in a saved list and that `GET /searches/{id}` returns and filters on. Leads are identified by the `lead.id` that `GET /searches/{id}` returns. Disqualifying replaces any existing rejection reason; qualifying clears it. Costs no credits or quota. You can update your own searches, or those of your workspace members when you authenticate with a workspace key.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the search",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "lead_ids",
                  "status"
                ],
                "additionalProperties": false,
                "properties": {
                  "lead_ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1000,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "description": "IDs of the leads to update, as `GET /searches/{id}` returns them in `lead.id`. 1 to 1000.",
                    "example": [
                      "0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "qualified",
                      "disqualified"
                    ],
                    "description": "`qualified` keeps the leads, `disqualified` rejects them."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Why the leads are disqualified, returned as `rejection_reasons`. Ignored when qualifying. Defaults to `Manually disqualified`.",
                    "example": "Not in our ICP"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Leads updated",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "search_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "ID of the search"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "qualified",
                        "disqualified"
                      ]
                    },
                    "rejection_reasons": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Rejection reasons the leads now carry; empty when qualifying",
                      "example": [
                        "Not in our ICP"
                      ]
                    },
                    "updated": {
                      "type": "integer",
                      "description": "Number of leads updated",
                      "example": 1
                    },
                    "unknown_lead_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "IDs that matched no lead of the search",
                      "example": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body: `lead_ids` is missing, empty, not an array of strings or longer than 1000, `status` is not `qualified` or `disqualified`, `reason` is not a string, or the body is not valid JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "status must be one of: qualified, disqualified"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Search not found. Also returned for a search that belongs to another user outside your account (or outside your workspace, with a workspace key)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Search not found"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "The body carries a parameter this endpoint does not take",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Unauthorized parameters detected"
                    },
                    "unauthorized_params": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "permitted_params": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Searches"
        ],
        "operationId": "updateTheStatusOfLeads"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "defaultApiKey": {
        "type": "apiKey",
        "in": "header",
        "description": "Your API key",
        "name": "X-API-KEY"
      }
    },
    "schemas": {
      "NoMatch": {
        "type": "object",
        "description": "Returned with `200` when nothing matches the lookup. Nothing is charged.",
        "properties": {
          "data": {
            "type": "object",
            "nullable": true,
            "description": "Always `null`"
          },
          "message": {
            "type": "string",
            "example": "No company found"
          }
        }
      },
      "Error": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "description": "Human-readable error message. A few validation errors return a list of messages instead of a single string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Longer explanation, sent by validators that add context. Such errors may also carry extra top-level keys like `valid_values` or `example`."
          },
          "details": {
            "description": "Extra detail. A string carrying the parser message with `\"Invalid JSON format in request body\"`; an object with `invalid_departments` and `valid_departments` with `\"Invalid departments\"`.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {
                  "invalid_departments": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "valid_departments": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            ]
          },
          "example": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "A valid value for the rejected parameter, sent by some format validators."
          },
          "invalid_sizes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The rejected `company_size` values."
          },
          "valid_formats": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The accepted values of the rejected parameter."
          },
          "valid_values": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "The accepted values of the rejected revenue bound."
          },
          "valid_currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The accepted `revenue_currency` values."
          },
          "account_email": {
            "type": "string",
            "format": "email",
            "description": "Sent with a LinkedIn `429`: the email of the account whose LinkedIn session was rate limited. With a workspace key, this tells you which member LinkedIn throttled."
          }
        }
      },
      "InsufficientCreditsError": {
        "required": [
          "error",
          "code",
          "top_up_url"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable message. Endpoints priced per result report the shortfall instead, e.g. \"Not enough enrichment credits. You need 30 credits but only have 5 available.\"",
            "example": "Not enough enrichment credits left"
          },
          "code": {
            "type": "string",
            "enum": [
              "insufficient_credits"
            ],
            "description": "Machine-readable error code"
          },
          "top_up_url": {
            "type": "string",
            "format": "uri",
            "description": "Absolute URL of the credits page. Buy credits there, then replay the request.",
            "example": "https://app.pipecorn.com/settings/subscriptions/credits"
          }
        }
      },
      "WorkspaceLimitError": {
        "required": [
          "error",
          "code"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "example": "You have reached your weekly enrichment credit limit for this workspace"
          },
          "code": {
            "type": "string",
            "enum": [
              "workspace_limit_exceeded"
            ],
            "description": "Machine-readable error code. A 403 without this code is not a spending limit: the account is closed, LinkedIn refused access to the resource, or the plan does not include the endpoint."
          }
        }
      },
      "AccountEnrichment": {
        "type": "object",
        "properties": {
          "company_name": {
            "type": "string",
            "description": "Company name",
            "example": "Pipecorn"
          },
          "description": {
            "type": "string",
            "description": "Company description",
            "example": "Ready to hunt without running ?\n\n👨‍👩‍👦‍👦 Squad of 10 outbound experts +\n🦁 One tool to automate your campaigns"
          },
          "industry": {
            "type": "string",
            "description": "Primary industry",
            "example": "Technology, Information and Internet"
          },
          "company_type": {
            "type": "string",
            "description": "Company type",
            "example": "Privately Held"
          },
          "location": {
            "type": "string",
            "description": "Full location string",
            "example": "Paris, Île-de-France, France"
          },
          "headquarters": {
            "type": "object",
            "properties": {
              "country": {
                "type": "string",
                "description": "Country name",
                "example": "France"
              },
              "city": {
                "type": "string",
                "description": "City name",
                "example": "Paris"
              }
            }
          },
          "revenue_range": {
            "type": "object",
            "properties": {
              "estimated_min_revenue": {
                "type": "object",
                "properties": {
                  "currency_code": {
                    "type": "string",
                    "example": "USD"
                  },
                  "amount": {
                    "type": "number",
                    "example": 500
                  },
                  "unit": {
                    "type": "string",
                    "example": "THOUSAND"
                  }
                }
              },
              "estimated_max_revenue": {
                "type": "object",
                "properties": {
                  "currency_code": {
                    "type": "string",
                    "example": "USD"
                  },
                  "amount": {
                    "type": "number",
                    "example": 1
                  },
                  "unit": {
                    "type": "string",
                    "example": "MILLION"
                  }
                }
              }
            },
            "description": "Estimated revenue bounds in USD, each expressed as an amount plus the largest unit it clears (`THOUSAND`, `MILLION`, `BILLION`, `TRILLION`, or `NONE` below a thousand)."
          },
          "website": {
            "type": "string",
            "description": "Company website as stored, including scheme",
            "example": "http://pipecorn.com"
          },
          "domain": {
            "type": "string",
            "description": "Company website domain",
            "example": "pipecorn.com"
          },
          "linkedin_id": {
            "type": "string",
            "description": "LinkedIn company id",
            "example": "104885158"
          },
          "linkedin_url": {
            "type": "string",
            "format": "uri",
            "description": "LinkedIn company profile URL",
            "example": "https://www.linkedin.com/company/pipecorn"
          },
          "entity_urn": {
            "type": "string",
            "description": "LinkedIn company URN identifier",
            "example": "urn:li:fs_salesCompany:104885158"
          },
          "employee_count": {
            "type": "integer",
            "description": "Current number of employees",
            "example": 13
          },
          "employee_display_count": {
            "type": "string",
            "description": "Employee count as a display string",
            "example": "5"
          },
          "employee_range": {
            "type": "string",
            "description": "Employee count range",
            "example": "2-10"
          },
          "employee_count_info": {
            "type": "object",
            "description": "Detailed employee count information",
            "properties": {
              "monthly_change": {
                "type": "integer",
                "description": "Monthly employee count change",
                "example": -17
              },
              "employee_count": {
                "type": "integer",
                "description": "Current number of employees",
                "example": 5
              },
              "employee_display_count": {
                "type": "string",
                "description": "Employee count as a display string",
                "example": "5"
              }
            }
          },
          "department_headcount": {
            "type": "object",
            "description": "Current headcount per department. Keys are department names.",
            "additionalProperties": {
              "type": "integer"
            },
            "example": {
              "Engineering": 1,
              "Business Development": 4,
              "Marketing": 2
            }
          },
          "headcount_growth": {
            "type": "object",
            "description": "Company-wide headcount growth over each window, in percent.",
            "properties": {
              "mom": {
                "type": "number",
                "description": "Month-on-month change, in percent"
              },
              "qoq": {
                "type": "number",
                "description": "Quarter-on-quarter change, in percent"
              },
              "six_months": {
                "type": "number",
                "description": "Six-month change, in percent"
              },
              "yoy": {
                "type": "number",
                "description": "Year-on-year change, in percent"
              },
              "two_years": {
                "type": "number",
                "description": "Two-year change, in percent"
              }
            },
            "example": {
              "mom": 0,
              "qoq": 20,
              "six_months": 33.33,
              "yoy": 33.33,
              "two_years": 140
            }
          },
          "department_headcount_growth": {
            "type": "object",
            "description": "Headcount growth per department. Keys are department names; each value carries the same growth windows as `headcount_growth`.",
            "additionalProperties": {
              "type": "object",
              "description": "Headcount growth for this department, in percent.",
              "properties": {
                "mom": {
                  "type": "number",
                  "description": "Month-on-month change, in percent"
                },
                "qoq": {
                  "type": "number",
                  "description": "Quarter-on-quarter change, in percent"
                },
                "six_months": {
                  "type": "number",
                  "description": "Six-month change, in percent"
                },
                "yoy": {
                  "type": "number",
                  "description": "Year-on-year change, in percent"
                },
                "two_years": {
                  "type": "number",
                  "description": "Two-year change, in percent"
                }
              },
              "example": {
                "mom": 100,
                "qoq": 100
              }
            },
            "example": {
              "Marketing": {
                "mom": 100,
                "qoq": 100,
                "six_months": 100,
                "yoy": 100
              }
            }
          },
          "monthly_visitors": {
            "type": "integer",
            "description": "Estimated monthly visitors to the company website",
            "example": 33
          },
          "monthly_visitor_mom_pct": {
            "type": "number",
            "description": "Month-on-month change in monthly visitors, in percent",
            "example": 0
          },
          "monthly_visitor_qoq_pct": {
            "type": "number",
            "description": "Quarter-on-quarter change in monthly visitors, in percent",
            "example": 0
          },
          "funding_and_investment": {
            "type": "object",
            "description": "Funding history, when Pipecorn holds any for the company.",
            "properties": {
              "crunchbase_total_investment_usd": {
                "type": "number",
                "nullable": true,
                "description": "Total investment raised, in USD"
              },
              "last_funding_round_type": {
                "type": "string",
                "nullable": true,
                "description": "Type of the most recent round, e.g. `series_a`"
              },
              "last_funding_round_investment_usd": {
                "type": "number",
                "nullable": true,
                "description": "Amount raised in the most recent round, in USD"
              },
              "days_since_last_fundraise": {
                "type": "integer",
                "nullable": true,
                "description": "Days since the most recent round closed"
              },
              "crunchbase_investors": {
                "type": "array",
                "nullable": true,
                "items": {
                  "type": "string"
                },
                "description": "Named investors"
              },
              "funding_milestones_timeseries": {
                "type": "array",
                "nullable": true,
                "items": {
                  "type": "object"
                },
                "description": "Funding milestones over time"
              },
              "acquired_by": {
                "type": "string",
                "nullable": true,
                "description": "Acquirer, if the company was acquired"
              },
              "acquisitions": {
                "type": "array",
                "nullable": true,
                "items": {
                  "type": "string"
                },
                "description": "Companies this company has acquired"
              }
            }
          },
          "last_updated": {
            "type": "string",
            "format": "date-time",
            "description": "When Pipecorn last refreshed this company record",
            "example": "2026-07-29T12:46:59"
          }
        },
        "description": "Enriched company account. Any field Pipecorn's companies database does not hold for this company is omitted from the response rather than returned as `null`."
      },
      "AlertsError": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "description": "Human-readable error message. A few validation errors return a list of messages instead of a single string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Longer explanation, sent by validators that add context. Such errors may also carry extra top-level keys like `valid_values` or `example`."
          },
          "details": {
            "type": "string",
            "description": "Parser message, sent with `\"Invalid JSON format in request body\"` when the request body is not valid JSON."
          }
        }
      },
      "Alert": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "example": "3f6c2a1e-9b8d-4c1f-a2e3-5d6f7a8b9c0d"
          },
          "name": {
            "type": "string",
            "example": "Signal NEW_HIRES - 2025-01-03 17:35:33"
          },
          "alert_type": {
            "type": "string",
            "enum": [
              "NEW_HIRES",
              "JOB_CHANGES",
              "JOB_POSTING",
              "SOCIAL_LISTENING",
              "STACK",
              "CUSTOM_LEAD",
              "CUSTOM_ACCOUNT",
              "COMPANY_SIGNAL"
            ],
            "example": "NEW_HIRES"
          },
          "source": {
            "type": "string",
            "enum": [
              "database",
              "sales_navigator",
              "linkedin",
              "job_postings"
            ],
            "description": "Where the alert runs. `database`: the Pipecorn database (`company_signal`, `job_changes`, and `new_hires` created with `live: false`). `sales_navigator`: a saved search in your Sales Navigator account (`custom`, and `new_hires` created with `live: true`). `linkedin`: LinkedIn posts (`social_listening`). `job_postings`: job postings data (`job_posting` and `stack`).",
            "example": "database"
          },
          "frequency": {
            "type": "string",
            "nullable": true,
            "enum": [
              "DAILY",
              "WEEKLY",
              "MONTHLY"
            ],
            "example": "DAILY"
          },
          "active": {
            "type": "boolean",
            "example": true
          },
          "webhook_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "URL each run posts its results to. `null` if the alert has no webhook",
            "example": "https://hooks.example.com/pipecorn"
          },
          "skip_first_run": {
            "type": "boolean",
            "description": "`true` if the alert was created with its first run disabled",
            "example": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-01-03T17:35:33.073Z"
          },
          "latest_search_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When the alert last produced a search. `null` if it has not run yet",
            "example": "2025-01-04T17:35:33.073Z"
          }
        }
      },
      "AlertSearch": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Search UUID, usable with `GET /searches/{id}`",
            "example": "598267ec-ac11-41b3-849f-bd360b185b76"
          },
          "name": {
            "type": "string",
            "example": "Signal NEW_HIRES - 2025-01-04"
          },
          "status": {
            "type": "string",
            "nullable": true,
            "description": "Lowercased search status, e.g. `finished`, `ongoing`, `not_started`, `error`",
            "example": "finished"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-01-04T17:35:33.073Z"
          },
          "leads_count": {
            "type": "integer",
            "description": "Number of leads the search actually holds (not the number of leads requested)",
            "example": 12
          },
          "results_url": {
            "type": "string",
            "format": "uri",
            "description": "Where to fetch the run's leads: `GET /searches/{id}`",
            "example": "https://app.pipecorn.com/api/v2/searches/598267ec-ac11-41b3-849f-bd360b185b76"
          }
        }
      },
      "AlertList": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "List UUID, usable with `GET /lists/{id}`",
            "example": "8c1d6e2f-4a3b-4f5c-9d8e-7a6b5c4d3e2f"
          },
          "name": {
            "type": "string",
            "example": "Signal Fintech accounts - 2026-11-03"
          },
          "status": {
            "type": "string",
            "nullable": true,
            "description": "Lowercased list status, e.g. `finished`, `ongoing`, `not_started`",
            "example": "finished"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-11-03T09:00:00.000Z"
          },
          "companies_count": {
            "type": "integer",
            "description": "Number of companies the run found",
            "example": 7
          },
          "results_url": {
            "type": "string",
            "format": "uri",
            "description": "Where to fetch the run's companies: `GET /lists/{id}`",
            "example": "https://app.pipecorn.com/api/v2/lists/8c1d6e2f-4a3b-4f5c-9d8e-7a6b5c4d3e2f"
          }
        }
      },
      "EnrichmentsError": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "description": "Human-readable error message. A few validation errors return a list of messages instead of a single string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Longer explanation, sent by validators that add context. Such errors may also carry extra top-level keys like `valid_values` or `example`."
          },
          "details": {
            "type": "string",
            "description": "Parser message, sent with `\"Invalid JSON format in request body\"` when the request body is not valid JSON."
          }
        }
      },
      "EnrichmentRequest": {
        "type": "object",
        "properties": {
          "enrichment_type": {
            "type": "array",
            "minItems": 1,
            "maxItems": 3,
            "items": {
              "type": "string",
              "enum": [
                "email",
                "phone",
                "personal_email"
              ]
            },
            "description": "What to look for: any combination of `email`, `phone` and `personal_email`, e.g. `[\"email\"]` or `[\"email\", \"phone\"]`. `phone` and `personal_email` need `linkedin_url`; `personal_email` also needs account-level GDPR consent."
          },
          "firstname": {
            "type": "string",
            "description": "First name of the contact."
          },
          "lastname": {
            "type": "string",
            "description": "Last name of the contact."
          },
          "linkedin_url": {
            "type": "string",
            "format": "uri",
            "description": "LinkedIn profile URL of the contact.",
            "example": "https://www.linkedin.com/in/mathieu-brun-picard/"
          },
          "domain": {
            "type": "string",
            "description": "Company domain.",
            "example": "pipecorn.com"
          },
          "company_name": {
            "type": "string",
            "description": "Company name.",
            "example": "Pipecorn"
          },
          "webhook_url": {
            "type": "string",
            "format": "uri",
            "description": "Webhook URL to receive enrichment results"
          },
          "phone_country_codes": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "ISO 3166-1 alpha-2 country code (e.g. \"US\", \"FR\", \"GB\")"
            },
            "description": "Optional. Restrict phone enrichment to phone numbers from these countries. When omitted, the user's account-level default phone country codes are applied."
          },
          "phone_type": {
            "type": "array",
            "maxItems": 1,
            "items": {
              "type": "string",
              "enum": [
                "all",
                "mobile"
              ]
            },
            "default": [
              "all"
            ],
            "description": "Optional. Filters the phone numbers returned by phone enrichment. `[\"all\"]` (default) returns every number found; `[\"mobile\"]` returns only mobile numbers (`type` of `mobile` or `fixed_or_mobile`) and drops landlines, VoIP, toll-free and other non-mobile numbers. With `[\"mobile\"]` the waterfall keeps querying providers until one returns a mobile number. Any other value is rejected with `422`. Ignored unless `enrichment_type` includes `phone`."
          },
          "skip_crm": {
            "type": "boolean",
            "default": false,
            "description": "Optional. When your HubSpot or Salesforce already holds the contact's email or phone, it is returned without a search and costs no credit. Send `true` to run the paid search anyway, for example when the CRM value is out of date. See [Values from your CRM](/api-reference/endpoints/enrichments/single#values-from-your-crm)."
          },
          "custom": {
            "type": "object",
            "description": "Custom fields to include with the enrichment that will be returned in the webhook (like crm id, etc.)",
            "additionalProperties": true
          }
        },
        "required": [
          "enrichment_type"
        ],
        "anyOf": [
          {
            "required": [
              "linkedin_url"
            ]
          },
          {
            "required": [
              "firstname",
              "lastname"
            ],
            "anyOf": [
              {
                "required": [
                  "domain"
                ]
              },
              {
                "required": [
                  "company_name"
                ]
              }
            ]
          }
        ],
        "description": "Send `linkedin_url`, or `firstname` + `lastname` with `domain` or `company_name`. A `linkedin_url` alone is enough for every enrichment type; without it, only `email` can run."
      },
      "SignalsError": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "description": "Human-readable error message. A few validation errors return a list of messages instead of a single string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Longer explanation, sent by validators that add context. Such errors may also carry extra top-level keys like `valid_values` or `example`."
          },
          "details": {
            "type": "string",
            "description": "Parser message, sent with `\"Invalid JSON format in request body\"` when the request body is not valid JSON."
          },
          "unauthorized_params": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The request keys the endpoint does not accept, sent with `\"Unauthorized parameters detected\"`."
          },
          "permitted_params": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sent with `\"Unauthorized parameters detected\"`. The stack endpoints list every key they accept; hiring and growth list the accepted keys present in the request."
          }
        }
      },
      "LeadsNoMatch": {
        "type": "object",
        "description": "Returned with `200` when nothing matches the lookup. Nothing is charged.",
        "properties": {
          "data": {
            "type": "object",
            "nullable": true,
            "description": "Always `null`"
          },
          "message": {
            "type": "string",
            "example": "No lead found"
          }
        }
      },
      "LeadsError": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "description": "Human-readable error message. A few validation errors return a list of messages instead of a single string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Longer explanation, sent by validators that add context. Such errors may also carry extra top-level keys like `valid_values` or `example`."
          },
          "details": {
            "type": "string",
            "description": "Parser message, sent with `\"Invalid JSON format in request body\"` when the request body is not valid JSON."
          },
          "account_email": {
            "type": "string",
            "format": "email",
            "description": "Sent with a LinkedIn `429`: the email of the account whose LinkedIn session was rate limited. With a workspace key, this tells you which member LinkedIn throttled."
          }
        }
      },
      "LeadEnrichment": {
        "type": "object",
        "properties": {
          "first_name": {
            "type": "string",
            "description": "First name of the lead"
          },
          "last_name": {
            "type": "string",
            "description": "Last name of the lead"
          },
          "title": {
            "type": "string",
            "description": "Current job title"
          },
          "linkedin_profile_url": {
            "type": "string",
            "format": "uri",
            "description": "URL to the lead's LinkedIn profile"
          },
          "linkedin_id_url": {
            "type": "string",
            "format": "uri",
            "description": "Internal-URN LinkedIn profile URL, derived from `regular_urn` (`https://www.linkedin.com/in/<ACo…>`). Stable across vanity-URL changes.",
            "nullable": true
          },
          "regular_urn": {
            "type": "string",
            "description": "LinkedIn regular URN identifier",
            "nullable": true
          },
          "lk_headline": {
            "type": "string",
            "description": "LinkedIn headline"
          },
          "lk_connections_count": {
            "type": "integer",
            "description": "Number of LinkedIn connections"
          },
          "years_in_position": {
            "type": "integer",
            "nullable": true,
            "description": "Number of years in current position"
          },
          "months_in_position": {
            "type": "integer",
            "nullable": true,
            "description": "Number of months in current position"
          },
          "years_in_company": {
            "type": "integer",
            "nullable": true,
            "description": "Number of years in current company"
          },
          "months_in_company": {
            "type": "integer",
            "nullable": true,
            "description": "Number of months in current company"
          },
          "current_position": {
            "type": "object",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/LeadPosition"
              }
            ],
            "description": "The current role. Also the first entry of `positions`, where it carries `current: true`."
          },
          "positions": {
            "type": "array",
            "description": "The person's role history.",
            "items": {
              "$ref": "#/components/schemas/LeadPosition"
            }
          },
          "title_description": {
            "type": "string",
            "description": "Description of the current title/role"
          },
          "summary": {
            "type": "string",
            "nullable": true,
            "description": "Profile summary"
          },
          "full_name": {
            "type": "string",
            "description": "Full name of the lead"
          },
          "sales_navigator_profile_url": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "description": "Sales Navigator profile URL, derived from the person's Sales Navigator (`ACw…`) key when the people database holds one"
          },
          "linkedin_url": {
            "type": "string",
            "format": "uri",
            "description": "Public LinkedIn profile URL, falling back to the internal-URN URL",
            "example": "https://www.linkedin.com/in/mathieu-brun-picard"
          },
          "location": {
            "type": "string",
            "description": "Where the person is based",
            "example": "San Francisco Bay Area"
          },
          "num_of_followers": {
            "type": "integer",
            "nullable": true,
            "description": "LinkedIn follower count",
            "example": 7880
          },
          "initials": {
            "type": "string",
            "nullable": true,
            "description": "Initials of the person",
            "example": "MB"
          },
          "previous_position": {
            "type": "object",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/LeadPosition"
              }
            ],
            "description": "The role held before the current one."
          },
          "urn": {
            "type": "string",
            "nullable": true,
            "description": "LinkedIn Sales Navigator URN identifier"
          },
          "start_date_job": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Start date in the current position. Pipecorn's people database holds a single current-role start date and no separate company start, so this matches `start_date_company`."
          },
          "start_date_company": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Start date at the current company. See `start_date_job`."
          },
          "connection_degree": {
            "type": "integer",
            "nullable": true,
            "description": "LinkedIn connection degree between the person and your connected LinkedIn account (`1` for a 1st-degree connection). Only returned with `live: true`.",
            "example": 2
          },
          "is_premium_linkedin": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the person has LinkedIn Premium. Only returned with `live: true`."
          },
          "is_open_profile_linkedin": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the person has an Open Profile, so anyone can send them an InMail. Only returned with `live: true`."
          },
          "is_open_to_work_linkedin": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether the person shows Open to Work on LinkedIn. Only returned with `live: true`."
          },
          "company_total_headcount": {
            "type": "integer",
            "nullable": true,
            "description": "Total headcount of the person's current company. Only returned with `live: true`.",
            "example": 1250
          },
          "company_country_code": {
            "type": "string",
            "nullable": true,
            "description": "ISO 3166-1 alpha-2 country code of the company. Only returned with `live: true`.",
            "example": "FR"
          },
          "company_monthly_visitors": {
            "type": "integer",
            "nullable": true,
            "description": "Monthly website visitors of the company. Only returned with `live: true`."
          },
          "company_headcount_growth": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true,
            "description": "Headcount growth of the company, as on `POST /accounts/single_enrich`. Only returned with `live: true`."
          },
          "company_funding_and_investment": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true,
            "description": "Funding rounds and investors of the company, as on `POST /accounts/single_enrich`. Only returned with `live: true`."
          },
          "company_competitors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true,
            "description": "Organic and paid search competitors of the company. Only returned with `live: true`."
          },
          "company_data_last_updated": {
            "type": "string",
            "nullable": true,
            "description": "When the company data was last refreshed. Only returned with `live: true`."
          }
        },
        "description": "Enriched person. Any field Pipecorn's people database does not hold for this person is returned as `null`."
      },
      "NewLeadSearch": {
        "type": "object",
        "properties": {
          "search_url": {
            "type": "string",
            "format": "uri",
            "description": "A LinkedIn Sales Navigator search URL (`https://www.linkedin.com/sales/search/...`). Any other URL is rejected with `422`. Required unless `persona_id` is sent."
          },
          "persona_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of one of your personas. Its Sales Navigator search URL is used when `search_url` is omitted, and its name when `name` is omitted. An unknown UUID returns `404`.",
            "example": "3f1c2e9a-8a7d-4c1b-9f63-2d6e0b5a7c11"
          },
          "webhook_url": {
            "type": "string",
            "format": "uri",
            "description": "Optional webhook URL to receive notifications when the search is complete"
          },
          "name": {
            "type": "string",
            "description": "Name of the lead search. Defaults to a timestamped name when omitted."
          },
          "streaming": {
            "type": "boolean",
            "description": "When set to true, leads will be sent individually to the webhook_url as they are found. This is ideal for integration with platforms like Clay that process leads in real-time.",
            "default": false,
            "example": true
          },
          "custom": {
            "type": "object",
            "description": "Custom fields to include with the lead search that will be returned in the webhook (like crm id, etc.)",
            "additionalProperties": true,
            "example": {
              "hubspot_id": "134567"
            }
          },
          "limit": {
            "type": "integer",
            "description": "Maximum number of leads to return, from 1 to 2500; any other value returns `422`. If omitted, every lead the search finds is returned, up to 2500.",
            "minimum": 1,
            "maximum": 2500,
            "example": 100
          },
          "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": true
          },
          "position": {
            "type": "string",
            "enum": [
              "end",
              "start"
            ],
            "default": "end",
            "description": "Workspace key only. Where the search joins your workspace's lead search queue: `end` (default) behind the searches already waiting, `start` ahead of them. Any other value returns `422`. Ignored with a personal key. See [Lead search queue](/essentials/authentication#lead-search-queue).",
            "example": "start"
          }
        }
      },
      "LeadPosition": {
        "type": "object",
        "description": "A role held by the person, in the order the people database holds them: the current role first, then past roles. Keys absent from the record are omitted.",
        "properties": {
          "pos_id": {
            "type": "integer",
            "description": "LinkedIn position identifier",
            "example": 2316534272
          },
          "title": {
            "type": "string",
            "description": "Job title",
            "example": "Co-founder & CEO"
          },
          "current": {
            "type": "boolean",
            "description": "Whether the person still holds this role",
            "example": true
          },
          "company_name": {
            "type": "string",
            "description": "Name of the company",
            "example": "Pipecorn"
          },
          "name": {
            "type": "string",
            "description": "Alias of `company_name`",
            "example": "Pipecorn"
          },
          "company_id": {
            "type": "string",
            "description": "Pipecorn company id",
            "example": "3735071"
          },
          "company_urn": {
            "type": "string",
            "description": "LinkedIn company URN",
            "example": "urn:li:fs_salesCompany:3735071"
          },
          "company_domain": {
            "type": "string",
            "description": "Company website domain",
            "example": "pipecorn.com"
          },
          "company_logo": {
            "type": "string",
            "format": "uri",
            "description": "Company logo URL"
          },
          "description": {
            "type": "string",
            "description": "Role or company description"
          },
          "location": {
            "type": "string",
            "description": "Where the role is based",
            "example": "San Francisco Bay Area"
          },
          "employment_type": {
            "type": "string",
            "description": "Employment type, when the record carries one"
          },
          "started_on": {
            "type": "object",
            "nullable": true,
            "description": "Year and month the role started or ended",
            "properties": {
              "year": {
                "type": "integer",
                "example": 2024
              },
              "month": {
                "type": "integer",
                "example": 1
              }
            }
          },
          "ended_on": {
            "type": "object",
            "nullable": true,
            "description": "Year and month the role started or ended",
            "properties": {
              "year": {
                "type": "integer",
                "example": 2024
              },
              "month": {
                "type": "integer",
                "example": 1
              }
            }
          },
          "tenure_at_position": {
            "type": "object",
            "nullable": true,
            "description": "Time spent in this role",
            "properties": {
              "num_years": {
                "type": "integer",
                "example": 2
              },
              "num_months": {
                "type": "integer",
                "example": 0
              }
            }
          },
          "tenure_at_company": {
            "type": "object",
            "nullable": true,
            "description": "Time spent at this company",
            "properties": {
              "num_years": {
                "type": "integer",
                "example": 2
              },
              "num_months": {
                "type": "integer",
                "example": 0
              }
            }
          }
        }
      },
      "List": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the list",
            "example": "Tech Companies 2024"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of the list",
            "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
          },
          "linkedin_id": {
            "type": "string",
            "description": "ID of the LinkedIn Sales Navigator list, as a string. Empty when the list was created with `live: false`",
            "example": "7123456789012345678"
          },
          "type": {
            "type": "string",
            "enum": [
              "companies",
              "leads"
            ],
            "description": "What the list contains",
            "example": "companies"
          },
          "status": {
            "type": "string",
            "enum": [
              "NOT_STARTED",
              "ONGOING",
              "FINISHED",
              "ERROR",
              "NOT_ENOUGH_CREDITS",
              "FORBIDDEN",
              "LIMIT_REACHED",
              "UNAUTHORIZED",
              "SCHEDULED"
            ],
            "description": "Status of the list import",
            "example": "FINISHED"
          },
          "companies_requested_count": {
            "type": "integer",
            "description": "Number of companies submitted, or for a list built by `POST /accounts/search`, the number of companies the search imports (company lists only)",
            "example": 2
          },
          "companies_found_count": {
            "type": "integer",
            "description": "Number of companies matched so far (company lists only)",
            "example": 1
          },
          "companies_not_found": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of the submitted companies that could not be matched, lowercased and trimmed (not the objects you submitted). Empty until the list is `FINISHED` (company lists only)",
            "example": [
              "google"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2024-01-01T00:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2024-01-02T00:00:00Z"
          },
          "companies": {
            "type": "array",
            "nullable": true,
            "description": "Matched companies. `null` for lead lists. Fields the source has no value for are `null`",
            "items": {
              "type": "object",
              "properties": {
                "linkedin_url": {
                  "type": "string",
                  "example": "https://www.linkedin.com/company/pipecorn"
                },
                "linkedin_id": {
                  "type": "string",
                  "example": "12345678"
                },
                "company_name": {
                  "type": "string",
                  "example": "Pipecorn"
                },
                "company_website": {
                  "type": "string",
                  "example": "https://pipecorn.com"
                },
                "domain": {
                  "type": "string",
                  "nullable": true,
                  "example": "pipecorn.com"
                },
                "description": {
                  "type": "string",
                  "nullable": true
                },
                "industry": {
                  "type": "string",
                  "nullable": true,
                  "example": "Technology, Information and Internet"
                },
                "location": {
                  "type": "string",
                  "nullable": true,
                  "example": "Paris, France"
                },
                "employee_count": {
                  "type": "integer",
                  "nullable": true,
                  "example": 12
                },
                "employee_range": {
                  "type": "string",
                  "nullable": true,
                  "example": "11-50"
                },
                "company_type": {
                  "type": "string",
                  "nullable": true,
                  "example": "Privately Held"
                },
                "year_founded": {
                  "type": "integer",
                  "nullable": true,
                  "example": 2024
                }
              }
            }
          }
        }
      },
      "NewList": {
        "type": "object",
        "required": [
          "name",
          "companies"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the list",
            "example": "Tech Companies 2024"
          },
          "webhook_url": {
            "type": "string",
            "format": "uri",
            "description": "http(s) URL notified when the list import is complete",
            "example": "https://your-company.com/webhooks/lists"
          },
          "live": {
            "type": "boolean",
            "default": true,
            "description": "`true` (default) also creates or updates a LinkedIn Sales Navigator list, which requires valid LinkedIn credentials on your account. `false` matches the companies against the Pipecorn database only, without touching LinkedIn"
          },
          "companies": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "name"
              ],
              "properties": {
                "name": {
                  "description": "The name of the company",
                  "type": "string",
                  "example": "Pipecorn"
                },
                "country_code": {
                  "description": "The country code where the company is located. Optional but increases the chance of a match.",
                  "type": "string",
                  "example": "FR"
                },
                "domain": {
                  "description": "The company's domain address. Website URL can work as well. Optional but increases the chance of a match.",
                  "type": "string",
                  "example": "pipecorn.com"
                },
                "linkedin_url": {
                  "description": "The company's LinkedIn profile URL (regular or Sales Navigator). Adding it provides a 100% match.",
                  "type": "string",
                  "format": "uri",
                  "example": "https://www.linkedin.com/company/pipecorn"
                }
              }
            },
            "example": [
              {
                "name": "Pipecorn",
                "country_code": "FR",
                "domain": "pipecorn.com",
                "linkedin_url": "https://www.linkedin.com/company/pipecorn"
              },
              {
                "name": "Google",
                "country_code": "US",
                "domain": "google.com",
                "linkedin_url": "https://www.linkedin.com/company/google"
              }
            ]
          }
        }
      },
      "ListError": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "description": "Human-readable error message. A few validation errors return a list of messages instead of a single string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Longer explanation, sent by validators that add context. Such errors may also carry extra top-level keys like `valid_values` or `example`."
          },
          "details": {
            "type": "string",
            "description": "Parser message, sent with `\"Invalid JSON format in request body\"` when the request body is not valid JSON."
          }
        }
      },
      "ListSummary": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the list",
            "example": "Tech Companies 2024"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of the list",
            "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
          },
          "linkedin_id": {
            "type": "string",
            "description": "ID of the LinkedIn Sales Navigator list, as a string. Empty when the list was created with `live: false`",
            "example": "7123456789012345678"
          },
          "type": {
            "type": "string",
            "enum": [
              "companies",
              "leads"
            ],
            "description": "What the list contains",
            "example": "companies"
          },
          "status": {
            "type": "string",
            "enum": [
              "NOT_STARTED",
              "ONGOING",
              "FINISHED",
              "ERROR",
              "NOT_ENOUGH_CREDITS",
              "FORBIDDEN",
              "LIMIT_REACHED",
              "UNAUTHORIZED",
              "SCHEDULED"
            ],
            "description": "Status of the list import",
            "example": "FINISHED"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2024-01-01T00:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2024-01-02T00:00:00Z"
          }
        }
      },
      "Pagination": {
        "type": "object",
        "required": [
          "per_page",
          "total_count",
          "has_more"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "description": "Current page number. Absent when the request used `cursor`.",
            "example": 1
          },
          "per_page": {
            "type": "integer",
            "description": "Rows per page.",
            "example": 100
          },
          "total_count": {
            "type": "integer",
            "description": "Rows across all pages.",
            "example": 245
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page follows.",
            "example": true
          },
          "next_cursor": {
            "type": "string",
            "description": "Pass it as `cursor` to get the next page. Absent on the last page.",
            "example": "WyIyMDI2LTEwLTE3VDEwOjAwOjAwLjAwMDAwMFoiLDQyXQ"
          }
        }
      },
      "ListUpdate": {
        "type": "object",
        "properties": {
          "companies": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name"
              ],
              "properties": {
                "name": {
                  "description": "The name of the company",
                  "type": "string",
                  "example": "Pipecorn"
                },
                "country_code": {
                  "description": "The country code where the company is located. Optional but increases the chance of a match.",
                  "type": "string",
                  "example": "FR"
                },
                "domain": {
                  "description": "The company's domain address. Website URL can work as well. Optional but increases the chance of a match.",
                  "type": "string",
                  "example": "pipecorn.com"
                },
                "linkedin_url": {
                  "description": "The company's LinkedIn profile URL (regular or Sales Navigator). Adding it provides a 100% match.",
                  "type": "string",
                  "format": "uri",
                  "example": "https://www.linkedin.com/company/pipecorn"
                }
              }
            },
            "example": [
              {
                "name": "Pipecorn",
                "country_code": "FR",
                "domain": "pipecorn.com",
                "linkedin_url": "https://www.linkedin.com/company/pipecorn"
              },
              {
                "name": "Google",
                "country_code": "US",
                "domain": "google.com",
                "linkedin_url": "https://www.linkedin.com/company/google"
              }
            ],
            "description": "Companies to append to the list. Companies already in the list are not duplicated"
          },
          "webhook_url": {
            "type": "string",
            "format": "uri",
            "description": "Replaces the list's webhook URL when present"
          },
          "live": {
            "type": "boolean",
            "default": true,
            "description": "`true` (default) also updates the LinkedIn Sales Navigator list, which requires valid LinkedIn credentials. `false` matches against the Pipecorn database only"
          }
        }
      },
      "Credit": {
        "type": "object",
        "properties": {
          "credits": {
            "type": "object",
            "properties": {
              "enrichment": {
                "type": "integer",
                "description": "Number of enrichment credits remaining",
                "example": 3000
              },
              "daily_profile_scraping": {
                "type": "integer",
                "description": "Number of daily profile scraping credits remaining. `null` when the quota is unlimited on your plan.",
                "example": 1500,
                "nullable": true
              },
              "monthly_profile_scraping": {
                "type": "integer",
                "description": "Number of monthly profile scraping credits remaining. `null` when the quota is unlimited on your plan.",
                "example": 40000,
                "nullable": true
              },
              "daily_company_import": {
                "type": "integer",
                "description": "Number of daily company import credits remaining. `null` when the quota is unlimited on your plan.",
                "example": 1000,
                "nullable": true
              },
              "monthly_company_import": {
                "type": "integer",
                "description": "Number of monthly company import credits remaining. `null` when the quota is unlimited on your plan.",
                "example": 10000,
                "nullable": true
              }
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "daily_profile_scraping": {
                "type": "integer",
                "example": 2500,
                "description": "Maximum daily profile scraping credits"
              },
              "monthly_profile_scraping": {
                "type": "integer",
                "example": 50000,
                "description": "Maximum monthly profile scraping credits"
              },
              "daily_company_import": {
                "type": "integer",
                "example": 1000,
                "description": "Maximum daily company import credits"
              },
              "monthly_company_import": {
                "type": "integer",
                "example": 10000,
                "description": "Maximum monthly company import credits"
              }
            },
            "description": "Plan limits. A quota that is unlimited on your plan is left out of this object."
          }
        }
      },
      "CreditConsumption": {
        "type": "object",
        "properties": {
          "current_credit_balance": {
            "type": "integer",
            "description": "Your current enrichment credit balance.",
            "example": 3000
          },
          "consumption": {
            "type": "object",
            "properties": {
              "start_date": {
                "type": "string",
                "format": "date",
                "description": "Start of the range (inclusive), echoed back.",
                "example": "2026-01-01"
              },
              "end_date": {
                "type": "string",
                "format": "date",
                "description": "End of the range (inclusive), echoed back.",
                "example": "2026-01-31"
              },
              "credits_consumed": {
                "type": "integer",
                "description": "Total enrichment credits consumed within the range.",
                "example": 1250
              }
            }
          }
        }
      },
      "MiscellaneousError": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "description": "Human-readable error message. A few validation errors return a list of messages instead of a single string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Longer explanation, sent by validators that add context. Such errors may also carry extra top-level keys like `valid_values` or `example`."
          },
          "details": {
            "type": "string",
            "description": "Parser message, sent with `\"Invalid JSON format in request body\"` when the request body is not valid JSON."
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "account": {
            "type": "object",
            "properties": {
              "plan": {
                "type": "string",
                "description": "The current subscription plan",
                "example": "scale"
              },
              "email": {
                "type": "string",
                "format": "email",
                "description": "Email address of the user the API key belongs to. With a workspace key, the workspace member whose account served this request",
                "example": "jane@acme.com"
              }
            }
          },
          "integrations": {
            "type": "object",
            "properties": {
              "linkedin_session_valid": {
                "type": "boolean",
                "description": "Whether the LinkedIn session is still valid",
                "example": true
              },
              "sales_navigator_session_valid": {
                "type": "boolean",
                "description": "Whether the Sales Navigator session is still valid",
                "example": true
              }
            }
          },
          "workspace": {
            "type": "object",
            "description": "Only sent when the request is authenticated with a workspace key (`X-WORKSPACE-KEY`).",
            "properties": {
              "members": {
                "type": "array",
                "description": "Every workspace member whose LinkedIn account a workspace key rotates across",
                "items": {
                  "type": "object",
                  "properties": {
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "Email address of the member",
                      "example": "reza@acme.com"
                    },
                    "integrations": {
                      "type": "object",
                      "description": "The member's session status, checked live on LinkedIn like the top-level `integrations`",
                      "properties": {
                        "linkedin_session_valid": {
                          "type": "boolean",
                          "description": "Whether the member's LinkedIn session is still valid",
                          "example": true
                        },
                        "sales_navigator_session_valid": {
                          "type": "boolean",
                          "description": "Whether the member's Sales Navigator session is still valid",
                          "example": false
                        }
                      }
                    },
                    "linkedin_rate_limited": {
                      "type": "boolean",
                      "description": "Whether LinkedIn rate limited this member in the last 12 hours. Workspace-key requests skip such members while at least one other member is available.",
                      "example": false
                    }
                  }
                }
              }
            }
          }
        }
      },
      "PersonasError": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "description": "Human-readable error message. A few validation errors return a list of messages instead of a single string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Longer explanation, sent by validators that add context. Such errors may also carry extra top-level keys like `valid_values` or `example`."
          },
          "details": {
            "type": "string",
            "description": "Parser message, sent with `\"Invalid JSON format in request body\"` when the request body is not valid JSON."
          }
        }
      },
      "Persona": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the persona",
            "example": "8e1dcba0-f0bb-4071-99fc-f18ba6559ccc"
          },
          "name": {
            "type": "string",
            "description": "Name of the persona",
            "example": "VP Engineering France"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "Free-text description",
            "example": "Engineering leaders at French SaaS scale-ups"
          },
          "included_job_titles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Job titles to include",
            "example": [
              "VP of Engineering",
              "CTO"
            ]
          },
          "excluded_job_titles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Job titles to exclude",
            "example": [
              "Assistant"
            ]
          },
          "included_industries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "LinkedIn industry IDs to include",
            "example": [
              "4"
            ]
          },
          "excluded_industries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "LinkedIn industry IDs to exclude",
            "example": []
          },
          "included_locations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Location IDs to include",
            "example": [
              "105015875"
            ]
          },
          "excluded_locations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Location IDs to exclude",
            "example": []
          },
          "company_size": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Company size ranges",
            "example": [
              "51-200",
              "201-500"
            ]
          },
          "sales_nav_url": {
            "type": "string",
            "nullable": true,
            "description": "Sales Navigator search URL derived from the filters",
            "example": "https://www.linkedin.com/sales/search/people?query=..."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The creation date of the persona",
            "example": "2025-01-03T17:35:33.073Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The last modified date of the persona",
            "example": "2025-01-03T17:35:33.073Z"
          }
        }
      },
      "SearchesError": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "description": "Human-readable error message. A few validation errors return a list of messages instead of a single string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "Longer explanation, sent by validators that add context. Such errors may also carry extra top-level keys like `valid_values` or `example`."
          },
          "details": {
            "type": "string",
            "description": "Parser message, sent with `\"Invalid JSON format in request body\"` when the request body is not valid JSON."
          }
        }
      },
      "Search": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The unique identifier for the search"
          },
          "name": {
            "type": "string",
            "description": "The name of the search"
          },
          "leads_count": {
            "type": "integer",
            "description": "Number of leads in the search"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the search was created"
          }
        }
      },
      "SearchDetail": {
        "type": "object",
        "properties": {
          "uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The unique identifier for the search"
          },
          "name": {
            "type": "string",
            "description": "The name of the search"
          },
          "status": {
            "type": "string",
            "enum": [
              "finished",
              "not_started",
              "ongoing",
              "rate_limited",
              "unauthorized",
              "forbidden",
              "not_found",
              "internal_server_error",
              "error"
            ],
            "description": "The current status of the search. A search made with a workspace key stays `not_started` while it waits in the [lead search queue](/essentials/authentication#lead-search-queue)."
          },
          "results_ready": {
            "type": "boolean",
            "description": "Whether the search has finished and its leads are available. When false, `leads` and `pagination` are omitted."
          },
          "executed_by": {
            "type": "string",
            "format": "email",
            "description": "Email of the member whose LinkedIn account runs the search. Omitted while a workspace-key search waits in the queue for a member.",
            "example": "reza@acme.com"
          }
        }
      },
      "Lead": {
        "type": "object",
        "properties": {
          "lead": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "ID of the lead. Pass it to `PATCH /searches/{id}/leads/status` to change the lead's status",
                "example": "0b9c7d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e"
              },
              "status": {
                "type": "string",
                "enum": [
                  "QUALIFIED",
                  "DISQUALIFIED"
                ],
                "description": "Current qualification status of the lead"
              },
              "rejection_reasons": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Reasons for rejection if disqualified"
              },
              "first_name": {
                "type": "string",
                "description": "First name of the lead"
              },
              "last_name": {
                "type": "string",
                "description": "Last name of the lead"
              },
              "gender": {
                "type": "string",
                "nullable": true,
                "description": "Gender of the lead"
              },
              "email": {
                "type": "string",
                "nullable": true,
                "description": "Most probable email address"
              },
              "email_status": {
                "type": "string",
                "nullable": true,
                "description": "Deliverability status of the email (e.g. Valid, Catch-all)"
              },
              "phone": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": "List of phone number records"
              },
              "linkedin_url": {
                "type": "string",
                "format": "uri",
                "nullable": true,
                "description": "LinkedIn profile URL"
              },
              "linkedin_id_url": {
                "type": "string",
                "format": "uri",
                "nullable": true,
                "description": "LinkedIn profile URL built from the member's stable id"
              },
              "profile_image_url": {
                "type": "string",
                "format": "uri",
                "nullable": true,
                "description": "Profile image URL"
              },
              "location": {
                "type": "string",
                "nullable": true,
                "description": "Location of the lead"
              },
              "title": {
                "type": "string",
                "nullable": true,
                "description": "Job title of the lead"
              },
              "lk_headline": {
                "type": "string",
                "nullable": true,
                "description": "LinkedIn headline"
              },
              "hire_type": {
                "type": "string",
                "enum": [
                  "new_hire",
                  "promoted"
                ],
                "nullable": true,
                "description": "Whether the lead recently joined the company (new_hire) or was promoted within it"
              },
              "current_position": {
                "type": "object",
                "nullable": true,
                "description": "The lead's current position"
              },
              "previous_position": {
                "type": "object",
                "nullable": true,
                "description": "The lead's previous position"
              },
              "positions": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "nullable": true,
                "description": "The lead's position history"
              },
              "years_in_position": {
                "type": "integer",
                "description": "Years in current position (0 when unknown)"
              },
              "months_in_position": {
                "type": "integer",
                "description": "Months in current position (0 when unknown)"
              },
              "years_in_company": {
                "type": "integer",
                "description": "Years in current company (0 when unknown)"
              },
              "months_in_company": {
                "type": "integer",
                "description": "Months in current company (0 when unknown)"
              }
            }
          },
          "company": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "nullable": true,
                "description": "Company name"
              },
              "cleaned_name": {
                "type": "string",
                "nullable": true,
                "description": "Cleaned company name"
              },
              "website": {
                "type": "string",
                "format": "uri",
                "nullable": true,
                "description": "Company website"
              },
              "location": {
                "type": "string",
                "nullable": true,
                "description": "Company location"
              },
              "industry": {
                "type": "string",
                "nullable": true,
                "description": "Company industry"
              },
              "headquarters": {
                "type": "object",
                "nullable": true,
                "description": "Company headquarters details (returned only when available as structured data)"
              },
              "description": {
                "type": "string",
                "nullable": true,
                "description": "Company description"
              },
              "linkedin_url": {
                "type": "string",
                "format": "uri",
                "nullable": true,
                "description": "Company LinkedIn profile URL"
              },
              "linkedin_id": {
                "type": "string",
                "nullable": true,
                "description": "Company LinkedIn identifier"
              },
              "employee_range": {
                "type": "string",
                "nullable": true,
                "description": "Company employee count range"
              },
              "company_profile_picture": {
                "type": "string",
                "format": "uri",
                "nullable": true,
                "description": "Company profile picture URL"
              }
            }
          }
        }
      }
    },
    "headers": {
      "RateLimit-Limit": {
        "description": "Requests allowed per minute on your plan for this group of endpoints. Absent for unlimited accounts and on endpoints exempt from the plan limit.",
        "schema": {
          "type": "integer",
          "example": 100
        }
      },
      "RateLimit-Remaining": {
        "description": "Requests left in the current one-minute window.",
        "schema": {
          "type": "integer",
          "example": 97
        }
      },
      "RateLimit-Reset": {
        "description": "Seconds until the current window resets and `RateLimit-Remaining` is back to `RateLimit-Limit`.",
        "schema": {
          "type": "integer",
          "example": 42
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying. Sent when the plan limit or a request still in progress caused the error.",
        "schema": {
          "type": "integer",
          "example": 42
        }
      },
      "Idempotent-Replayed": {
        "description": "`true` when this response is a replay of an earlier request sent with the same `Idempotency-Key`. Nothing was run or charged again.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "A unique value you generate per operation, such as a UUID. Retrying with the same key and the same body returns the stored response instead of running the request again, so a retry after a timeout never charges twice. Successful responses are kept for 24 hours; a failed request is not stored and can be retried with the same key.",
        "schema": {
          "type": "string",
          "maxLength": 255,
          "example": "4f1c2e9a-8a7d-4c1b-9f63-2d6e0b5a7c11"
        }
      },
      "Page": {
        "name": "page",
        "in": "query",
        "required": false,
        "description": "Page number, starting at 1. Prefer `cursor`: pages shift when rows are added between two calls.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "default": 1
        }
      },
      "PerPage": {
        "name": "per_page",
        "in": "query",
        "required": false,
        "description": "Rows per page, at most 500.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 100
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "description": "The `pagination.next_cursor` of the previous page, passed back unchanged. Returns the rows that follow it, even if rows were added in between. Omit it for the first page.",
        "schema": {
          "type": "string",
          "example": "WyIyMDI2LTEwLTE3VDEwOjAwOjAwLjAwMDAwMFoiLDQyXQ"
        }
      }
    },
    "responses": {
      "IdempotencyConflict": {
        "description": "A request with this `Idempotency-Key` is still being processed. Wait for the `Retry-After` delay and retry with the same key.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                },
                "code": {
                  "type": "string",
                  "enum": [
                    "idempotency_key_in_use"
                  ]
                }
              }
            },
            "example": {
              "error": "A request with this Idempotency-Key is still being processed",
              "code": "idempotency_key_in_use"
            }
          }
        }
      }
    }
  }
}
