---
title: "What the matchers could link now, as counts only"
method: POST
path: "/accountant/companies/{customerId}/documents/rebuild-links"
tags: ["Accountant Documents"]
---

# What the matchers could link now, as counts only

`POST /accountant/companies/{customerId}/documents/rebuild-links`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/documents/rebuild-links`
- Auth: HTTP bearer

Judges the company's documents that have no transaction link (assigned, not archived; at most 500) as the bookkeeping agent would act on them, and returns how many fall in each group. It writes nothing: no link, no match row, no hold and no recorded verdict. `writable` is a match that may be written now, `waiting` a match whose date window is still open, `held` a document the policy holds, `noFit` one with no fitting bank row, `blocked` a match that is not writable for another reason (for example a pair a person rejected), and `skipped` a document that could not be read when judged. `capped` is true when there were more documents than were judged. For an assigned accountant; the service keys are refused.

## Path parameters

- `customerId` string, uuid, required

## Response `200`

The counts

- object
  - `success` true, required
  - `data` object, required
    - `judged` integer, required
    - `writable` integer, required
    - `waiting` integer, required
    - `held` integer, required
    - `noFit` integer, required
    - `blocked` integer, required
    - `skipped` integer, required
    - `capped` boolean, required

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member

## Changes

- **2026-11-28** `24ced4d421d8`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/medianfi/apis/median-api/changes/accountant/companies/:customerId/documents/rebuild-links/post.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)
