{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elaiio/json-schema/elaiio-current-user-schema.json",
  "title": "CurrentUser",
  "description": "The authenticated user with its workspace and organization context.",
  "x-generated": "2026-12-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elaiio-elai-public-api-openapi.yml#/components/schemas/CurrentUser",
  "type": "object",
  "properties": {
    "userId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "status": {
      "type": "string"
    },
    "accountRole": {
      "type": "string",
      "description": "Role in the current workspace (`admin`, `user`, `locked`, `reviewer`)."
    },
    "orgRole": {
      "type": "string",
      "description": "Role in the organization (`admin` or `user`)."
    },
    "accounts": {
      "type": "array",
      "description": "Every workspace the user belongs to.",
      "items": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "personal": {
            "type": "boolean"
          },
          "minutesAvailable": {
            "type": "number"
          },
          "minutesUsed": {
            "type": "number"
          }
        }
      }
    },
    "organization": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "plan": {
          "type": "string",
          "description": "Plan name. Note that `unlimited` organizations are blocked from the API entirely."
        },
        "planVariant": {
          "type": "string"
        },
        "billingCycle": {
          "type": "string"
        },
        "minutesUsed": {
          "type": "number"
        },
        "minutesAvailable": {
          "type": "number"
        },
        "extraMinutes": {
          "type": "number"
        },
        "maxSeats": {
          "type": "integer"
        },
        "allowOverlimit": {
          "type": "boolean"
        },
        "premiumAvatarsAllowed": {
          "type": "boolean"
        },
        "hasStripe": {
          "type": "boolean"
        },
        "planStartedAt": {
          "type": "string",
          "format": "date-time"
        },
        "planCancelAtPeriodEnd": {
          "type": "boolean"
        },
        "planCancelsAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "additionalProperties": true
    },
    "account": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "personal": {
          "type": "boolean"
        },
        "hasApi": {
          "type": "boolean",
          "description": "Whether an API token exists for this workspace."
        },
        "brandKits": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "colors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "defaultLogoPlacement": {
                "type": "string"
              }
            }
          }
        },
        "dictionary": {
          "type": "array",
          "description": "Pronunciation overrides applied during TTS.",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "word": {
                "type": "string"
              },
              "pronunciation": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "voice": {
                "type": "string"
              }
            }
          }
        },
        "llmUsageCounters": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "additionalProperties": true
    }
  }
}