---
title: "Get facet counts for transactions"
method: GET
path: "/companies/{companyId}/transactions/facets"
tags: ["Transactions"]
---

# Get facet counts for transactions

`GET /companies/{companyId}/transactions/facets`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/companies/{companyId}/transactions/facets`
- Auth: HTTP bearer

Returns per-source-account and per-category counts for the non-deleted transactions in the authorized scope and optional inclusive `occurred_on` window (same date semantics as the list). Search, status, direction, sort and the source/category selections do not narrow the counts. Each source account counts unique rows matching either their bank or integration account ID, as selecting that source does in the list. Distinct source buckets may overlap, so their sum may exceed the number of rows. `unassignedSourceCount` counts rows with both source IDs absent. Category counts and `unassignedCategoryCount` partition the rows in the window. Used to populate multi-select filter chips in the transaction list UI.

## Query parameters

- `entityId` union
  - string, uuid
  - 'consolidated'
- `dateFrom` string, date
- `dateTo` string, date

## Response `200`

Facet counts

- object
  - `success` boolean
  - `data` object
    - `unassignedSourceCount` integer, required: Rows in the window with neither a bank nor an integration account.
    - `unassignedCategoryCount` integer, required: Rows in the window with no category GL account.
    - `sourceAccounts` object[], required: Per-source-account counts, sorted by count descending.
      - `id` string, uuid, required
      - `label` string, required
      - `count` integer, required
    - `categories` object[], required: Per-category GL account counts, sorted by label ascending.
      - `id` string, uuid, required
      - `label` string, required
      - `count` integer, required

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `422`: Request failed validation

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) · [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) · [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/20090ea32b0d?raw)
