{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/confighub/json-schema/confighub-user-schema.json",
  "title": "User",
  "description": "a User in Confighub.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/confighub-group-api-openapi.yml#/components/schemas/User",
  "required": [
    "Slug"
  ],
  "type": "object",
  "properties": {
    "CreatedAt": {
      "type": "string",
      "description": "The timestamp when the entity was created in \"2023-01-01T12:00:00Z\" format.",
      "format": "date-time",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "time"
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "DisplayName": {
      "type": "string",
      "description": "Friendly name for the entity.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "EntityType": {
      "type": "string",
      "description": "The type of entity.",
      "readOnly": true,
      "x-go-type-skip-optional-pointer": true
    },
    "ExternalID": {
      "type": "string",
      "description": "Unique identifier for the External Identity Provider record matching this User.",
      "x-confighub-where": {
        "dataType": "uuid"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "GroupIDs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UUID"
      },
      "description": "The Groups the User belongs to, from the identity provider's claims at their last login. A bot User's Groups are the ones it was added to through the Group API instead. (readonly)",
      "x-confighub-where": {
        "dataType": "[]uuid",
        "references": "Group"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "HiddenReason": {
      "maxLength": 64,
      "pattern": "^([A-Za-z0-9]([\\-_.A-Za-z0-9]*[A-Za-z0-9])?)?$",
      "type": "string",
      "description": "The reason the entity is hidden, if it is. A hidden entity is left out of List and Search results, and of what bulk operations act on, unless the include_hidden parameter names its reason or is *, or the where parameter names the entity by Slug or ID. ConfigHub/YAML Units are created hidden with the reason BackingUnit unless given another.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "ProfilePictureURL": {
      "type": "string",
      "description": "The URL to get the profile avatar picture of the User.",
      "x-go-type-skip-optional-pointer": true
    },
    "Slug": {
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9]([\\-_.A-Za-z0-9]*[A-Za-z0-9])?$",
      "type": "string",
      "description": "Unique URL-safe identifier for the entity.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "UpdatedAt": {
      "type": "string",
      "description": "The timestamp when the entity was last updated in \"2023-01-01T12:00:00Z\" format.",
      "format": "date-time",
      "readOnly": true,
      "x-confighub-where": {
        "dataType": "time"
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "UserID": {
      "type": "string",
      "description": "Unique identifier for a User.",
      "format": "uuid",
      "x-confighub-where": {
        "dataType": "uuid"
      },
      "x-go-type-skip-optional-pointer": true,
      "x-omitzero": true
    },
    "Username": {
      "type": "string",
      "description": "Unique username for a User. Must be unique for all of Confighub.",
      "x-confighub-where": {
        "dataType": "string"
      },
      "x-go-type-skip-optional-pointer": true
    },
    "Version": {
      "type": "integer",
      "description": "An entity-specific sequence number used for optimistic concurrency control. The value read must be sent in calls to Update.",
      "format": "int64",
      "readOnly": false,
      "x-go-type-skip-optional-pointer": true
    }
  },
  "$defs": {
    "UUID": {
      "type": "string",
      "format": "uuid"
    }
  }
}