{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/AuthenticationFactorEnrolled",
  "title": "AuthenticationFactorEnrolled",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "description": "Distinguishes the authentication factor object.",
      "const": "authentication_factor"
    },
    "id": {
      "type": "string",
      "description": "The unique ID of the factor.",
      "example": "auth_factor_01FVYZ5QM8N98T9ME5BCB2BBMJ"
    },
    "type": {
      "type": "string",
      "enum": [
        "generic_otp",
        "sms",
        "totp",
        "webauthn"
      ],
      "description": "The type of the factor to enroll.",
      "example": "totp"
    },
    "user_id": {
      "type": "string",
      "description": "The ID of the [user](/reference/authkit/user).",
      "example": "user_01E4ZCR3C56J083X43JQXF3JK5"
    },
    "sms": {
      "type": "object",
      "properties": {
        "phone_number": {
          "type": "string",
          "description": "The user's phone number for SMS-based authentication.",
          "example": "+15005550006"
        }
      },
      "required": [
        "phone_number"
      ],
      "description": "SMS-based authentication factor details."
    },
    "totp": {
      "type": "object",
      "properties": {
        "issuer": {
          "type": "string",
          "description": "Your application or company name displayed in the user's authenticator app. Defaults to your WorkOS team name.",
          "example": "WorkOS"
        },
        "user": {
          "type": "string",
          "description": "The user's account name displayed in their authenticator app. Defaults to the user's email.",
          "example": "user@example.com"
        },
        "secret": {
          "type": "string",
          "description": "TOTP secret that can be manually entered into some authenticator apps in place of scanning a QR code.",
          "example": "JBSWY3DPEHPK3PXP"
        },
        "qr_code": {
          "type": "string",
          "description": "Base64 encoded image containing scannable QR code.",
          "example": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
        },
        "uri": {
          "type": "string",
          "description": "The `otpauth` URI that is encoded by the provided `qr_code`.",
          "example": "otpauth://totp/WorkOS:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=WorkOS"
        }
      },
      "required": [
        "issuer",
        "user",
        "secret",
        "qr_code",
        "uri"
      ],
      "description": "TOTP-based authentication factor details. Includes enrollment secrets only available at creation time."
    },
    "created_at": {
      "format": "date-time",
      "type": "string",
      "description": "An ISO 8601 timestamp.",
      "example": "2026-01-15T12:00:00.000Z"
    },
    "updated_at": {
      "format": "date-time",
      "type": "string",
      "description": "An ISO 8601 timestamp.",
      "example": "2026-01-15T12:00:00.000Z"
    }
  },
  "required": [
    "object",
    "id",
    "type",
    "created_at",
    "updated_at"
  ]
}