# Count Operations

> Coming soon, upon request — this feature is turned on for your tenant by the Aurea team. [Contact us](https://www.aureahub.com/contact)

How many operations match a set of filters, and how many of them were created in the last 24 hours — without paging through [List Operations](https://docs.aureahub.com/docs/operations-list.md).

## Overview

- The same caller and scope as [List Operations](https://docs.aureahub.com/docs/operations-list.md): a user counts their own operations, whatever `userId` says; the tenant roles that read the tenant's transactions count every operation of the tenant, and can narrow with `userId`.
- The list's filters: `state`, `type`, `chain`, `walletId`, `userId`, `from` (created at or after) and `to` (created before). No paging parameters.
- `total`: the operations the filters match. `last24h`: of those, the ones created in the last 24 hours by the server's clock.
- `400` `OPERATIONS_WINDOW_INVALID` when `from` is not before `to`; `400` for a filter value that is not valid.
- Without operation records ([Operations & Fees](https://docs.aureahub.com/docs/guide-operations.md)) the answer is `{ "total": 0, "last24h": 0 }`.

## Endpoint

### `GET /v1/operations/count`

Authentication: bearer token required.

Counts the caller's operations — or the tenant's, for the roles that read them — matching the filters.

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `state` | string | no | One state, e.g. `COMPLETED` |
| `type` | string | no | One type, e.g. `TRANSFER` |
| `chain` | string | no | A chain slug, e.g. `base` |
| `walletId` | string | no | One wallet |
| `userId` | string | no | One user's (tenant readers only) |
| `from` | string (date-time) | no | Created at or after |
| `to` | string (date-time) | no | Created before |

**Responses**

`200` OK

```json
{
  "total": 1284,
  "last24h": 37
}
```

`400` Window

```json
{
  "statusCode": 400,
  "error": "BadRequestError",
  "message": "`from` must be before `to`",
  "details": { "code": "OPERATIONS_WINDOW_INVALID" }
}
```

**Example request**

```bash
curl "https://api.aureahub.com/v1/operations/count?state=COMPLETED&type=TRANSFER" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

---

Web version: https://docs.aureahub.com/#operations-count
