{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/assinafy-com-br/json-schema/assinafy-com-br-auth-session-schema.json",
  "title": "AuthSession",
  "description": "A JWT access token plus the authenticated user and the accounts they belong to.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/assinafy-com-br-authentication-api-openapi.yml#/components/schemas/AuthSession",
  "properties": {
    "access_token": {
      "type": "string"
    },
    "user": {
      "$ref": "#/$defs/AuthUser"
    },
    "accounts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AuthAccount"
      }
    }
  },
  "type": "object",
  "$defs": {
    "AuthAccount": {
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "is_delete_allowed": {
          "type": "boolean"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "type": "object"
    },
    "AuthUser": {
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "telephone": {
          "type": [
            "string",
            "null"
          ]
        },
        "government_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "is_email_verified": {
          "type": "boolean"
        },
        "has_accepted_terms": {
          "type": "boolean"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "to_be_deleted_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "type": "object"
    }
  }
}