Skip to main content
POST
/
v1
/
clusters
/
{cluster_id}
/
executions
/
list
List Cluster Execution History
curl --request POST \
  --url https://api.mixpeek.com/v1/clusters/{cluster_id}/executions/list \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'X-Namespace: <x-namespace>' \
  --data '
{
  "filters": {
    "AND": [
      {
        "field": "name",
        "operator": "eq",
        "value": "John"
      },
      {
        "field": "age",
        "operator": "gte",
        "value": 30
      }
    ],
    "OR": [
      {
        "field": "status",
        "operator": "eq",
        "value": "active"
      },
      {
        "field": "role",
        "operator": "eq",
        "value": "admin"
      }
    ],
    "NOT": [
      {
        "field": "department",
        "operator": "eq",
        "value": "HR"
      },
      {
        "field": "location",
        "operator": "eq",
        "value": "remote"
      }
    ],
    "case_sensitive": true
  },
  "sort": {
    "field": "created_at",
    "direction": "desc"
  },
  "search": "failed"
}
'
{
  "results": [
    {
      "run_id": "<string>",
      "cluster_id": "<string>",
      "status": "pending",
      "num_clusters": 1,
      "num_points": 1,
      "created_at": "2023-11-07T05:31:56Z",
      "metrics": {
        "calinski_harabasz_score": 1234.56,
        "davies_bouldin_index": 0.42,
        "description": "Excellent clustering quality",
        "silhouette_score": 0.85
      },
      "centroids": [
        {
          "cluster_id": "<string>",
          "num_members": 1,
          "label": "Product Reviews",
          "summary": "This cluster contains documents related to product reviews and customer feedback.",
          "keywords": [
            "reviews",
            "products",
            "feedback"
          ]
        }
      ],
      "completed_at": "2025-11-13T13:25:40.122000Z",
      "error_message": "Insufficient documents for clustering: need at least 2 documents",
      "llm_labeling_errors": [
        "{\"error\": \"LLM API timeout\", \"clusters\": [\"cl_3\", \"cl_5\"]}",
        "{\"error\": \"No representative documents\", \"clusters\": [\"cl_1\"]}"
      ]
    }
  ],
  "pagination": {
    "total": 123,
    "page": 123,
    "page_size": 123,
    "total_pages": 123,
    "next_page": "<string>",
    "previous_page": "<string>"
  },
  "total_count": 1,
  "stats": {
    "avg_execution_time_ms": 8234.5,
    "avg_num_clusters": 5.2,
    "description": "Healthy execution stats (mostly successful)",
    "executions_by_status": {
      "completed": 45,
      "failed": 3,
      "pending": 0,
      "processing": 2
    },
    "total_documents_clustered": 50000,
    "total_executions": 50
  }
}

Headers

Authorization
string
required

REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.

X-Namespace
string
required

REQUIRED: Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'

Path Parameters

cluster_id
string
required

Cluster ID

Query Parameters

limit
integer | null
offset
integer | null

Body

application/json

Request parameters for listing and filtering cluster execution history.

Provides flexible querying of historical clustering executions with filtering, sorting, and search capabilities. Use to build execution history UIs, compare runs over time, and analyze clustering performance trends.

Use Cases: - Display execution history table with sorting and filtering - Find failed executions for debugging - Compare metrics across successful runs - Search executions by date range or status - Build execution timeline visualization

Query Behavior: - Empty request {} returns all executions sorted by created_at (newest first) - Filters, sort, and search can be combined for complex queries - Results are paginated (use page/page_size query params)

Note: All fields are OPTIONAL. Omit for default behavior (all executions, newest first).

filters
LogicalOperator · object

OPTIONAL. Complex filtering conditions for execution history. NOT REQUIRED - omit to return all executions. Structure: Logical operator (AND/OR) with array of conditions. Supported filter fields: - status: Filter by execution status (pending/processing/completed/failed). - created_at: Filter by execution start date (use gte/lte for ranges). - num_clusters: Filter by number of clusters found. - metrics.silhouette_score: Filter by quality threshold. Example filters: - Status is completed: {operator: 'AND', conditions: [{field: 'status', value: 'completed', operator: '=='}]}. - Created in last 7 days: {operator: 'AND', conditions: [{field: 'created_at', operator: 'gte', value: '2025-11-06T00:00:00Z'}]}. - Good quality (silhouette > 0.5): {operator: 'AND', conditions: [{field: 'metrics.silhouette_score', operator: '>', value: 0.5}]}. Combine with OR: Status completed OR failed (exclude in-progress).

sort
SortOption · object

