Block Type Discovery

Unified Block Types Endpoint

GET /api/tenant/{tenantId}/project/{projectId}/block/types/all

Discover all available block types (filters, calculators, and enrichments) in a single API call. This unified endpoint is the recommended way to retrieve complete information about all analysis capabilities available in mindzieStudio.

Why Use the Unified Endpoint?

The unified endpoint provides several advantages over querying individual category endpoints:

  • Single Request: Get all block types in one API call instead of multiple requests
  • Complete Metadata: Includes enrichments which are not available through category-specific endpoints
  • Grouped Response: Results are organized by block category for easy processing
  • Rich Metadata: Each block type includes documentation URLs, usage notes, and related blocks
  • AI Integration: Optimized for AI coding assistants and MCP server integration

Request

GET /api/tenant/{tenantId}/project/{projectId}/block/types/all
Authorization: Bearer {token}

Path Parameters

Parameter Type Required Description
tenantId GUID Yes The tenant identifier
projectId GUID Yes The project identifier

Response

Response Structure

{
  "BlockTypes": [...],
  "Categories": ["Attribute Filters", "Time Filters", "Calculators", ...],
  "TotalCount": 45,
  "ByBlockCategory": {
    "Filter": [...],
    "Calculator": [...],
    "Enrichment": [...]
  }
}

Response Fields

Field Type Description
BlockTypes Array All block types with complete metadata
Categories Array List of all unique categories
TotalCount Integer Total number of block types available
ByBlockCategory Object Block types grouped by Filter/Calculator/Enrichment

Block Type Object

Each block type in the BlockTypes array contains:

Field Type Description
OperatorName String Unique identifier for the block type (e.g., "CaseAttributeFilter")
DisplayName String Human-readable name shown in the UI
Description String Brief description of what the block does
Category String Functional category (e.g., "Attribute Filters", "Time Filters")
BlockType String Top-level classification: "Filter", "Calculator", or "Enrichment"
DocumentationUrl String URL to the documentation page for this block type
UsageFrequency String How commonly this block type is used ("High", "Medium", "Low")
ExcludeFromOrFilter Boolean Whether this filter can be used in OR combinations
AutoTitleEnabled Boolean Whether automatic title generation is supported
SupportedDisplayTypes Array Supported visualization types for results
UsageNotes String Additional guidance for using this block type
RelatedBlocks Array List of related block types
CommonUseCases Array Typical scenarios where this block type is useful

Example Response

{
  "BlockTypes": [
    {
      "OperatorName": "CaseAttributeFilter",
      "DisplayName": "Case Attribute Filter",
      "Description": "Filter cases based on attribute values such as customer type, region, or priority level",
      "Category": "Attribute Filters",
      "BlockType": "Filter",
      "DocumentationUrl": "/mindzie_studio/filters/case-attribute-filter",
      "UsageFrequency": "High",
      "ExcludeFromOrFilter": false,
      "AutoTitleEnabled": true,
      "SupportedDisplayTypes": ["table", "chart"],
      "UsageNotes": "Supports exact match, contains, and regex patterns",
      "RelatedBlocks": ["EventAttributeFilter", "CaseIdFilter"],
      "CommonUseCases": [
        "Filter by customer segment",
        "Focus on specific regions",
        "Analyze high-priority cases"
      ]
    },
    {
      "OperatorName": "CaseDurationCalculator",
      "DisplayName": "Case Duration Calculator",
      "Description": "Calculate the total duration of cases from start to end",
      "Category": "Time Calculators",
      "BlockType": "Calculator",
      "DocumentationUrl": "/mindzie_studio/calculators/case-duration-calculator",
      "UsageFrequency": "High",
      "ExcludeFromOrFilter": false,
      "AutoTitleEnabled": true,
      "SupportedDisplayTypes": ["histogram", "table", "boxplot"],
      "UsageNotes": "Duration is calculated in the project's configured time unit",
      "RelatedBlocks": ["ActivityDurationCalculator", "WaitTimeCalculator"],
      "CommonUseCases": [
        "Analyze case cycle times",
        "Identify slow-running cases",
        "Compare process efficiency"
      ]
    },
    {
      "OperatorName": "CaseStageCalculator",
      "DisplayName": "Case Stage Calculator",
      "Description": "Assign stage labels to cases based on activity patterns and rules",
      "Category": "Stage Analysis",
      "BlockType": "Enrichment",
      "DocumentationUrl": "/mindzie_studio/enrichments/case-stage-calculator",
      "UsageFrequency": "Medium",
      "ExcludeFromOrFilter": false,
      "AutoTitleEnabled": true,
      "SupportedDisplayTypes": ["sankey", "table"],
      "UsageNotes": "Requires stage definitions to be configured",
      "RelatedBlocks": ["CaseStatusEnrichment", "MilestoneDetector"],
      "CommonUseCases": [
        "Track case progress through stages",
        "Identify bottleneck stages",
        "Monitor stage transitions"
      ]
    }
  ],
  "Categories": [
    "Attribute Filters",
    "Time Filters",
    "Activity Filters",
    "Time Calculators",
    "Count Calculators",
    "Stage Analysis",
    "Data Enrichment"
  ],
  "TotalCount": 45,
  "ByBlockCategory": {
    "Filter": [
      { "OperatorName": "CaseAttributeFilter", "DisplayName": "Case Attribute Filter", ... },
      { "OperatorName": "DateRangeFilter", "DisplayName": "Date Range Filter", ... }
    ],
    "Calculator": [
      { "OperatorName": "CaseDurationCalculator", "DisplayName": "Case Duration Calculator", ... }
    ],
    "Enrichment": [
      { "OperatorName": "CaseStageCalculator", "DisplayName": "Case Stage Calculator", ... }
    ]
  }
}

