Next CapNext Cap
API Documentation

Documentation

Next Cap Documentation

Everything you need to install the chat widget, integrate with your CRM, and pull data into your own systems.

Next Cap is a chat widget plus a set of integration APIs. The widget is one drop-in script tag that you paste into your website — everything about how it looks and behaves is configured from the dashboard. The APIs are how you pull conversations, leads, and tickets into your own systems, or push live-chat replies and ticket updates back from your CRM.

API Base URL

https://api.nextcap.ai/api/v1

Authentication

Next Cap issues two kinds of keys. Use the right one for the right job — putting the wrong key in client-side code can leak your entire organization's data.

Publishable widget keyBrowser-safe

Production keys (pk_live_) and development keys (pk_dev_) belong in the widget's data-api-key attribute. They are designed to be public — they only authorize the widget to load itself and start chats, never to read your data. Lock them down to your own domains in Settings → Widget → Allowed Domains.

<!-- Drop into your website to install the widget -->
<script
src="https://api.nextcap.ai/widget/loader.js"
data-api-key="pk_live_your_publishable_key"
defer
></script>
Secret server keyServer-only

Data API keys (sk_live_) and CRM integration keys (nextcap_ck_) grant full read or read/write access to your organization's leads, conversations, and tickets. Never put these in HTML, JavaScript bundles, mobile apps, or anywhere a visitor can see them. Use them only from your own backend, and store them in environment variables — never in source control.

# Server-side only — NEVER ship this to a browser
curl -H "X-Api-Key: sk_live_your_secret_key" \
https://api.nextcap.ai/api/v1/external/leads

Response Format

All API responses are JSON. Single resources are returned under a data key. List endpoints add a meta envelope with pagination info. Errors return an HTTP error status and an error object — see Errors & Rate Limits for the full shape.

Single resource
GET /external/leads/:idjson
{
"data": {
"id": "uuid",
"email": "john@acme.com",
"name": "John Doe",
"company": "Acme Inc",
"source": "pre_chat_form",
"created_at": "2026-04-01T10:30:00.000Z"
}
}
Paginated list
GET /external/leadsjson
{
"data": [ ... ],
"meta": {
"page": 1,
"per_page": 20,
"total": 142,
"total_pages": 8
}
}