{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kognitos/json-schema/kognitos-v1-list-workspace-users-response-schema.json",
  "title": "v1ListWorkspaceUsersResponse",
  "description": "Response message for listing users in a workspace.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kognitos-workspaces-api-openapi.yml#/components/schemas/v1ListWorkspaceUsersResponse",
  "type": "object",
  "properties": {
    "users": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/v1UserWithRoles"
      },
      "description": "The list of users in the workspace with their roles."
    },
    "next_page_token": {
      "type": "string",
      "description": "A token to retrieve the next page of results.\nPass this value in the `page_token` field in the subsequent call to\n`ListWorkspaceUsers` to get the next page of results. If this field is\nempty, it means there are no more results."
    }
  },
  "$defs": {
    "v1RoleBasicInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The role name (e.g., \"workspace-admin\", \"org-admin\", or custom role name)."
        },
        "role_scope": {
          "$ref": "#/$defs/v1RoleScope"
        }
      },
      "title": "Lightweight role information following the UserBasicInfo pattern.\nNote: RoleScope is imported from rbac.proto"
    },
    "v1RoleScope": {
      "type": "string",
      "enum": [
        "ROLE_SCOPE_UNSPECIFIED",
        "ROLE_SCOPE_ORGANIZATION",
        "ROLE_SCOPE_WORKSPACE"
      ],
      "default": "ROLE_SCOPE_UNSPECIFIED",
      "description": "Defines the scope at which a role can be applied.\n\n - ROLE_SCOPE_UNSPECIFIED: Unspecified role scope.\n - ROLE_SCOPE_ORGANIZATION: Role applies at the organization level.\n - ROLE_SCOPE_WORKSPACE: Role applies at the workspace level."
    },
    "v1UserBasicInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "title": "The unique resource name of the user basic info.\nFormat: `organizations/{organization}/users/{user_basic_info}`"
        },
        "display_name": {
          "type": "string",
          "description": "The user's display name."
        },
        "email": {
          "type": "string",
          "description": "The user's email address."
        }
      },
      "description": "Contains basic information about a user.\nThis is a lightweight representation used when full user details are not needed."
    },
    "v1UserWithRoles": {
      "type": "object",
      "properties": {
        "user": {
          "$ref": "#/$defs/v1UserBasicInfo"
        },
        "roles": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/v1RoleBasicInfo"
          },
          "description": "The user's assigned roles.\nEach role includes its scope (organization or workspace)."
        }
      },
      "description": "A user with their assigned roles.\nThis type is reusable for both organization and workspace user listing APIs.\nThe RoleScope field in each role indicates whether the role is org-level or workspace-level."
    }
  }
}