niiko/developers

CRM v1 read-only

crm.clients_search

Counts and finds the workspace's CRM clients, optionally by part of the name, status, tag or creation date. Returns the total, the total per status and up to 15 clients with status, owner and creation day. No contact details and no notes.

Last updated

POST /api/v1/reads/crm.clients_search
Token scope
crm.clients_search@1
Workspace permission
api.crm.clients_search 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

fieldtyperules
searchstringoptionalmax 200
status"lead" | "qualified" | "client" | "churned" | "reactivated" | "completed"optional
tagstringoptionalmax 100
createdSincestring (date-time)optional

Response — output when status is done

fieldtyperules
totalintegerrequired≥ 0
totalIsMinimumbooleanrequired
byStatusmap<string, unknown>required
clientsobject[]required

clients[]

fieldtyperules
namestringrequired
status"lead" | "qualified" | "client" | "churned" | "reactivated" | "completed"required
ownerstring | nullrequired
createdOnstringrequired^\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/crm.clients_search \
  -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.searchClients()
niiko (Python)niiko.search_clients() from 0.3.0 · not on the registry yet
niiko-cliniiko read crm.clients_search
n8n-nodes-niikoNo reads: the node holds a key, and reading needs a person through OAuth.
niiko-mcp-servercrm_clients_search readOnlyHint

History