OPTIONAL. Sorting configuration for results. NOT REQUIRED - defaults to created_at descending (newest first). Structure: {field: 'field_name', direction: 'asc' or 'desc'}. Sortable fields: - created_at: Sort by execution start time (default). - completed_at: Sort by execution finish time. - num_clusters: Sort by cluster count. - num_points: Sort by document count. - metrics.silhouette_score: Sort by quality score. - status: Sort by execution status. Common use cases: - Newest first (default): {field: 'created_at', direction: 'desc'}. - Best quality first: {field: 'metrics.silhouette_score', direction: 'desc'}. - Failed executions first: {field: 'status', direction: 'asc'} (alphabetical).

search
string | null

OPTIONAL. Full-text search query across execution metadata. NOT REQUIRED - omit for no search filtering. Searches in: - run_id: Search by execution identifier. - error_message: Find executions with specific error text. - centroids.label: Search by cluster label names. - centroids.summary: Search by cluster descriptions. Behavior: - Case-insensitive partial matching. - Multiple terms are AND-ed together. - Combines with filters for complex queries. Examples: - 'failed' → Find executions with 'failed' in error messages. - 'product review' → Find executions with clusters about products/reviews. - 'run_abc123' → Find specific execution by ID.

Example:

"failed"

Response

Successful Response

Complete response for cluster execution history listing endpoint.

Returns paginated execution history with filtering, sorting, and aggregate statistics. Use to build execution history UIs, monitoring dashboards, and performance analytics.

Response Structure: - results: Array of execution details (paginated) - pagination: Page navigation info (current page, total pages, etc.) - total_count: Total matching executions (across all pages) - stats: Aggregated metrics for current result set

Use Cases: - Build execution history table with pagination - Display execution status dashboard with charts - Monitor clustering performance trends - Debug failed executions - Compare quality metrics across runs

Pagination Behavior: - Default: 10 executions per page - Use query params: ?page=1&page_size=20 - results contains current page only - total_count shows all matching executions - pagination provides navigation links

Example Workflow: 1. Request: POST /clusters/{id}/executions/list with filters 2. Response: 50 total executions, showing page 1 (10 results) 3. Display: Show 10 results + "Page 1 of 5" + aggregate stats 4. Navigate: Use pagination.next_page for next 10 results

results
ClusterExecutionResult · object[]
required

REQUIRED. Array of cluster execution results for the current page. Length: 0 to page_size (default 10, max typically 100). Empty array [] if: - No executions exist for this cluster. - Filters matched no results. - Requested page beyond available pages. Sorted by: created_at descending (newest first) by default. Override with sort parameter in request. Each item contains: - run_id: Unique execution identifier. - status: pending/processing/completed/failed. - num_clusters: Clusters found. - metrics: Quality scores (if available). - centroids: Cluster labels and summaries (if available). - created_at/completed_at: Timestamps. - error_message: Error details (if failed). Use for: Rendering execution history table rows.

pagination
PaginationResponse · object
required

REQUIRED. Pagination metadata for navigating result pages. Contains: - total: Total items across all pages (same as total_count). - page: Current page number (1-indexed). - page_size: Items per page. - total_pages: Total number of pages. - next_page: URL for next page (null if last page). - previous_page: URL for previous page (null if first page). Use for: - Pagination controls ('Page 2 of 5'). - Next/Previous buttons (check null for disabled state). - Showing X-Y of Z results calculations.

total_count
integer
required

REQUIRED. Total number of executions matching the query across ALL pages. Use for: - Display total count ('Found 127 executions'). - Calculate pagination ('Showing 1-10 of 127'). - Validate filters (0 = no matches, refine query). Behavior: - Includes all filtered results, not just current page. - Changes when filters are applied. - Equals len(results) only if all results fit on one page. Example: - Query returns 127 executions total. - Page size = 10. - Current page (1) shows results[0:10]. - total_count = 127 (not 10).

Required range: x >= 0
stats
ClusterExecutionListStats · object

OPTIONAL. Aggregate statistics for executions in current result set. NOT REQUIRED - may be null if stats calculation disabled. Typically always provided for execution listing. Contains: - total_executions: Count in current page. - executions_by_status: Status distribution {'completed': 45, 'failed': 3}. - avg_execution_time_ms: Mean duration. - total_documents_clustered: Sum of all processed documents. - avg_num_clusters: Mean clusters per execution. Use for: - Summary cards above table. - Status pie chart. - Performance metrics dashboard. Note: - Stats calculated for current page only (or all if no pagination). - Respects filters (stats for filtered subset).

Example:
{
"avg_execution_time_ms": 8234.5,
"avg_num_clusters": 5.2,
"description": "Healthy execution stats (mostly successful)",
"executions_by_status": {
"completed": 45,
"failed": 3,
"pending": 0,
"processing": 2
},
"total_documents_clustered": 50000,
"total_executions": 50
}