{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xproapi/json-schema/xproapi-user-schema.json",
  "title": "User",
  "description": "A public X account.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xproapi-openapi.json#/components/schemas/User",
  "type": "object",
  "required": [
    "type",
    "id",
    "userName",
    "name",
    "url",
    "description",
    "profilePicture",
    "followers",
    "following",
    "isBlueVerified",
    "protected",
    "unavailable"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "user"
    },
    "id": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Numeric user id, as a string. It never changes; store this rather than the username."
    },
    "userName": {
      "type": "string",
      "description": "Username without the @. Can change."
    },
    "name": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "description": {
      "type": "string",
      "description": "Bio; empty when none."
    },
    "profilePicture": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "followers": {
      "type": "integer",
      "minimum": 0
    },
    "following": {
      "type": "integer",
      "minimum": 0
    },
    "isBlueVerified": {
      "type": "boolean"
    },
    "protected": {
      "type": "boolean",
      "description": "Protected accounts’ tweets, followers and following can’t be read."
    },
    "unavailable": {
      "type": "boolean"
    }
  }
}