# count_unavailable

Source: https://capacms.com/docs/errors/count_unavailable

400 invalid_request. totalCount could not be computed cheaply for this filter (a relation filter matching over 50,000 entries).

| HTTP status | `type`            | Surfaces      |
| ----------- | ----------------- | ------------- |
| 400         | `invalid_request` | REST, GraphQL |

## What it means

totalCount could not be computed cheaply for this filter (a relation filter matching over 50,000 entries).

| When                                                 | What the `hint` tells you                     |
| ---------------------------------------------------- | --------------------------------------------- |
| `count=true` with a relation filter over 50,000 rows | drop the relation filter or drop `count=true` |

## What to do

Drop totalCount, or narrow the filter.

## The response

HTTP 400:

```json
{
  "error": {
    "type": "invalid_request",
    "code": "count_unavailable",
    "message": "This filter matches too many entries to count.",
    "param": "count",
    "docs": "https://docs.capacms.com/errors/count_unavailable"
  },
  "meta": {
    "version": "2026-10-01",
    "contract": 1,
    "requestId": "req_0f3c…"
  }
}
```

## On GraphQL

`/api/graphql` answers the same `code` inside `errors[].extensions`. The status depends on the `Accept` header you send ([status codes](https://capacms.com/docs/api/graphql#status-codes)):

| `application/json` | `graphql-response+json` | When                                                                                                     |
| ------------------ | ----------------------- | -------------------------------------------------------------------------------------------------------- |
| 200                | 200                     | `totalCount` could not be taken (a hop filter matching over 50,000 entries); only `totalCount` is `null` |

## See also

* [Totals](https://capacms.com/docs/api/entries#totals)
