{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brixsignage-com/json-schema/brixsignage-com-user-schema.json",
  "title": "User",
  "description": "A person in the workspace.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brixsignage-com-users-api-openapi.yml#/components/schemas/User",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "invited",
        "deactivated"
      ],
      "description": "`invited` until the person sets a password or signs in."
    },
    "roleId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The role of the first entry in `access`; null when the person has no access."
    },
    "scope": {
      "type": "string",
      "description": "The location name of the first entry in `access`; `—` when none."
    },
    "loginMethod": {
      "type": "string",
      "enum": [
        "sso",
        "passkey",
        "password"
      ],
      "description": "How the person signs in."
    },
    "totpEnabled": {
      "type": "boolean",
      "description": "Two-factor authentication with an authenticator app is on."
    },
    "passkeyCount": {
      "type": "integer"
    },
    "lastLoginAt": {
      "anyOf": [
        {
          "type": "string",
          "description": "ISO-8601 timestamp (UTC)."
        },
        {
          "type": "null"
        }
      ]
    },
    "access": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Role assignment (membership) id. Use it to change or remove this assignment at `/v1/org-nodes/{nodeId}/members/{id}`."
          },
          "nodeId": {
            "type": "string",
            "description": "Location id."
          },
          "nodeName": {
            "type": "string",
            "description": "Location name; `—` when the location no longer exists."
          },
          "roleId": {
            "type": "string"
          },
          "roleName": {
            "type": "string",
            "description": "Role name; `—` when the role no longer exists."
          }
        },
        "required": [
          "id",
          "nodeId",
          "nodeName",
          "roleId",
          "roleName"
        ]
      },
      "description": "Each location the person can access and the role they hold there. Only locations the caller can see are listed."
    },
    "contentScope": {
      "description": "This person's own content setting: `all`, `shared` (only content shared with them plus their own locations' content), or `null` = their roles' default.",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "all",
            "shared"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "contentScopeEffective": {
      "description": "The content setting that applies now (person > roles > workspace default `all`; an Owner always `all`).",
      "type": "string",
      "enum": [
        "all",
        "shared"
      ]
    },
    "contentScopeSource": {
      "description": "Where `contentScopeEffective` comes from.",
      "type": "string",
      "enum": [
        "person",
        "role",
        "workspace",
        "owner"
      ]
    }
  },
  "required": [
    "id",
    "name",
    "email",
    "status",
    "roleId",
    "scope",
    "loginMethod",
    "totpEnabled",
    "passkeyCount",
    "lastLoginAt",
    "access"
  ]
}