{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oyster-hr/json-schema/oyster-hr-identity-verification-schema.json",
  "title": "identityVerification",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oyster-hr-identity-verification-api-openapi.yml#/components/schemas/identityVerification",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "IN_PROGRESS",
        "RESUBMISSION_REQUIRED",
        "APPROVED",
        "DECLINED"
      ]
    },
    "verificationData": {
      "anyOf": [
        {
          "$ref": "#/$defs/autoKycVerificationData"
        },
        {
          "$ref": "#/$defs/partnerKycVerificationData"
        },
        {
          "type": "object",
          "properties": {}
        }
      ]
    }
  },
  "required": [
    "id",
    "status",
    "verificationData"
  ],
  "$defs": {
    "autoKycVerificationData": {
      "type": "object",
      "properties": {
        "sessionUrl": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "sessionUrl"
      ]
    },
    "partnerKycVerificationData": {
      "type": "object",
      "properties": {
        "referenceId": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "user": {
          "type": "object",
          "properties": {
            "firstName": {
              "type": "string"
            },
            "middleName": {
              "type": "string"
            },
            "lastName": {
              "type": "string"
            },
            "dateOfBirth": {
              "type": "string",
              "format": "date"
            }
          },
          "required": [
            "firstName",
            "lastName",
            "dateOfBirth"
          ]
        },
        "document": {
          "type": "object",
          "properties": {
            "countryCode": {
              "type": "string"
            },
            "type": {
              "type": "string"
            },
            "number": {
              "type": "string"
            },
            "expirationDate": {
              "type": "string",
              "format": "date"
            },
            "issuanceDate": {
              "type": "string",
              "format": "date"
            }
          },
          "required": [
            "countryCode",
            "type",
            "number"
          ]
        },
        "screening": {
          "type": "object",
          "properties": {
            "pep": {
              "type": "boolean"
            },
            "sanctions": {
              "type": "boolean"
            }
          },
          "required": [
            "pep",
            "sanctions"
          ]
        }
      },
      "required": [
        "referenceId",
        "user",
        "document",
        "screening"
      ]
    }
  }
}