{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-auth-response-schema.json",
  "title": "AuthResponse",
  "description": "Authentication response model.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-auth-api-openapi.yml#/components/schemas/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"
  ]
}