{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/factiq-com/json-schema/factiq-com-token-response-schema.json",
  "title": "TokenResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/factiq-com-auth-api-openapi.yml#/components/schemas/TokenResponse",
  "properties": {
    "access_token": {
      "type": "string",
      "title": "Access Token"
    },
    "token_type": {
      "type": "string",
      "title": "Token Type",
      "default": "bearer"
    },
    "refresh_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Refresh Token"
    },
    "user": {
      "$ref": "#/$defs/User"
    },
    "monthly_usage": {
      "anyOf": [
        {
          "$ref": "#/$defs/UsageQuota"
        },
        {
          "type": "null"
        }
      ]
    },
    "api_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Api Key"
    }
  },
  "type": "object",
  "required": [
    "access_token",
    "user"
  ],
  "$defs": {
    "UsageQuota": {
      "properties": {
        "usage_month": {
          "type": "string",
          "format": "date",
          "title": "Usage Month"
        },
        "request_count": {
          "type": "integer",
          "title": "Request Count"
        },
        "request_limit": {
          "type": "integer",
          "title": "Request Limit"
        }
      },
      "type": "object",
      "required": [
        "usage_month",
        "request_count",
        "request_limit"
      ],
      "title": "UsageQuota"
    },
    "User": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "email": {
          "type": "string",
          "title": "Email"
        },
        "full_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Full Name"
        },
        "picture_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Picture Url"
        },
        "plan_type": {
          "type": "string",
          "title": "Plan Type"
        },
        "personal_plan_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Personal Plan Type"
        },
        "plan_expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Plan Expires At"
        },
        "personal_plan_expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Personal Plan Expires At"
        },
        "entitlement_source": {
          "type": "string",
          "title": "Entitlement Source",
          "default": "personal"
        },
        "workspace_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Workspace Id"
        },
        "email_verified": {
          "type": "boolean",
          "title": "Email Verified",
          "default": false
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "blocked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Blocked At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "email",
        "plan_type"
      ],
      "title": "User"
    }
  }
}