niiko/developers

Miira · leads & WhatsApp v1 read-only

miira.funnel_get

Reads the Miira lead funnel by stage (the same rule as the board), how many leads are qualified, how many came in this month and the 15 most recent with their stage. Clients who already bought are in the CRM, not here.

Last updated

POST /api/v1/reads/miira.funnel_get
Token scope
miira.funnel_get@1
Workspace permission
api.miira.funnel_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
leadsInFunnelintegerrequired≥ 0
totalIsMinimumbooleanrequired
byStageobject[]required
qualifiedintegerrequired≥ 0
enteredThisMonthintegerrequired≥ 0
recentobject[]required

byStage[]

fieldtyperules
stagestringrequired
qualifiedbooleanrequired
leadsintegerrequired≥ 0

recent[]

fieldtyperules
namestring | nullrequired
stagestring | nullrequired
enteredOnstringrequired^\d{4}-\d{2}-\d{2}$

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/miira.funnel_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.getFunnel()
niiko (Python)niiko.get_funnel() from 0.3.0 · not on the registry yet
niiko-cliniiko read miira.funnel_get
n8n-nodes-niikoNo reads: the node holds a key, and reading needs a person through OAuth.
niiko-mcp-servermiira_funnel_get readOnlyHint

History