{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api-evangelist.github.io/allegion/json-schema/engage-credential-schema.json",
  "title": "ENGAGE Mobile Credential",
  "description": "A BLE mobile credential issued through the Allegion ENGAGE Cloud Credentialing API and delivered to a user's phone via the Allegion BLE Mobile Access SDK to unlock Schlage Gen 2 ENGAGE hardware and Von Duprin RU/RM exit devices.",
  "type": "object",
  "required": ["credentialId", "userId", "status", "accessProfile"],
  "properties": {
    "credentialId": { "type": "string" },
    "userId": {
      "type": "string",
      "description": "External Access Control System (ACS) user identifier."
    },
    "userEmail": { "type": "string", "format": "email" },
    "userName": { "type": "string" },
    "status": {
      "type": "string",
      "enum": ["Active", "Revoked", "Expired"]
    },
    "accessProfile": {
      "type": "string",
      "description": "Identifier of the ENGAGE access profile / door group granted by this credential."
    },
    "validFrom": { "type": "string", "format": "date-time" },
    "validTo": { "type": "string", "format": "date-time" },
    "createdAt": { "type": "string", "format": "date-time" },
    "revokedAt": {
      "type": ["string", "null"],
      "format": "date-time"
    }
  }
}
