{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/medianfi-com/json-schema/medianfi-com-passwordless-session-response-schema.json",
  "title": "PasswordlessSessionResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/medianfi-com-auth-api-openapi.yml#/components/schemas/PasswordlessSessionResponse",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "success",
    "data"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": true
    },
    "data": {
      "type": "object",
      "required": [
        "user",
        "accessToken",
        "refreshToken",
        "expiresIn",
        "isNewUser",
        "companyId",
        "canSeeInternalUi",
        "featureFlags",
        "memberships"
      ],
      "properties": {
        "user": {
          "$ref": "#/$defs/User"
        },
        "accessToken": {
          "type": "string"
        },
        "refreshToken": {
          "type": "string"
        },
        "expiresIn": {
          "type": "integer",
          "minimum": 1
        },
        "isNewUser": {
          "type": "boolean"
        },
        "companyId": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "canSeeInternalUi": {
          "type": "boolean"
        },
        "featureFlags": {
          "type": "object",
          "additionalProperties": {
            "type": "boolean"
          }
        },
        "memberships": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UserContextMembership"
          }
        }
      }
    }
  },
  "$defs": {
    "User": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "name": {
          "type": "string"
        },
        "phone": {
          "type": [
            "string",
            "null"
          ]
        },
        "jobTitle": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "UserContextMembership": {
      "type": "object",
      "properties": {
        "companyId": {
          "type": "string",
          "format": "uuid"
        },
        "companyName": {
          "type": [
            "string",
            "null"
          ]
        },
        "role": {
          "type": "string",
          "enum": [
            "owner",
            "admin",
            "cfo",
            "member",
            "viewer"
          ]
        }
      }
    }
  }
}