---
title: "Rule hits and people's corrections for the p12 Rules tab (#2587)"
method: GET
path: "/accountant/companies/{customerId}/merchant-rule-stats"
tags: ["Accountant Portal"]
---

# Rule hits and people's corrections for the p12 Rules tab (#2587)

`GET /accountant/companies/{customerId}/merchant-rule-stats`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/merchant-rule-stats`
- Auth: HTTP bearer

For the last `days` (1 to 365, default 90), per merchant rule: `hits`, the rows whose categorization cites the rule in the decision log (#3039), and `correctedByPeople`, those a person (accountant or client) later moved to another account, with the newest correction and who made it. Rules with no hit in the window are absent; join to GET …/merchant-rules by `ruleId`. `peopleKeepCorrecting` flags a rule people keep correcting: at least 3 corrections that are at least a quarter of its hits in the window (provisional thresholds, a call for Jacob). Read-only. A signed-in person only: every API key is refused, the service token included (404).

## Path parameters

- `customerId` string, uuid, required

## Query parameters

- `days` integer

## Response `200`

Hits and corrections per rule

- object
  - `success` true, required
  - `data` object, required
    - `companyId` string, uuid, required
    - `days` integer, required
    - `since` string, date-time, required
    - `rules` object[], required
      - `ruleId` string, required
      - `hits` integer, required
      - `correctedByPeople` integer, required
      - `lastCorrection` object, nullable, required
        - `at` string, date-time, required
        - `userId` string, nullable, required
        - `name` string, nullable, required
      - `peopleKeepCorrecting` boolean, required

## Other responses

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

## Changes

- **2026-11-26** `4a2098becaf9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/accountant/companies/:customerId/merchant-rule-stats/get.md)

---

[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/4f4c2d34276b?raw)
