Next CapNext Cap

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.

A widget has around 125 settings. The MCP server's 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-setuppreset

Configure widgets end to end, plus the content and knowledge they use.

content-editorpreset

Write and publish help articles, KB documents and canned replies.

support-opspreset

Work tickets and conversations, manage departments and tags.

read-onlypreset

See everything the creator can see, change nothing.

full-accesspreset

Mirror 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 agentIds and the token sees and edits only those widgets. Omit it for the whole organization.
Regardless of scopes, tokens can never create or revoke API keys, change team membership or roles, touch billing or two-factor settings, or delete the organization. Those stay dashboard-only so a leaked token cannot escalate itself.

Minting a token

POST/management-tokensJWT

Requires the settings:api-keys permission. The raw token is returned exactly once.

namestringrequired

Label shown in the dashboard. Max 80 characters.

presetstring

One of the presets above. Use instead of scopes.

scopesstring[]

Explicit permission list, if you would rather not use a preset.

agentIdsstring[] | null

Widgets this token may touch. Omit or send null for all.

allowedIpsstring[]

CIDR allowlist. Empty allows any IP.

rateLimitRpmnumber

Requests per minute. Defaults to 600.

expiresInDaysnumber

7, 30, 90, 180, 365, or 0 for never.

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"]
}
GET/management-tokensJWT

List your organization's management tokens. Never returns the secret.

GET/management-tokens/scopesJWT

Presets plus every permission, each flagged with whether you can delegate it.

DELETE/management-tokens/:idJWT

Revoke a token immediately.

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 widgets
curl "https://api.nextcap.ai/api/v1/agents" \
-H "Authorization: Bearer nextcap_mk_YOUR_TOKEN"
# Move the launcher up so it clears a cookie banner
curl -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 }'
Every write is recorded in the audit log with the token's name as the actor, so Settings → Audit log shows exactly what a token changed and when.

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"
ChatGPT and the claude.ai web connector require OAuth rather than a bearer header and are not supported yet. Clients that accept a header — Claude Code, Claude Desktop, Cursor, VS Code and most others — work today.

Tools

list_widgetsagents:view

Every widget with its id, name and status.

get_widgetagents:view

Full 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:edit

Change settings. Previews by default — pass dryRun: false to apply.

list_knowledge_baseskb:view

Knowledge bases and the widgets that use them.

list_departmentsdepartments:view

Support departments.

call_management_apiinherited

Any 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_EXPOSED

This endpoint is not part of the Management API.

403TOKEN_ROUTE_DENIED

This endpoint is deliberately dashboard-only.

403SCOPE_EXCEEDS_CREATOR

A requested scope exceeds the creator's own permissions.

403WIDGET_SCOPE_EXCEEDS_CREATOR

A requested widget scope exceeds the creator's widget access.

429

The token's rateLimitRpm was exceeded.

MCP tool failures come back as a normal tool result with isError: true and the message intact, so the assistant can read the reason and correct itself.