{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-get-credentialing-workflow-response-schema.json",
  "title": "GetCredentialingWorkflowResponse",
  "description": "Response containing a single credentialing workflow",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/certifyos-credentialingworkflow-api-openapi.yml#/components/schemas/GetCredentialingWorkflowResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the credentialing workflow"
    },
    "tenantId": {
      "type": "string",
      "description": "ID of the tenant"
    },
    "tenantPractitionerId": {
      "type": "string",
      "description": "ID of the tenant practitioner"
    },
    "certifyPractitionerId": {
      "type": "string",
      "description": "Certify practitioner ID"
    },
    "data": {
      "$ref": "https://schemas.certifyos.com/api-contracts/response/CredentialingWorkflowResponse.schema.json",
      "description": "Credentialing workflow data including practitioner information and computed fields"
    },
    "deletedData": {
      "$ref": "#/$defs/JsonNode",
      "type": "object",
      "description": "Soft-deleted records archived from this workflow's sections"
    },
    "createdBy": {
      "type": "string",
      "description": "ID of the user who created the credentialing workflow"
    },
    "updatedBy": {
      "type": "string",
      "description": "ID of the user who updated the credentialing workflow"
    },
    "createdAt": {
      "$ref": "#/$defs/Instant",
      "type": "string",
      "description": "Timestamp of the credentialing workflow creation"
    },
    "updatedAt": {
      "$ref": "#/$defs/Instant",
      "type": "string",
      "description": "Timestamp of the credentialing workflow update"
    },
    "applicationCompleteDate": {
      "$ref": "#/$defs/Instant",
      "type": "string",
      "description": "Timestamp when the practitioner's application was marked complete"
    },
    "applicationCompleteSource": {
      "type": "string",
      "description": "Source that marked the application complete (one of: WORKFLOW_CREATED, NO_SECTION_B_OUTREACH, LATEST_INFORMATION_RECEIVED_EMAIL, LATEST_INFORMATION_RECEIVED_CAQH, NO_VALID_RESPONSE, CANCELLED_BEFORE_PSV)"
    },
    "anchorGroupId": {
      "type": "string",
      "description": "NSCP: the Anchor Group this workflow belongs to. Stamped at creation for every shared-eligible workflow (any credentialing cycle); null = not a shared credentialing workflow. Read-only — set by the platform, never by callers."
    },
    "sharedCredWorkflowId": {
      "type": "string",
      "description": "NSCP: the shared credentialing run this workflow belongs to. Stamped at creation together with anchorGroupId; null = standalone. Read-only."
    },
    "additionalInfo": {
      "$ref": "#/$defs/CredentialingWorkflowAdditionalInfo",
      "type": "object",
      "description": "Where the workflow was created from; omitted when it was created directly"
    },
    "psvSummary": {
      "$ref": "#/$defs/PsvSummary",
      "type": "object",
      "description": "PSV transparency values as the workflow's PSV packet shows them (File Type, PSV Progression, PSV Verification). Omitted unless the tenant is switched on for PSV transparency."
    }
  },
  "$defs": {
    "CredentialingWorkflowAdditionalInfo": {
      "type": "object",
      "description": "Where the credentialing workflow was created from",
      "properties": {
        "source": {
          "type": "string",
          "description": "System that created the workflow. Only ROSTER is accepted on create; readers must tolerate other values."
        },
        "sourceId": {
          "type": "string",
          "description": "Identifier of the originating record in the source system, stored as sent."
        }
      }
    },
    "Instant": {
      "type": "string",
      "format": "date-time"
    },
    "JsonNode": {
      "type": "object",
      "properties": {
        "empty": {
          "type": "boolean"
        },
        "valueNode": {
          "type": "boolean"
        },
        "containerNode": {
          "type": "boolean"
        },
        "missingNode": {
          "type": "boolean"
        },
        "array": {
          "type": "boolean"
        },
        "object": {
          "type": "boolean"
        },
        "nodeType": {
          "$ref": "#/$defs/JsonNodeType"
        },
        "pojo": {
          "type": "boolean"
        },
        "number": {
          "type": "boolean"
        },
        "integralNumber": {
          "type": "boolean"
        },
        "floatingPointNumber": {
          "type": "boolean"
        },
        "short": {
          "type": "boolean"
        },
        "int": {
          "type": "boolean"
        },
        "long": {
          "type": "boolean"
        },
        "float": {
          "type": "boolean"
        },
        "double": {
          "type": "boolean"
        },
        "bigDecimal": {
          "type": "boolean"
        },
        "bigInteger": {
          "type": "boolean"
        },
        "textual": {
          "type": "boolean"
        },
        "boolean": {
          "type": "boolean"
        },
        "null": {
          "type": "boolean"
        },
        "binary": {
          "type": "boolean"
        }
      }
    },
    "JsonNodeType": {
      "type": "string",
      "enum": [
        "ARRAY",
        "BINARY",
        "BOOLEAN",
        "MISSING",
        "NULL",
        "NUMBER",
        "OBJECT",
        "POJO",
        "STRING"
      ]
    },
    "PractitionerFileType": {
      "type": "string",
      "enum": [
        "CLEAN",
        "NON_CLEAN",
        "PENDING"
      ]
    },
    "PsvSummary": {
      "type": "object",
      "required": [
        "fileType"
      ],
      "description": "PSV transparency values as the workflow's PSV packet shows them: File Type, PSV Progression and PSV Verification. Present only for a tenant switched on for PSV transparency.",
      "properties": {
        "fileType": {
          "$ref": "#/$defs/PsvSummaryFileType",
          "type": "object",
          "description": "The packet's File Type and the non-clean reasons it prints"
        },
        "psvProgression": {
          "type": [
            "string",
            "null"
          ],
          "description": "READY or BLOCKED while the workflow is Not Started, In Progress, Outreach In Progress or Data Missing; null in any other status or before the first evaluation",
          "anyOf": [
            {
              "$ref": "#/$defs/PsvSummaryProgression"
            },
            {
              "type": "null"
            }
          ]
        },
        "psvVerification": {
          "$ref": "#/$defs/PsvSummaryVerification",
          "type": "object",
          "description": "The packet's PSV Verification; omitted when no outcome was recorded"
        }
      }
    },
    "PsvSummaryFileType": {
      "type": "object",
      "required": [
        "frozen",
        "reasons"
      ],
      "description": "The packet's File Type and the reasons it prints",
      "properties": {
        "value": {
          "type": [
            "string",
            "null"
          ],
          "description": "CLEAN, NON_CLEAN or PENDING; null when no File Type applies",
          "anyOf": [
            {
              "$ref": "#/$defs/PractitionerFileType"
            },
            {
              "type": "null"
            }
          ]
        },
        "frozen": {
          "type": "boolean",
          "description": "True when the verdict is frozen"
        },
        "reasons": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PsvSummaryReason"
          },
          "description": "The non-clean reasons the packet prints; reasons hidden from the packet are left out"
        }
      }
    },
    "PsvSummaryProgression": {
      "type": "string",
      "enum": [
        "READY",
        "BLOCKED"
      ]
    },
    "PsvSummaryReason": {
      "type": "object",
      "required": [
        "description"
      ],
      "description": "One reason or exception the packet prints",
      "properties": {
        "psvType": {
          "type": "string",
          "description": "PSV type; omitted when unknown"
        },
        "description": {
          "type": "string",
          "description": "What the packet prints"
        }
      }
    },
    "PsvSummaryVerification": {
      "type": "object",
      "required": [
        "outcome",
        "exceptions"
      ],
      "description": "The packet's PSV Verification",
      "properties": {
        "outcome": {
          "$ref": "#/$defs/PsvSummaryVerificationOutcome",
          "type": "string",
          "description": "VERIFIED_WITH_EXCEPTIONS while at least one exception is printed, else VERIFIED"
        },
        "exceptions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PsvSummaryReason"
          },
          "description": "The exceptions the packet prints; exceptions hidden from the packet are left out"
        }
      }
    },
    "PsvSummaryVerificationOutcome": {
      "type": "string",
      "enum": [
        "VERIFIED",
        "VERIFIED_WITH_EXCEPTIONS"
      ]
    }
  }
}