CLI Documentation

Install niotio and drive campaigns, respondents, comment tags and follow-up cases from your terminal or a coding agent — with machine-readable JSON and safe non-interactive defaults.

README API MCP

MCP server for AI agents

If an AI agent (Claude, ChatGPT, Cursor, n8n) is doing the work, /mcp is the shorter path: same tools, same token — the agent calls the platform directly instead of shelling out.

MCP documentation
1. Install

Install straight from this app — all you need is curl (no GitHub token, no Go).

curl -fsSL https://niotio.dk/cli/install.sh | sh
2. Configure
niotio config set-url   https://niotio.dk
niotio config set-token YOUR_API_TOKEN
niotio doctor        # checks config, health and auth

CI/agents can skip the file: NPS_URL + NPS_TOKEN (and NPS_LANG for Danish help text).

Global flags
Flag Meaning
--jsonMachine-readable JSON (recommended for agents)
--profileSelect a config profile
--url / --tokenOverride the target
--yesConfirm destructive actions non-interactively
--timeoutHTTP timeout (default 30s)
Commands
Command Description
niotio doctorCheck config, connectivity and auth
niotio campaign list | get | create | updateList and edit campaigns
niotio campaign activate | deactivate | sendLifecycle and dispatch
niotio campaign metrics | respondents | activityResults and activity log
niotio respondent add | importAdd respondents (single or CSV)
niotio campaign simulate | simulate-clearGenerate/remove simulated responses (test campaigns)
niotio case list | counts | show | notesFollow-up cases: inbox, counters, one case, note timeline
niotio case note | assign | statusAdd a note, assign/unassign, change status with an outcome
niotio tag list | create | update | deleteComment tag vocabulary — with who created each tag
niotio tag add | removePut one tag on a comment, or take it off (the rest stay)
niotio comment list | tags | set-tagsSearch comments by text, tag, rating and AI/human tagging; read or replace the tags on a comment
niotio metricsAccount-wide NPS
niotio usageSurvey email usage this month
niotio help [topic]Built-in help (EN/DA)
Example: create → seed → read → clean up
id=$(niotio campaign create --name "agent-$(date +%s)" --test --json | jq -r .id)
niotio campaign simulate "$id" --count 5 --yes
niotio campaign metrics "$id" --json
niotio campaign simulate-clear "$id" --yes
niotio campaign delete "$id" --yes

Every command supports --json. Destructive actions need --yes when non-interactive.

Comment tags: from the vocabulary to one tag on one comment

Tags are per account. tag create fills the vocabulary, tag add/tag remove touch one tag on one comment, and comment set-tags replaces the whole set. A tag can be created by a person or by the browser's AI; --source/--ai tell the two apart, and tag ai-remove removes only the model's assignments.

niotio tag list --source ai                 # tags the browser's model created
niotio tag create Pris --color '#0d6efd'    # 1-40 chars, unique per account
niotio tag add Pris --comment 431           # keep the comment's other tags
niotio comment list --tag Pris --max-rating 6
niotio comment tags 431                     # what is on it, and who applied it
niotio tag remove Pris --comment 431
niotio tag ai-remove --yes                  # drop AI assignments, keep human work

The same capability exists in the API (/api/comment-tags, /api/comments) and in the MCP server (comment_tags_*, comments_*) — same rules, same data. A viewer can read tags but not set them; a stranger gets 404.

Follow-up cases: from detractor to closed case

A low score opens a case automatically (0–6 always; 7–8 when the campaign opts in). From the terminal you can read the inbox, assign, note and close with an outcome — exactly like the web inbox. Needs Pro or above, with the campaign owner's follow-up cases switch on.

niotio case counts                          # open / overdue / mine / unassigned
niotio case list                            # my open cases
niotio case list --assignee unassigned      # the queue nobody owns yet
niotio case show 367                        # respondent, rating, comment, due date
niotio case note 367 --text "called them; sending a credit note"
niotio case assign 367 --user 3             # or --unassign
niotio case status 367 RESOLVED --outcome RETAINED

The same capability exists in the API (/api/cases) and in the MCP server (cases_* tools) — same rules, same data. With follow-up cases switched off, the server answers 403 followup_cases_disabled.