{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/run402-com/json-schema/run402-com-auth-session-response-schema.json",
  "title": "AuthSessionResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/run402-com-auth-api-openapi.yml#/components/schemas/AuthSessionResponse",
  "type": "object",
  "required": [
    "access_token",
    "token_type",
    "expires_in",
    "refresh_token",
    "user"
  ],
  "properties": {
    "access_token": {
      "type": "string"
    },
    "token_type": {
      "type": "string",
      "enum": [
        "bearer"
      ]
    },
    "expires_in": {
      "type": "integer"
    },
    "refresh_token": {
      "type": "string"
    },
    "user": {
      "type": "object",
      "required": [
        "id",
        "email"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "email_verified_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "display_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "avatar_url": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "elevation_required": {
      "type": "boolean",
      "description": "True when project_admin was downgraded until passkey auth."
    },
    "required_method": {
      "type": "string",
      "enum": [
        "passkey"
      ]
    },
    "effective_role": {
      "type": "string",
      "enum": [
        "authenticated"
      ]
    },
    "intended_role": {
      "type": "string",
      "enum": [
        "project_admin"
      ]
    },
    "provider": {
      "type": "string"
    },
    "magic_link": {
      "type": "object",
      "properties": {
        "intent": {
          "type": "string",
          "enum": [
            "signin",
            "invite",
            "claim",
            "recovery"
          ]
        },
        "client_state": {
          "type": [
            "string",
            "null"
          ]
        },
        "state_source": {
          "type": "string",
          "enum": [
            "anonymous",
            "service_key"
          ]
        },
        "state_trusted": {
          "type": "boolean"
        },
        "delivery": {
          "type": "string",
          "enum": [
            "link",
            "code",
            "both"
          ]
        },
        "verified_with": {
          "type": "string",
          "enum": [
            "link",
            "email_code"
          ]
        }
      }
    }
  }
}