{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipecorn-com/json-schema/pipecorn-com-lead-enrichment-schema.json",
  "title": "LeadEnrichment",
  "description": "Enriched person. Any field Pipecorn's people database does not hold for this person is returned as `null`.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipecorn-com-openapi.json#/components/schemas/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",
        "null"
      ],
      "format": "uri",
      "description": "Internal-URN LinkedIn profile URL, derived from `regular_urn` (`https://www.linkedin.com/in/<ACo…>`). Stable across vanity-URL changes."
    },
    "regular_urn": {
      "type": [
        "string",
        "null"
      ],
      "description": "LinkedIn regular URN identifier"
    },
    "lk_headline": {
      "type": "string",
      "description": "LinkedIn headline"
    },
    "lk_connections_count": {
      "type": "integer",
      "description": "Number of LinkedIn connections"
    },
    "years_in_position": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of years in current position"
    },
    "months_in_position": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of months in current position"
    },
    "years_in_company": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of years in current company"
    },
    "months_in_company": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of months in current company"
    },
    "current_position": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/$defs/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": "#/$defs/LeadPosition"
      }
    },
    "title_description": {
      "type": "string",
      "description": "Description of the current title/role"
    },
    "summary": {
      "type": [
        "string",
        "null"
      ],
      "description": "Profile summary"
    },
    "full_name": {
      "type": "string",
      "description": "Full name of the lead"
    },
    "sales_navigator_profile_url": {
      "type": [
        "string",
        "null"
      ],
      "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"
    },
    "location": {
      "type": "string",
      "description": "Where the person is based"
    },
    "num_of_followers": {
      "type": [
        "integer",
        "null"
      ],
      "description": "LinkedIn follower count"
    },
    "initials": {
      "type": [
        "string",
        "null"
      ],
      "description": "Initials of the person"
    },
    "previous_position": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/$defs/LeadPosition"
        }
      ],
      "description": "The role held before the current one."
    },
    "urn": {
      "type": [
        "string",
        "null"
      ],
      "description": "LinkedIn Sales Navigator URN identifier"
    },
    "start_date_job": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "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",
        "null"
      ],
      "format": "date",
      "description": "Start date at the current company. See `start_date_job`."
    }
  },
  "$defs": {
    "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"
        },
        "title": {
          "type": "string",
          "description": "Job title"
        },
        "current": {
          "type": "boolean",
          "description": "Whether the person still holds this role"
        },
        "company_name": {
          "type": "string",
          "description": "Name of the company"
        },
        "name": {
          "type": "string",
          "description": "Alias of `company_name`"
        },
        "company_id": {
          "type": "string",
          "description": "Pipecorn company id"
        },
        "company_urn": {
          "type": "string",
          "description": "LinkedIn company URN"
        },
        "company_domain": {
          "type": "string",
          "description": "Company website domain"
        },
        "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"
        },
        "employment_type": {
          "type": "string",
          "description": "Employment type, when the record carries one"
        },
        "started_on": {
          "type": [
            "object",
            "null"
          ],
          "description": "Year and month the role started or ended",
          "properties": {
            "year": {
              "type": "integer"
            },
            "month": {
              "type": "integer"
            }
          }
        },
        "ended_on": {
          "type": [
            "object",
            "null"
          ],
          "description": "Year and month the role started or ended",
          "properties": {
            "year": {
              "type": "integer"
            },
            "month": {
              "type": "integer"
            }
          }
        },
        "tenure_at_position": {
          "type": [
            "object",
            "null"
          ],
          "description": "Time spent in this role",
          "properties": {
            "num_years": {
              "type": "integer"
            },
            "num_months": {
              "type": "integer"
            }
          }
        },
        "tenure_at_company": {
          "type": [
            "object",
            "null"
          ],
          "description": "Time spent at this company",
          "properties": {
            "num_years": {
              "type": "integer"
            },
            "num_months": {
              "type": "integer"
            }
          }
        }
      }
    }
  }
}