---
title: "Get Namespace Errors"
method: GET
path: "/v1/analytics/namespaces/errors"
tags: ["Analytics", "Analytics - Namespaces"]
---

# Get Namespace Errors

`GET /v1/analytics/namespaces/errors`

Batch error/failure counts for every collection & cluster in the namespace.

Returns one entry per resource that has at least one error/failure in the
window, in a single response — replacing the per-resource
``/analytics/{collections,clusters}/{id}/failures`` fan-out (the Studio
Monitoring "Errors & Health" N+1, which fired ~13+ calls per visit, most
returning zero). Collection errors come from the ClickHouse
``extraction_events`` warehouse; cluster failures from Mongo
``clustering_results``. An empty ``collections``/``clusters`` list means that
resource type is healthy for the window.

**Recommended workflow:** call this once for the aggregate health view, then
call the per-resource ``/failures`` endpoint lazily ONLY for the (usually
few) resources reporting errors to get the full error-type breakdown.

**Example:**
```bash
curl -X GET "https://api.mixpeek.com/v1/analytics/namespaces/errors?hours=24" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Namespace: your-namespace"
```

## Query parameters

- `hours` integer — Hours of history to analyze

## Response `200`

Successful Response

- NamespaceErrorsResponse — Per-resource error counts across a namespace in one response. Batches what used to be one ``/analytics/{collections,clusters}/{id}/failures`` call per resource (the Studio Monitoring "Errors & Health" N+1) into a single namespace-scoped query pair. Only resources with at least one error/failure in the window are returned, so an empty ``collections``/``clusters`` list means that resource type is healthy for the window.
  - `namespace_id` string, required — Namespace ID analyzed
  - `hours` integer, required — Hours of history analyzed
  - `collections` ResourceErrorCount[] — Collections with extraction errors (ClickHouse extraction_events)
    - `resource_id` string, required — Collection ID or cluster ID
    - `error_count` integer, required — Number of errors/failures in the analyzed window
  - `clusters` ResourceErrorCount[] — Clusters with execution failures (Mongo clustering_results)
    - `resource_id` string, required — Collection ID or cluster ID
    - `error_count` integer, required — Number of errors/failures in the analyzed window
  - `total_errors` integer, required — Total errors + failures across all resources in the window

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/mixpeek/apis/mixpeek-api.md) · [All operations](https://skmtc.net/mixpeek/apis/mixpeek-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mixpeek/mixpeek-api/versions/220a3b263fda/schema)
