API reference
The two APIs behind AgentPro: the widget API and the dashboard API.
Base URL
https://agentpro.chat/api/v1All paths below are relative to this base. Requests and responses are JSON unless noted; errors return { error, message } with a matching HTTP status (400 validation, 401 authentication, 403 forbidden, 404 not found, 429 rate limited).
Widget API
Authentication
Each agent has its own widget API key, starting with cbp_. Find it in the agent's Embed tab (or rotate it there). Send it on every request as the X-API-Key header. The key only works while the agent is Active and, if you configured allowed domains, from pages on those domains.
curl -X POST "https://agentpro.chat/api/v1/widget/chat" \
-H "X-API-Key: cbp_YOUR_WIDGET_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "message": "How do I track my order?", "visitorId": "visitor-123" }'Endpoints
/widget/configAgent name, status, welcome and fallback messages, colours, position, pre-chat form flags, business hours and the active theme.
/widget/chatSend a visitor message and receive the AI reply.
Body: { message (1–2000 chars), conversationId?, visitorId?, visitorToken?, pageUrl?, pageTitle?, referrer?, utmSource?, utmMedium?, utmCampaign? }. Response: { conversationId, visitorMessageId, messageId, timestamp, response, citations[], handoff }. When a human agent has taken over, response is null and handoff is true; poll the messages endpoint for their reply.
/widget/conversations/:id/messagesPoll a conversation for new messages (how the widget sees agent replies).
Query: after? (ISO date), visitorId?. Response: { conversationId, aiEnabled, status, messages[] } with up to 50 messages, each { id, senderType, content, createdAt, sources }.
/widget/conversations/:id/visitorAttach visitor details captured by your own form.
Body: { visitorId?, visitorName?, visitorEmail?, visitorPhone? }. Response: { conversationId, visitor }.
/uploadUpload attachments (multipart/form-data, one or more files plus an optional conversationId field).
Accepts X-API-Key or a dashboard bearer token. Files up to 10 MB, common document and image types only. Response: { urls[], conversationId }. Limited to 60 uploads per hour per IP.
Example response from POST /widget/chat
{
"conversationId": "7f1a9c2e-...-...",
"visitorMessageId": "c0ffee00-...-...",
"messageId": "a1b2c3d4-...-...",
"timestamp": "2026-10-13T09:15:02.000Z",
"response": "You can track your order from the Orders page...",
"citations": [{ "title": "Shipping FAQ", "url": "https://example.com/faq#shipping" }],
"handoff": false
}Reuse conversationId on the next call to keep the thread; the server rebuilds the history itself and never trusts history sent by the browser.
Dashboard API
Authentication
The dashboard API is what the AgentPro dashboard itself uses. Sign in with POST /auth/login to receive a short-lived accessToken and a refreshToken; send the access token as a Bearer header and exchange the refresh token at POST /auth/refresh when it expires. Every route is scoped to the organisation of the signed-in user.
curl -X POST "https://agentpro.chat/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{ "email": "you@company.com", "password": "..." }'
curl "https://agentpro.chat/api/v1/chatbots" \
-H "Authorization: Bearer ACCESS_TOKEN"Authentication
/auth/loginBody { email, password } → { accessToken, refreshToken, user }.
/auth/refreshBody { refreshToken } → new token pair.
/auth/meThe signed-in user and organisation.
/auth/logoutInvalidate the refresh token.
Agents
/chatbotsList agents. Query: page, limit, search.
/chatbotsCreate. Body includes name, welcomeMessage, language, tone, aiModelId, temperature, maxTokens, systemPrompt.
/chatbots/:idOne agent.
/chatbots/:idUpdate any writable field.
/chatbots/:idDelete the agent and its data.
/chatbots/:id/embed-codeThe widget snippet with this agent’s API key.
/chatbots/:id/regenerate-keyRotate the widget API key.
/chatbots/:id/statsTotals, active conversations, average messages per conversation, average response time, top intents.
/chatbots/:id/test-chatSend a test message without creating a visitor conversation.
Knowledge
/chatbots/:chatbotId/knowledgeList entries. Query: page, limit, type (TEXT|URL|FILE), status (PENDING|PROCESSING|ACTIVE|FAILED).
/chatbots/:chatbotId/knowledgeCreate. JSON { type: "TEXT"|"URL", title, content?, sourceUrl? } or multipart/form-data with a file field.
/chatbots/knowledgeAll entries across the organisation (same query parameters).
/chatbots/knowledge/:idOne entry.
/chatbots/knowledge/:id/chunksIndexed chunks. Query: page, limit, q, pageUrl.
/chatbots/knowledge/:idUpdate title, content or sourceUrl (re-indexes).
/chatbots/knowledge/:id/reprocessRe-crawl or re-index.
/chatbots/knowledge/:idDelete the entry and its chunks.
Conversations and messages
/chatbots/:chatbotId/conversationsList. Query: page, limit, status, channelType, assignedAgentId.
/chatbots/:chatbotId/conversations/statsCounts by status for one agent.
/chatbots/conversations/:idOne conversation with its messages.
/chatbots/conversations/:idUpdate status, priority, tags or assignment.
/chatbots/conversations/:idDelete a conversation.
/conversations/:conversationId/messagesMessages of a conversation.
/messagesAppend a message to a conversation.
Inbox (all agents)
/inbox/conversationsOrganisation-wide conversation list with filters and search.
/inbox/statsOpen, pending, resolved and unassigned counts.
/inbox/conversations/:idOne conversation with messages and visitor details.
/inbox/conversations/:id/messagesReply as an agent. Body { content, isInternalNote? }.
/inbox/conversations/:id/aiPause or resume AI replies. Body { enabled }.
/inbox/conversations/:id/assignAssign to an agent. Body { agentId }.
/inbox/conversations/:id/statusBody { status }.
/inbox/conversations/:id/readMark as read.
/inbox/canned-responsesSaved replies (also POST, PUT /:id, DELETE /:id).
Analytics
/analytics/organizationTotals and per-day series for the whole organisation. Query: startDate, endDate.
/analytics/trendsConversations and messages per day. Query: days (default 7), chatbotId.
/analytics/channelsConversations by channel. Query: chatbotId.
/analytics/usageUsage for a month. Query: month=YYYY-MM.
/analytics/tokens/pricingModel price list (per 1K tokens) for the models your plan can use.
Channels (/channels), team (/team), notifications (/notifications) and billing (/subscription) follow the same pattern. Billing changes require the Owner or Admin role.
Rate limits
| Scope | Limit |
|---|---|
| All endpoints | 300 requests per minute per IP address |
| POST /widget/chat | 30 requests per minute per API key and IP, plus the per-agent messages-per-minute limit set in the agent settings |
| POST /upload | 60 uploads per hour per IP |
| POST /auth/login | 10 attempts per 15 minutes per IP |
| POST /auth/register | 5 per hour per IP |
| Password reset and invite acceptance | 5–10 per 15 minutes per IP |
Limited requests return HTTP 429 with a message saying when to retry. Limits are the same on every plan.
Questions about the API?
Tell us what you are building and we will point you at the right endpoints.