{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/potarix-com/json-schema/potarix-com-find-all-response-schema.json",
  "title": "FindAllResponse",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/potarix-com-enricher.yaml#/components/schemas/FindAllResponse",
  "type": "object",
  "required": [
    "company_name",
    "website",
    "credits_charged",
    "credits_remaining"
  ],
  "properties": {
    "company_name": {
      "type": "string"
    },
    "domain": {
      "type": [
        "string",
        "null"
      ]
    },
    "website": {
      "$ref": "#/$defs/FindAllWebsite"
    },
    "decision_makers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FindAllDecisionMaker"
      }
    },
    "company_emails": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CompanyEmailItem"
      }
    },
    "company_emails_count": {
      "type": "integer"
    },
    "company_emails_source": {
      "type": [
        "string",
        "null"
      ]
    },
    "company_emails_cached": {
      "type": "boolean"
    },
    "total_emails": {
      "type": "integer",
      "description": "Company emails plus decision-makers that returned an email."
    },
    "credits_charged": {
      "type": "integer",
      "description": "Net credits taken for this find-all call."
    },
    "credits_remaining": {
      "type": "integer"
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Non-fatal failures of sub-lookups; the call still returns 200."
    }
  },
  "$defs": {
    "CompanyEmailItem": {
      "type": "object",
      "required": [
        "email"
      ],
      "properties": {
        "email": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "linkedin_url": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FindAllDecisionMaker": {
      "type": "object",
      "required": [
        "category",
        "cached"
      ],
      "properties": {
        "category": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        },
        "linkedin_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "job_title": {
          "type": [
            "string",
            "null"
          ]
        },
        "email_status": {
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        },
        "cached": {
          "type": "boolean"
        },
        "error": {
          "type": [
            "string",
            "null"
          ],
          "description": "Set when this decision-maker lookup failed but the rest of find-all succeeded."
        }
      }
    },
    "FindAllWebsite": {
      "type": "object",
      "required": [
        "cached"
      ],
      "properties": {
        "url": {
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        },
        "confidence": {
          "type": [
            "number",
            "null"
          ]
        },
        "cached": {
          "type": "boolean"
        }
      }
    }
  }
}