Management API & MCP
Configure widgets, content and support settings from your own code — or let an AI assistant do it over MCP. Same API the dashboard uses, same permissions.
The Management API is the same REST API the dashboard itself uses, opened up with a token so your developers can script it. The MCP server exposes those same capabilities over the Model Context Protocol, so an AI assistant can configure a widget by conversation instead of you hunting through the builder.
search_widget_settings tool finds one by what it does — “stop the button covering my cookie banner” — and hands back the exact field name to change.Management tokens
Tokens are minted in Settings → API Keys → Management tokens, or via the API below. A token's scopes are the same permission strings your roles are built from — agents:edit, kb:create, help-centers:content — so there is no second permission system to learn.
widget-setuppresetConfigure widgets end to end, plus the content and knowledge they use.
content-editorpresetWrite and publish help articles, KB documents and canned replies.
support-opspresetWork tickets and conversations, manage departments and tags.
read-onlypresetSee everything the creator can see, change nothing.
full-accesspresetMirror the creator's own permissions.
Two rules that always hold
- A token can never exceed the person who created it. Scopes are intersected with the creator's live permissions on every request — not frozen at creation. Demote that person and their tokens are downgraded on the next call.
- A token can be pinned to specific widgets. Set
agentIdsand the token sees and edits only those widgets. Omit it for the whole organization.
Minting a token
curl -X POST "https://api.nextcap.ai/api/v1/management-tokens" \-H "Authorization: Bearer YOUR_DASHBOARD_JWT" \-H "Content-Type: application/json" \-d '{"name": "Widget setup for Acme","preset": "widget-setup","expiresInDays": 90}'
Requesting a scope you do not hold yourself is refused rather than quietly narrowed:
{"code": "SCOPE_EXCEEDS_CREATOR","message": "A token cannot be given permissions you do not have yourself.","permissions": ["billing:manage"]}
Using the Management API
Every management endpoint accepts a token in place of a session. Paths, bodies and responses are identical — this is the same API the dashboard calls, not a parallel one. Covered surfaces include widgets, knowledge bases and documents, help centres and articles, departments, tickets, tags, quick replies, forms, conversations, leads, analytics, and the Telegram / WhatsApp / Instagram channels.
# List widgetscurl "https://api.nextcap.ai/api/v1/agents" \-H "Authorization: Bearer nextcap_mk_YOUR_TOKEN"# Move the launcher up so it clears a cookie bannercurl -X PATCH "https://api.nextcap.ai/api/v1/agents/WIDGET_ID" \-H "Authorization: Bearer nextcap_mk_YOUR_TOKEN" \-H "Content-Type: application/json" \-d '{ "launcherOffsetY": 96 }'
Connecting an AI assistant (MCP)
The MCP endpoint is https://api.nextcap.ai/api/v1/mcp over Streamable HTTP, authenticated with the same token.
claude mcp add nextcap --transport http https://api.nextcap.ai/api/v1/mcp \--header "Authorization: Bearer nextcap_mk_YOUR_TOKEN"
Tools
list_widgetsagents:viewEvery widget with its id, name and status.
get_widgetagents:viewFull configuration for one widget. Pass fields to narrow the response.
search_widget_settings—Find a setting by what it does, in plain language. Returns the exact field name.
update_widgetagents:editChange settings. Previews by default — pass dryRun: false to apply.
list_knowledge_baseskb:viewKnowledge bases and the widgets that use them.
list_departmentsdepartments:viewSupport departments.
call_management_apiinheritedAny Management API endpoint, for anything the dedicated tools do not cover.
Changes are previewed before they are written
update_widget runs as a dry run unless you explicitly pass dryRun: false. A dry run reads the current values, returns a field-by-field diff, and writes nothing.
{"applied": false,"note": "Nothing was written. Show this diff to the user, then call again with dryRun: false.","changes": [{ "field": "launcherOffsetY", "from": 20, "to": 96, "unchanged": false }],"willChange": 1}
Unknown field names are rejected with a suggestion rather than silently ignored:
Unknown setting(s): launcherOffset (did you mean "launcherOffsetY"?).Use search_widget_settings to find the right field name.
Errors
401—Token missing, invalid, expired, revoked — or its creator was deleted or disabled.
403TOKEN_ROUTE_NOT_EXPOSEDThis endpoint is not part of the Management API.
403TOKEN_ROUTE_DENIEDThis endpoint is deliberately dashboard-only.
403SCOPE_EXCEEDS_CREATORA requested scope exceeds the creator's own permissions.
403WIDGET_SCOPE_EXCEEDS_CREATORA requested widget scope exceeds the creator's widget access.
429—The token's rateLimitRpm was exceeded.
isError: true and the message intact, so the assistant can read the reason and correct itself.