{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-flag-response-schema.json",
  "title": "FlagResponse",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/certifyos-flag-api-openapi.yml#/components/schemas/FlagResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "tenantProviderId": {
      "type": "string"
    },
    "flagTypeId": {
      "type": "string"
    },
    "data": {
      "$ref": "#/$defs/JsonNode"
    },
    "createdAt": {
      "$ref": "#/$defs/Date"
    },
    "createdBy": {
      "type": "string"
    },
    "updatedAt": {
      "$ref": "#/$defs/Date"
    },
    "updatedBy": {
      "type": "string"
    },
    "originMonitoringWorkflowId": {
      "type": "string"
    },
    "hash": {
      "type": "string"
    },
    "tenantId": {
      "type": "string"
    },
    "practitionerPrefix": {
      "type": "string"
    },
    "practitionerFirstName": {
      "type": "string"
    },
    "practitionerMiddleName": {
      "type": "string"
    },
    "practitionerLastName": {
      "type": "string"
    },
    "practitionerNpi": {
      "type": "string"
    },
    "statesToCredential": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "practitionerType": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "credentialingStatus": {
      "type": "string"
    },
    "dataSource": {
      "type": "string"
    },
    "practitionerDateOfBirth": {
      "type": "string"
    },
    "practitionerEmail": {
      "type": "string"
    },
    "lastCredentialedDate": {
      "type": "string"
    },
    "markedSeenAt": {
      "$ref": "#/$defs/Date"
    },
    "markedSeenBy": {
      "type": "string"
    },
    "certifyPractitionerId": {
      "type": "string"
    },
    "tenantPractitionerTenantId": {
      "type": "string"
    },
    "histories": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FlagHistoryWithAttachmentsResponse"
      }
    },
    "historiesTruncated": {
      "type": "boolean"
    },
    "npdbDocument": {
      "$ref": "#/$defs/DocumentResponse"
    }
  },
  "$defs": {
    "Date": {
      "type": "string",
      "format": "date"
    },
    "DocumentResponse": {
      "type": "object",
      "properties": {
        "documentId": {
          "type": "string"
        },
        "entityId": {
          "type": "string"
        },
        "docType": {
          "type": "string"
        },
        "scopeKey": {
          "type": "string"
        },
        "sourceDigest": {
          "type": "string"
        },
        "recipeVersion": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "supersededBy": {
          "type": "string"
        },
        "errorMessage": {
          "type": "string"
        },
        "filePath": {
          "type": "string"
        },
        "tenantPractitionerId": {
          "type": "string"
        },
        "createdAt": {
          "type": "string"
        },
        "createdBy": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        },
        "updatedBy": {
          "type": "string"
        }
      }
    },
    "FlagHistoryAttachmentResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "flagHistoryId": {
          "type": "string"
        },
        "data": {
          "$ref": "#/$defs/JsonNode"
        },
        "createdAt": {
          "$ref": "#/$defs/Date"
        },
        "createdBy": {
          "type": "string"
        }
      }
    },
    "FlagHistoryWithAttachmentsResponse": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "flagId": {
          "type": "string"
        },
        "data": {
          "$ref": "#/$defs/JsonNode"
        },
        "createdAt": {
          "$ref": "#/$defs/Date"
        },
        "createdBy": {
          "type": "string"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FlagHistoryAttachmentResponse"
          }
        }
      }
    },
    "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"
      ]
    }
  }
}