{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-passkey-register-verify-response-schema.json",
  "title": "PasskeyRegisterVerifyResponse",
  "description": "Enrollment result; the first passkey also carries recovery codes and,\nin the forced-enrollment lane, the completed login.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-auth-passkeys-api-openapi.yml#/components/schemas/PasskeyRegisterVerifyResponse",
  "properties": {
    "passkey": {
      "$ref": "#/$defs/PasskeyInfo",
      "description": "The newly enrolled passkey"
    },
    "recovery_codes": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Recovery Codes",
      "description": "Single-use recovery codes — returned exactly once, at first enrollment"
    },
    "auth": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuthResponse"
        },
        {
          "type": "null"
        }
      ],
      "description": "Completed login (forced-enrollment lane only)"
    }
  },
  "type": "object",
  "required": [
    "passkey"
  ],
  "$defs": {
    "AuthResponse": {
      "properties": {
        "user": {
          "additionalProperties": true,
          "type": "object",
          "title": "User",
          "description": "User information"
        },
        "org": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Org",
          "description": "Organization information (personal org created automatically on registration)"
        },
        "message": {
          "type": "string",
          "title": "Message",
          "description": "Success message"
        },
        "status": {
          "type": "string",
          "enum": [
            "authenticated",
            "mfa_required",
            "mfa_enrollment_required"
          ],
          "title": "Status",
          "description": "Login flow state: authenticated (token present), or a passkey MFA step is required before a session is issued (mfa_token present)",
          "default": "authenticated"
        },
        "mfa_token": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mfa Token",
          "description": "Short-lived token authorizing the MFA second step or forced enrollment; present only when status is not 'authenticated'"
        },
        "token": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Token",
          "description": "JWT authentication token (optional for cookie-based auth)"
        },
        "expires_in": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expires In",
          "description": "Token expiry time in seconds from now"
        },
        "refresh_threshold": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Refresh Threshold",
          "description": "Recommended refresh threshold in seconds before expiry"
        }
      },
      "type": "object",
      "required": [
        "user",
        "message"
      ],
      "title": "AuthResponse",
      "description": "Authentication response model."
    },
    "PasskeyInfo": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Passkey identifier"
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "User-facing label"
        },
        "created_at": {
          "type": "string",
          "title": "Created At",
          "description": "Enrollment time (ISO 8601)"
        },
        "last_used_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Used At",
          "description": "Last successful assertion time (ISO 8601)"
        },
        "backup_eligible": {
          "type": "boolean",
          "title": "Backup Eligible",
          "description": "Whether the credential is synced (multi-device) capable"
        },
        "backup_state": {
          "type": "boolean",
          "title": "Backup State",
          "description": "Whether the credential is currently backed up"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "created_at",
        "backup_eligible",
        "backup_state"
      ],
      "title": "PasskeyInfo",
      "description": "One enrolled passkey, as listed in account settings."
    }
  }
}