JavaScript Example

// Discover all available block types
async function discoverAllBlockTypes(tenantId, projectId, token) {
  const response = await fetch(
    `/api/tenant/${tenantId}/project/${projectId}/block/types/all`,
    {
      method: 'GET',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      }
    }
  );

  if (!response.ok) {
    throw new Error(`Failed to discover block types: ${response.status}`);
  }

  const data = await response.json();

  console.log(`Discovered ${data.TotalCount} block types:`);
  console.log(`- Filters: ${data.ByBlockCategory.Filter.length}`);
  console.log(`- Calculators: ${data.ByBlockCategory.Calculator.length}`);
  console.log(`- Enrichments: ${data.ByBlockCategory.Enrichment.length}`);

  return data;
}

// Find block types by category
function getBlockTypesByCategory(allTypes, category) {
  return allTypes.BlockTypes.filter(bt => bt.Category === category);
}

// Find high-usage block types
function getHighUsageBlockTypes(allTypes) {
  return allTypes.BlockTypes.filter(bt => bt.UsageFrequency === 'High');
}

// Usage
const blockTypes = await discoverAllBlockTypes(tenantId, projectId, token);
const timeFilters = getBlockTypesByCategory(blockTypes, 'Time Filters');
const popular = getHighUsageBlockTypes(blockTypes);

Python Example

import requests
from typing import Dict, List, Any

class BlockTypeDiscovery:
    def __init__(self, base_url: str, tenant_id: str, project_id: str, token: str):
        self.base_url = base_url
        self.tenant_id = tenant_id
        self.project_id = project_id
        self.headers = {
            'Authorization': f'Bearer {token}',
            'Content-Type': 'application/json'
        }

    def discover_all(self) -> Dict[str, Any]:
        """Discover all available block types"""
        url = f"{self.base_url}/api/tenant/{self.tenant_id}/project/{self.project_id}/block/types/all"
        response = requests.get(url, headers=self.headers)
        response.raise_for_status()
        return response.json()

    def get_filters(self) -> List[Dict]:
        """Get all filter block types"""
        data = self.discover_all()
        return data.get('ByBlockCategory', {}).get('Filter', [])

    def get_calculators(self) -> List[Dict]:
        """Get all calculator block types"""
        data = self.discover_all()
        return data.get('ByBlockCategory', {}).get('Calculator', [])

    def get_enrichments(self) -> List[Dict]:
        """Get all enrichment block types"""
        data = self.discover_all()
        return data.get('ByBlockCategory', {}).get('Enrichment', [])

    def find_by_use_case(self, keyword: str) -> List[Dict]:
        """Find block types matching a use case keyword"""
        data = self.discover_all()
        results = []
        for block_type in data['BlockTypes']:
            use_cases = block_type.get('CommonUseCases', [])
            if any(keyword.lower() in uc.lower() for uc in use_cases):
                results.append(block_type)
        return results

# Usage
discovery = BlockTypeDiscovery(
    'https://your-mindzie-instance.com',
    'tenant-guid',
    'project-guid',
    'your-auth-token'
)

# Discover all block types
all_types = discovery.discover_all()
print(f"Total block types: {all_types['TotalCount']}")

# Get block types by category
filters = discovery.get_filters()
calculators = discovery.get_calculators()
enrichments = discovery.get_enrichments()

# Find block types for duration analysis
duration_blocks = discovery.find_by_use_case('duration')

Category-Specific Endpoints

The unified endpoint is recommended for most use cases. However, category-specific endpoints are still available:

Endpoint Description
GET /block/types?category=filters Filters only
GET /block/types?category=calculators Calculators only
GET /block/types/{operatorName} Single block type details
GET /block/types/{operatorName}/schema Configuration schema for a block type

MCP Server Integration

AI coding assistants can use the mindzieAPI MCP server to discover block types programmatically:

mindzie_list_block_types category="unified"

This MCP tool call returns the same unified response, making it easy for AI tools to understand all available analysis capabilities.

See MCP Server Integration for complete documentation.

Use Cases

Building Dynamic UIs

Use the unified endpoint to populate block type selection menus with complete information about each option.

AI-Powered Analysis

AI assistants can discover available analysis capabilities and suggest appropriate block types based on user goals.

Documentation Generation

Generate dynamic documentation by iterating through all block types and their metadata.

Capability Auditing

Enumerate all available analysis capabilities for a project to ensure complete coverage.