{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/daon/json-schema/daon-user-totp-schema.json",
  "title": "UserTOTP",
  "description": "A user TOTP record, created for every TOTP registration and updated with TOTP authentications.\n\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/daon-user-totp-management-api-openapi.yml#/components/schemas/UserTOTP",
  "type": "object",
  "properties": {
    "permittedOperations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "createdDtm": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdatedDtm": {
      "type": "string",
      "format": "date-time"
    },
    "id": {
      "type": "string",
      "description": "Unique 26-character database user ID."
    },
    "storeId": {
      "type": "string",
      "description": "Unique 26-character database store ID."
    },
    "userId": {
      "type": "string",
      "description": "Unique 26-character database user ID."
    },
    "status": {
      "type": "string",
      "description": "The totp status: ACTIVE, PENDING or DISABLED.",
      "enum": [
        "ACTIVE",
        "PENDING",
        "DISABLED"
      ]
    },
    "username": {
      "type": "string",
      "description": "Username for TOTP registration - used as a label in Authenticator App and identifies the account holder. Mandatory."
    },
    "policyName": {
      "type": "string",
      "description": "The TOTP policy name, used as a key in TOTP policies map in store configuration."
    },
    "algorithm": {
      "type": "string",
      "description": "The algorithm used to validate the authentication code. All of the algorithms from TOTP Policy will be tried and if one works, it will be set as the algorithm to TOTP record during complete TOTP registration process."
    },
    "issuer": {
      "type": "string",
      "description": "Issuer string, used as an identifier in Authenticator App, together with username from TOTP registration request. Optional, but highly recommended."
    },
    "secret": {
      "type": "string",
      "description": "The shared secret for TOTP"
    },
    "lastUsedDtm": {
      "type": "string",
      "format": "date-time",
      "description": "If the TOTP has been used for authentication this field indicates the last time this occurred"
    },
    "expirationDtm": {
      "type": "string",
      "format": "date-time",
      "description": "Expiration dtm for the pending TOTPs - this is time before which is possible to activate pending TOTP."
    },
    "activatedDtm": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time of the TOTP activation - this is time when first auth with TOTP happened and marked TOTP as active."
    },
    "typeId": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "policyName",
    "secret",
    "status",
    "storeId",
    "userId",
    "username"
  ]
}