The Ultimate Developer API Guide
This document is the official, exhaustive API reference for the entire Chirps AI platform. We have mapped out every developer-safe endpoint across the system. You can programmatically replicate 100% of the dashboard's functionality headlessly.
1. Authentication & Core Principles
Base URL: https://chirps.cc
All API endpoints require a Chirps API Key in the Authorization header. You can generate an API key from the API Manager in the Developer section of your dashboard.
Authorization: Bearer <YOUR_CHIRPS_API_KEY>
Example Request:
curl -X GET https://chirps.cc/api/billing/usage \ -H "Authorization: Bearer <YOUR_CHIRPS_API_KEY>" \ -H "Content-Type: application/json"
Standard Error Handling
| Status Code | Description |
|---|---|
200 OK | The request was successful. |
400 Bad Request | JSON payload failed validation. Includes a details array. |
401 Unauthorized | Missing or expired token. |
402 Payment Required | The workspace has hit billing limits. |
403 Forbidden | The user does not have the required RBAC permissions. |
404 Not Found | The requested resource does not exist. |
500 Server Error | Unexpected platform error. |
2. Assistant Lifecycle (Creation)
GET /api/assistants
List Assistants
Fetches a list of all assistants associated with the API key's workspace.
Create an Assistant
POST /api/assistants
Creates a new assistant with all base configurations.
{
"businessName": "Acme Corp",
"businessUrl": "https://acme.com",
"knowledgeBaseType": "both",
"knowledgeBaseUrl": "https://acme.com/help",
"knowledgeBaseText": "Raw text content of a document...",
"knowledgeBaseFileName": "company_handbook.pdf",
"language": "en",
"isMultiLanguage": false,
"tonePersonality": "professional",
"isCustomPersonality": false,
"supportEmail": "[email protected]",
"maxPages": 5,
"maxDepth": 2,
"welcomeMessageDelay": 2
}| Parameter | Type | Required | Description |
|---|---|---|---|
businessName | String | Yes | Name of the business (2-100 characters). |
businessUrl | String | Yes | Valid URL of the business website (max 500 chars). |
knowledgeBaseType | Enum | Yes | One of: "url", "document", "both", "none". |
knowledgeBaseUrl | String | No | Must be provided if type is "url" or "both". |
knowledgeBaseText | String | No | Raw text if type is "document" or "both". |
knowledgeBaseFileName | String | No | Name of the uploaded file if providing text. |
language | String | Yes | Language code (e.g., "en", "es"). |
isMultiLanguage | Boolean | No | Enable automatic translation. Default false. |
tonePersonality | String | Yes | E.g., "professional", "friendly". Max 100 chars. |
isCustomPersonality | Boolean | No | Enable custom tone. Default false. |
customPersonalityDescription | String | No | Custom tone instructions if enabled (max 2000 chars). |
additionalInstructions | String | No | Core prompt instructions (max 10000 chars). |
supportEmail | String | Yes | Valid email address for escalation. |
maxPages | Number | No | Pages to crawl. Min 1, Max 100. Default 5. |
maxDepth | Number | No | Crawl depth. Min 1, Max 20. Default 2. |
welcomeMessageDelay | Number | No | Delay in seconds before greeting. Min 0, Max 6. Default 2. |
Delete Assistant
DELETE /api/assistants/:id
Permanently deletes the assistant and cascadingly deletes all its knowledge nodes and history. No payload required.
3. Assistant Analytics & Stats
Immediately after creation and usage, you can programmatically fetch the assistant's performance metrics.
GET /api/analytics/overview?assistantId=uuid&range=30
Fetch usage statistics, total messages, leads captured, and general engagement metrics for the specified assistant. The range parameter is optional (number of days, min 7, max 365, default 30).
Expected Response
{
"totalConversations": 1245,
"totalMessages": 8420,
"totalLeads": 156,
"totalBookings": 42,
"satisfactionRate": 94,
"avgMessagesPerSession": 6.7,
"avgSessionsPerDay": 41.5,
"liveNow": 3,
"onlineNow": 12,
"dailySeries": [
{
"date": "2026-07-15",
"conversations": 45,
"messages": 310,
"leads": 5,
"bookings": 2
}
],
"agentStats": [
{
"name": "Jane Doe",
"messagesSent": 120,
"csat": 98
}
]
}| Property | Type | Description |
|---|---|---|
totalConversations | Number | Total number of chat sessions handled by the assistant. |
totalMessages | Number | Total number of messages (user + AI) sent across all conversations. |
totalLeads | Number | Total number of unique leads (name, email, phone) extracted. |
totalBookings | Number | Total number of calendar appointments successfully booked. |
satisfactionRate | Number | Percentage (0-100) of positive feedback ratings out of total ratings. |
avgMessagesPerSession | Number | Average number of messages exchanged per conversation. |
avgSessionsPerDay | Number | Average number of conversations per day within the requested range. |
liveNow | Number | Number of active conversations currently taken over by a human agent. |
onlineNow | Number | Number of users actively chatting with the AI within the last 2 minutes. |
dailySeries | Array | Array of daily objects containing counts for conversations, messages, leads, and bookings per date. |
agentStats | Array | Performance metrics for human agents, including messagesSent and csat (Customer Satisfaction score). |
4. Knowledge & Training
Once an assistant is created, you manage its brain via "Knowledge Nodes". Each node represents a chunk of data (a crawled URL, an uploaded document, or a manual text snippet).
Managing Knowledge Nodes
GET /api/assistants/:id/nodes - List all knowledge nodes for this assistant.
POST /api/assistants/:id/nodes - Manually inject a new knowledge block.
{
"title": "Return Policy",
"refined_content": "We offer a 30-day return policy for all unused items...",
"type": "text",
"metadata": {}
}PATCH /api/assistants/:id/nodes/:nodeId - Modify an existing node's content or toggle its active state.
{
"title": "Updated Return Policy",
"refined_content": "We offer a 60-day return policy now...",
"is_active": true
}DELETE /api/assistants/:id/nodes/:nodeId - Delete a knowledge block entirely.
POST /api/assistants/:id/nodes/:nodeId/re-crawl - Force the scraper to re-crawl the URL associated with this node and update its content. Payload: {}.
AI Training
POST /api/assistants/:id/train - Compile all is_active knowledge nodes and use an AI orchestrator to dynamically synthesize a new Master System Prompt. Payload: {}.
5. Widget Appearance & Config
Customize the frontend UI of the assistant bubble and chat window.
Update Widget Appearance
PATCH /api/assistants/:id/widget-config
{
"primaryColor": "#000000",
"position": "bottom-right",
"language": "en",
"welcomeMessage": "Hi! How can I help you today?",
"title": "Acme Support",
"theme": "light",
"fontFamily": "default",
"bubbleStyle": "circle",
"bubbleText": "Chat with us",
"headerSubtitle": "We typically reply instantly",
"inputPlaceholder": "Type your message...",
"privacyPolicyUrl": "https://acme.com/privacy",
"voiceEnabled": true,
"voiceName": "Fenrir",
"welcomeMessageDelay": 2,
"fileUploadEnabled": true,
"dictationEnabled": true,
"copilotEnabled": true,
"welcomeSuggestions": ["Pricing plans", "Contact sales"],
"pageVisibility": {
"mode": "all",
"paths": []
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
primaryColor | String | No | Hex color code (e.g., "#000000"). |
position | Enum | No | "bottom-right", "bottom-left", "top-right", "top-left". |
language | String | No | Widget language code (e.g., "en", "fr"). |
welcomeMessage | String | No | The initial greeting message. |
title | String | No | The title in the widget header. |
theme | Enum | No | "light" or "dark". |
fontFamily | Enum | No | "default" (Inter) or "inherit". |
bubbleStyle | Enum | No | "circle", "bar", "drawer", "branded-circle", "branded-bar", "branded-drawer". |
bubbleText | String | No | Text to display next to the bubble (for bar/drawer styles). |
headerSubtitle | String | No | Subtitle in the widget header. |
inputPlaceholder | String | No | Placeholder text for the message input. |
privacyPolicyUrl | String | No | URL to your privacy policy. |
avatarUrl | String | No | URL to custom avatar image. |
customLogoUrl | String | No | URL to custom header logo image. |
voiceEnabled | Boolean | No | Enable voice calling. |
voiceName | String | No | The voice identity for audio responses. See available voices below. |
welcomeMessageDelay | Number | No | Delay in seconds before greeting. |
fileUploadEnabled | Boolean | No | Allow users to upload attachments. |
dictationEnabled | Boolean | No | Enable voice dictation (speech-to-text). |
copilotEnabled | Boolean | No | Enable copilot suggestion chips. |
welcomeSuggestions | Array | No | Array of strings for initial quick reply chips. |
pageVisibility | Object | No | Determines which pages the widget appears on (mode, paths). |
rateLimitEnabled | Boolean | No | Enable chat rate limiting. Default true. |
rateLimitMaxMessages | Number | No | Max messages in window. Default 30. |
rateLimitTimeWindow | Number | No | Time window in minutes. Default 60. |
gdprDataMaskingEnabled | Boolean | No | Mask PII before saving. Default false. |
Available Voice Names
- Female:
Zephyr,Aoede,Kore,Leda,Callirrhoe,Despina,Erinome,Laomedeia,Achernar,Pulcherrima,Gacrux,Algenib,Sulafat - Male:
Puck,Charon,Fenrir,Orus,Enceladus,Iapetus,Umbriel,Algieba,Autonoe,Rasalgethi,Alnilam
Custom Logo
POST /api/assistants/:id/widget-logo
Format: multipart/form-data with file field.
6. Integration & Deployment
Once your assistant is configured and trained, you have two primary ways to deploy it:
Option A: Web Embed (Frontend)
The easiest way to integrate the assistant into a standard website (WordPress, Shopify, React, etc.). The embed code is purely deterministic. You do not need an endpoint to fetch it. Just drop this in the <head> of your site:
<script src="https://chirps.cc/widget.js" data-assistant-id="YOUR_ASSISTANT_ID_HERE"></script>
Option B: Headless Integrations (Backend / CRMs / Bots)
If you are building a custom client (like a Discord bot, a Telegram integration, or a native iOS app), you will NOT use the Web Embed. Instead, you will interact directly with the /api/chat endpoint.
POST /api/chat or /api/chat?stream=true
Note: This endpoint is public and does *not* require the Authorization: Bearer API Key header. Authentication is handled implicitly via the assistantId.
{
"assistantId": "123e4567-e89b-12d3-a456-426614174000",
"sessionId": "unique-session-id-for-user",
"conversationId": "optional-uuid",
"message": "Hello, I need help with my billing."
}*(Also supports multipart/form-data with a file field for attachments if fileUploadEnabled is true).*
| Parameter | Type | Required | Description |
|---|---|---|---|
assistantId | String | Yes | The UUID of the assistant. |
sessionId | String | Yes | You generate this. A unique identifier from your own system to group the chat history (e.g., a Discord User ID, a Telegram Chat ID, or a random UUID). |
message | String | Yes | The text content of the message (max 5000 chars). |
conversationId | String | No | The UUID of the conversation (returned in your first request). |
id | String | No | Optional client-side message ID to prevent deduplication. |
Mode 1: Standard JSON Response (Default)
By sending a POST request to /api/chat (without the stream parameter), you wait for the full AI response and receive a standard JSON object.
{
"message": "Here is the information you requested...",
"conversationId": "uuid-of-conversation",
"messageId": "uuid-of-message"
}*(If is_active_agent: true is returned, a human has taken over the chat, and message will be null.)*
Mode 2: Server-Sent Events Streaming (?stream=true)
By appending ?stream=true to the URL, you receive a real-time Server-Sent Events (SSE) stream. Your code should listen for these specific event types:
- `event: token`: Contains
{"text": "chunk"}. Fired for each chunk of the AI's response text. - `event: status`: Contains
{"text": "Searching knowledge base..."}. Represents backend tool execution states. - `event: done`: Contains
{"messageId": "uuid", "conversationId": "uuid", "message": "full text"}. Fired when generation is completely finished. - `event: error`: Contains
{"error": "Error message"}. Fired if rate limits or errors occur.
Live Takeover Endpoints
GET /api/chat/sessions
Retrieve historical sessions.
POST /api/chat/toggle-agent
Pause AI for human takeover. Payload: { "sessionId": "..." }
POST /api/chat/agent-message
Send human message. Payload: { "sessionId": "...", "message": "..." }
7. Advanced Assistant Settings
PATCH /api/assistants/:id
Update Core Configuration
Modify the core settings, persona, and scraping bounds of the assistant.
{
"business_name": "Acme Corp",
"business_url": "acme.com",
"business_description": "We sell anvils.",
"system_prompt": "You are a helpful assistant.",
"language": "en",
"tone_personality": "Friendly",
"support_email": "[email protected]",
"additional_instructions": "Never mention the Roadrunner.",
"is_multi_language": true,
"is_dev_mode": false,
"is_active": true,
"max_pages": 15,
"max_depth": 2,
"widget_config_merge": {
"rateLimitEnabled": true
}
}*Note: All fields are optional. Only send the fields you want to update.*
Delete Assistant
DELETE /api/assistants/:id
Permanently deletes the assistant and cascades deletion to all knowledge nodes, conversations, and messages. If the assistant was never fully set up, this refunds the monthly creation quota.
8. Telephony & Voice
GET /api/phone-numbers - List available numbers.
POST /api/phone-numbers/:id/assign - Provision a number. Payload: {}
POST /api/assistants/:id/outbound - Trigger outbound call. Payload: { "to": "+123...", "message": "..." }
9. Leads Extraction
GET /api/leads?assistantId=uuid&page=1&limit=50&status=new - Fetch paginated, structured leads the AI extracted during conversations.
GET /api/leads?id=leadId - Fetch details of a single lead, including the full conversation transcript.
10. Bookings & Calendar
GET /api/bookings?assistantId=uuid&start=ISO-8601&end=ISO-8601 - Retrieve calendar appointments scheduled by the assistant, optionally filtered by date.
GET /api/bookings?id=bookingId - Fetch details of a single booking, including the conversation transcript.
POST /api/bookings/cancel - Cancel an active booking. Payload: { "bookingId": "uuid" }
POST /api/bookings/reschedule - Adjust a booking. Payload: { "bookingId": "uuid", "newTime": "ISO-8601" }
11. Account & Billing Usage
GET /api/billing/usage
Retrieve the workspace's billing cycle usage, subscription plan limits, and total assistant count. Note: When using an API Key, the request is automatically scoped to the API Key's workspace; you do not need to provide a teamId.
Response (`200 OK`):
{
"planName": "Pro",
"periodStr": "2023-10-01",
"assistantCount": 3,
"usage": {
"message_count": 1450,
"harvest_count": 12,
"recrawl_count": 5,
"train_count": 2,
"assistants_created_count": 1,
"voice_minutes_used": 0,
"sms_count": 0,
"email_count": 0,
"whatsapp_count": 0
},
"limits": {
"messages": 5000,
"assistants": 5,
"training": 50,
"recrawls": 20
},
"workspaceOwnerId": "uuid"
}Launch your assistant
in 10 minutes.
Sign up, train on your site, customize alerts, and embed on your website.