{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/softsync-ai/json-schema/softsync-ai-enrich-input-schema.json",
  "title": "EnrichInput",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/softsync-ai-openapi.json#/components/schemas/EnrichInput",
  "type": "object",
  "properties": {
    "domain": {
      "x-ui-label": "Company website",
      "x-ui-help": "Website or domain of the company, e.g. moelven.no or https://resend.com.",
      "x-ui-fill-mode": "both",
      "x-ui-order": 1,
      "type": "string",
      "minLength": 1
    },
    "email": {
      "x-ui-label": "Email",
      "x-ui-help": "A work email finds the person and their company. A personal email (gmail, online.no, …) also needs a website, org number or LinkedIn URL.",
      "x-ui-fill-mode": "both",
      "x-ui-order": 2,
      "type": "string",
      "format": "email",
      "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
    },
    "linkedinUrl": {
      "x-ui-label": "LinkedIn URL",
      "x-ui-help": "A person (/in/…) or company (/company/…) LinkedIn page.",
      "x-ui-fill-mode": "both",
      "x-ui-order": 3,
      "type": "string",
      "format": "uri"
    },
    "orgNo": {
      "x-ui-label": "Organisation number",
      "x-ui-help": "Norwegian organisation number (9 digits).",
      "x-ui-fill-mode": "both",
      "x-ui-order": 4,
      "type": "string",
      "minLength": 1
    },
    "name": {
      "x-ui-label": "Person name",
      "x-ui-help": "Helps find the right person when the email has no name.",
      "x-ui-fill-mode": "both",
      "x-ui-order": 5,
      "type": "string",
      "minLength": 1
    },
    "companyName": {
      "x-ui-label": "Company name",
      "x-ui-fill-mode": "both",
      "x-ui-order": 6,
      "type": "string",
      "minLength": 1
    },
    "known": {
      "description": "Facts the caller already has (e.g. scraped from the open LinkedIn page). Used instead of paying for the same lookup.",
      "type": "object",
      "properties": {
        "person": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "headline": {
              "type": "string"
            },
            "photo": {
              "type": "string"
            },
            "location": {
              "type": "string"
            },
            "currentCompany": {
              "type": "string"
            },
            "currentCompanyHandle": {
              "type": "string"
            }
          }
        },
        "company": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "website": {
              "type": "string"
            },
            "linkedinHandle": {
              "type": "string"
            }
          }
        }
      }
    },
    "people": {
      "default": "key",
      "x-ui-label": "Key people",
      "x-ui-help": "key: also find the CEO, founders and top managers. none: company and person only.",
      "x-ui-fill-mode": "both",
      "x-ui-order": 7,
      "type": "string",
      "enum": [
        "none",
        "key"
      ]
    },
    "emails": {
      "default": false,
      "x-ui-label": "Find emails",
      "x-ui-help": "Also look up work email addresses. Each email found uses a credit.",
      "x-ui-fill-mode": "both",
      "x-ui-order": 8,
      "type": "boolean"
    },
    "emailsFor": {
      "description": "With emails=true on a company: only look up the emails of these key people (their `id` from `people`). Without it, the CEO and up to two founders.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "phones": {
      "default": false,
      "x-ui-label": "Find phone numbers",
      "x-ui-help": "Also look up mobile or direct phone numbers by the person's LinkedIn link (mostly US numbers). Each phone found uses five credits.",
      "x-ui-fill-mode": "both",
      "x-ui-order": 8.2,
      "type": "boolean"
    },
    "phonesFor": {
      "description": "With phones=true on a company: only look up the phones of these key people (their `id` from `people`). Without it, every key person with a LinkedIn link.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "profiles": {
      "default": false,
      "x-ui-label": "Full profiles",
      "x-ui-help": "With key people: also read each person's full profile (headline, current title, photo, location, schooling). Each profile uses two credits.",
      "x-ui-fill-mode": "both",
      "x-ui-order": 8.5,
      "type": "boolean"
    },
    "profilesFor": {
      "description": "With profiles=true: only read the profiles of these key people (their `id` from `people`). Without it, every key person.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "save": {
      "default": "none",
      "x-ui-label": "Save to CRM",
      "x-ui-help": "none: preview only. fill: fill empty fields (creates the record when missing). refresh: fill, and also update values an earlier lookup wrote that have changed since; values someone typed are kept. overwrite: replace the fields listed in overwriteFields.",
      "x-ui-fill-mode": "both",
      "x-ui-order": 9,
      "type": "string",
      "enum": [
        "none",
        "fill",
        "refresh",
        "overwrite"
      ]
    },
    "savePeople": {
      "description": "With save=fill or overwrite: also save key people as contacts linked to the company — \"all\", or the `id`s of the people to save. Existing contacts are matched first (email, LinkedIn, then name within the company).",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "all"
          ]
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "groups": {
      "description": "Where new records go when saving: the group for a new company and for new contacts. Without it, new contacts join a group of their company, else the first group that shows the table and the user can add to.",
      "type": "object",
      "properties": {
        "company": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "contact": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        }
      }
    },
    "recordId": {
      "x-ui-label": "Record",
      "x-ui-help": "Company or contact record to update instead of matching one.",
      "x-ui-fill-mode": "both",
      "x-ui-order": 10,
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "overwriteFields": {
      "description": "save=overwrite only: the fields (from `diff`) the user agreed to replace, e.g. [\"company.description\",\"contact.job_title\"]. Without it, overwrite returns the diff and writes nothing.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "lookupId": {
      "description": "Re-use a lookup from the last hour (e.g. save a preview) without new paid calls.",
      "type": "string"
    },
    "locale": {
      "description": "The caller's language, e.g. no-NO. Saving writes the company's extra facts (funding rounds, acquisitions, products…) as a note in this language. Default English.",
      "type": "string",
      "maxLength": 35
    }
  }
}