niiko/developers

CRM v1 read-only

crm.month_summary_get

Reads how the month is going, piece by piece and with the same figures each read would give: new clients, collected, proposals sent and accepted, deals won, appointments and the ledger result. A piece the person's role does not see, or whose read is off, comes back in unavailable.

Last updated

POST /api/v1/reads/crm.month_summary_get
Token scope
crm.month_summary_get@1
Workspace permission
api.crm.month_summary_get off by default
Who reads
The person behind the token, with their role. Someone who leaves the workspace stops reading.
Three permissions

A token with that scope, the workspace owner having switched the read on, and the person's role seeing it in the product. None of them is enough alone. OAuth only →

Request

No fields.

Response — output when status is done

fieldtyperules
periodStartstringrequired^\d{4}-\d{2}-\d{2}$
periodEndstringrequired^\d{4}-\d{2}-\d{2}$
newClientsobject | nullrequired
collectedobject | nullrequired
proposalsobject | nullrequired
dealsWonobject | nullrequired
appointmentsobject | nullrequired
monthResultobject | nullrequired
unavailableobject[]required

newClients

fieldtyperules
totalintegerrequired≥ 0
totalIsMinimumbooleanrequired
byStatusmap<string, integer>required

collected

fieldtyperules
thisMonthstringrequired^-?\d+\.\d{2}$
samePeriodLastMonthstringrequired^-?\d+\.\d{2}$
outstandingstringrequired^-?\d+\.\d{2}$
openInvoicesintegerrequired≥ 0
currencystringrequired

proposals

fieldtyperules
sentintegerrequired≥ 0
acceptedintegerrequired≥ 0
acceptedUsdstringrequired^-?\d+\.\d{2}$
awaitingReplyintegerrequired≥ 0
awaitingReplyUsdstringrequired^-?\d+\.\d{2}$
totalIsMinimumbooleanrequired

dealsWon

fieldtyperules
countintegerrequired≥ 0
totalUsdstringrequired^-?\d+\.\d{2}$

appointments

fieldtyperules
countintegerrequired≥ 0
byStatusmap<string, integer>required
totalIsMinimumbooleanrequired

monthResult

fieldtyperules
currencystringrequired
ledgerBalancedbooleanrequired
monthstring | nullrequired
noActivityThisMonthbooleanrequired
thisMonthobject | nullrequired
previousMonthobject | nullrequired

thisMonth

fieldtyperules
revenuestringrequired^-?\d+\.\d{2}$
expensesstringrequired^-?\d+\.\d{2}$
netIncomestringrequired^-?\d+\.\d{2}$
closedbooleanrequired
topRevenueobject[]required
topExpensesobject[]required

topRevenue[]

fieldtyperules
accountstringrequired
amountstringrequired^-?\d+\.\d{2}$

topExpenses[]

fieldtyperules
accountstringrequired
amountstringrequired^-?\d+\.\d{2}$

previousMonth

fieldtyperules
monthstringrequired^\d{4}-\d{2}$
revenuestringrequired^-?\d+\.\d{2}$
expensesstringrequired^-?\d+\.\d{2}$
netIncomestringrequired^-?\d+\.\d{2}$

unavailable[]

fieldtyperules
piece"new_clients" | "collected" | "proposals" | "deals_won" | "appointments" | "month_result"required
reason"role" | "off"required

Example

# Reads take an OAuth access token, not an API key, and no idempotency key: reading changes nothing.
curl -X POST https://niiko.org/api/v1/reads/crm.month_summary_get \
  -H "Authorization: Bearer $NIIKO_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
# 200 → done · 4xx → refused, with a named reason

Why it may refuse

Each reason names who can fix it and how; detail.message, when present, says what to do. Refusals & HTTP codes →

invalid_inputrole_forbiddengrant_offreads_need_a_person

In the clients

@vorluno/niiko-sdkniiko.getMonthSummary()
niiko (Python)niiko.get_month_summary() from 0.3.0 · not on the registry yet
niiko-cliniiko read crm.month_summary_get
n8n-nodes-niikoNo reads: the node holds a key, and reading needs a person through OAuth.
niiko-mcp-servercrm_month_summary_get readOnlyHint

History