{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://schemas.certifyos.com/events/credential-workflow-status-changed.schema.json",
    "title": "Credential Workflow Status Changed Webhook Event Data",
    "description": "Schema for the eventData portion of credential_workflow.status.changed webhook events. This validates the data field that gets wrapped with eventType and timestamp by the consumer.",
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "credentialingWorkflowId": {
        "type": "string",
        "description": "Unique identifier for the credentialing workflow"
      },
      "previousStatusId": {
        "type": ["string", "null"],
        "description": "Unique identifier for the previous timeline event (null for first event)"
      },
      "previousStatusName": {
        "type": ["string", "null"],
        "enum": [
          null,
          "NOT_STARTED",
          "IN_PROGRESS",
          "OUTREACH_IN_PROGRESS",
          "DATA_MISSING",
          "PSV_COMPLETED",
          "PSV_READY",
          "SENT_TO_COMMITTEE",
          "TABLED",
          "WITHDRAWN_CANCELLED",
          "CRED_DENIED",
          "CRED_APPROVED",
          "HOLD_FOR_COMMITTEE"
        ],
        "description": "Previous timeline event status name (null for first event)"
      },
      "newStatusId": {
        "type": "string",
        "description": "Unique identifier for the new timeline event"
      },
      "newStatusName": {
        "type": "string",
        "enum": [
          "NOT_STARTED",
          "IN_PROGRESS",
          "OUTREACH_IN_PROGRESS",
          "DATA_MISSING",
          "PSV_COMPLETED",
          "PSV_READY",
          "SENT_TO_COMMITTEE",
          "TABLED",
          "WITHDRAWN_CANCELLED",
          "CRED_DENIED",
          "CRED_APPROVED",
          "HOLD_FOR_COMMITTEE"
        ],
        "description": "New timeline event status name"
      },
      "statusChangedAt": {
        "type": "string",
        "format": "date-time",
        "description": "Timestamp when the status change occurred (ISO 8601 date-time format)"
      },
      "practitionerExternalId": {
        "type": "string",
        "description": "External identifier from the practitioner object in the credential workflow (defaults to null if not present)"
      }
    },
    "required": ["credentialingWorkflowId", "newStatusId", "newStatusName", "statusChangedAt"]
  }
  
  
