{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/verifyref-com/json-schema/verifyref-com-create-check-request-schema.json",
  "title": "CreateCheckRequest",
  "description": "Provide either questionnaireId OR questionnaireTitle + questions[].\nProvide references[] unless candidateProvidedReferences is true.\nexternalId and externalSource must be provided together.\n",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/verifyref-com-openapi.yml#/components/schemas/CreateCheckRequest",
  "type": "object",
  "required": [
    "candidateName",
    "candidateEmail"
  ],
  "properties": {
    "candidateName": {
      "type": "string"
    },
    "candidateEmail": {
      "type": "string",
      "format": "email"
    },
    "candidateId": {
      "type": "string",
      "description": "Talent pool candidate ID"
    },
    "addToTalentPool": {
      "type": "boolean",
      "default": false
    },
    "candidateProvidedReferences": {
      "type": "boolean",
      "default": false
    },
    "externalId": {
      "type": "string",
      "maxLength": 255
    },
    "externalSource": {
      "type": "string",
      "enum": [
        "bullhorn",
        "zoho_recruit",
        "sap_successfactors",
        "workday",
        "greenhouse",
        "lever",
        "other"
      ]
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    },
    "jobId": {
      "type": "string"
    },
    "newJob": {
      "$ref": "#/$defs/NewJob"
    },
    "questionnaireId": {
      "type": "string"
    },
    "questionnaireTitle": {
      "type": "string"
    },
    "questionnaireDescription": {
      "type": "string"
    },
    "questions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Question"
      }
    },
    "references": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReferenceInput"
      }
    }
  },
  "$defs": {
    "NewJob": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "OPEN",
            "CLOSED"
          ],
          "default": "OPEN"
        },
        "location": {
          "type": "string"
        },
        "department": {
          "type": "string"
        }
      }
    },
    "Question": {
      "type": "object",
      "required": [
        "text",
        "type",
        "order"
      ],
      "properties": {
        "text": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "TEXT",
            "TEXTAREA",
            "RATING",
            "MULTIPLE_CHOICE",
            "YES_NO"
          ]
        },
        "required": {
          "type": "boolean",
          "default": true
        },
        "order": {
          "type": "number"
        },
        "options": {
          "type": "string",
          "description": "Required for MULTIPLE_CHOICE (serialized choices)"
        }
      }
    },
    "ReferenceInput": {
      "type": "object",
      "required": [
        "name",
        "email",
        "relationship"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "relationship": {
          "type": "string"
        }
      }
    }
  }
}