{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lensmor/json-schema/lensmor-contact-unlock-submission-schema.json",
  "title": "ContactUnlockSubmission",
  "description": "Email or phone unlock submission outcome, including accepted work and skipped records.",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lensmor-openapi.json#/components/schemas/ContactUnlockSubmission",
  "type": "object",
  "required": [
    "status"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "accepted",
        "success"
      ],
      "description": "accepted when an asynchronous task was created; success when there was no chargeable work to enqueue."
    },
    "task_id": {
      "type": "string",
      "description": "TaskCenter identifier. Present when status is accepted.",
      "pattern": "^[0-9]+$"
    },
    "job_id": {
      "type": "string",
      "description": "Alias of task_id. Present when status is accepted.",
      "pattern": "^[0-9]+$"
    },
    "skipped_personnel_ids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Submitted personnel identifiers that did not create chargeable work."
    },
    "skipped_detail": {
      "type": "object",
      "properties": {
        "invalid_personnel_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Invalid personnel ids returned as part of this contact unlock submission object."
        },
        "missing_personnel_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Missing personnel ids returned as part of this contact unlock submission object."
        },
        "unlinked_personnel_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Unlinked personnel ids returned as part of this contact unlock submission object."
        },
        "already_unlocked_personnel_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Already unlocked personnel ids returned as part of this contact unlock submission object."
        },
        "unlocking_personnel_ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Unlocking personnel ids returned as part of this contact unlock submission object."
        }
      },
      "description": "Reasons submitted personnel records were skipped, grouped by condition."
    }
  },
  "oneOf": [
    {
      "properties": {
        "status": {
          "const": "accepted",
          "description": "Current normalized status for the submission, task, or generated content."
        }
      },
      "required": [
        "task_id",
        "job_id"
      ]
    },
    {
      "properties": {
        "status": {
          "const": "success",
          "description": "Current normalized status for the submission, task, or generated content."
        }
      }
    }
  ]
}