Developer API
Developer API

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.

Developer API

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.

http
Authorization: Bearer <YOUR_CHIRPS_API_KEY>

Example Request:

bash
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 CodeDescription
200 OKThe request was successful.
400 Bad RequestJSON payload failed validation. Includes a details array.
401 UnauthorizedMissing or expired token.
402 Payment RequiredThe workspace has hit billing limits.
403 ForbiddenThe user does not have the required RBAC permissions.
404 Not FoundThe requested resource does not exist.
500 Server ErrorUnexpected platform error.
Developer API

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.

json
{

  "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
}
ParameterTypeRequiredDescription
businessNameStringYesName of the business (2-100 characters).
businessUrlStringYesValid URL of the business website (max 500 chars).
knowledgeBaseTypeEnumYesOne of: "url", "document", "both", "none".
knowledgeBaseUrlStringNoMust be provided if type is "url" or "both".
knowledgeBaseTextStringNoRaw text if type is "document" or "both".
knowledgeBaseFileNameStringNoName of the uploaded file if providing text.
languageStringYesLanguage code (e.g., "en", "es").
isMultiLanguageBooleanNoEnable automatic translation. Default false.
tonePersonalityStringYesE.g., "professional", "friendly". Max 100 chars.
isCustomPersonalityBooleanNoEnable custom tone. Default false.
customPersonalityDescriptionStringNoCustom tone instructions if enabled (max 2000 chars).
additionalInstructionsStringNoCore prompt instructions (max 10000 chars).
supportEmailStringYesValid email address for escalation.
maxPagesNumberNoPages to crawl. Min 1, Max 100. Default 5.
maxDepthNumberNoCrawl depth. Min 1, Max 20. Default 2.
welcomeMessageDelayNumberNoDelay 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.

Developer API

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

json
{

  "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
    }
  ]
}
PropertyTypeDescription
totalConversationsNumberTotal number of chat sessions handled by the assistant.
totalMessagesNumberTotal number of messages (user + AI) sent across all conversations.
totalLeadsNumberTotal number of unique leads (name, email, phone) extracted.
totalBookingsNumberTotal number of calendar appointments successfully booked.
satisfactionRateNumberPercentage (0-100) of positive feedback ratings out of total ratings.
avgMessagesPerSessionNumberAverage number of messages exchanged per conversation.
avgSessionsPerDayNumberAverage number of conversations per day within the requested range.
liveNowNumberNumber of active conversations currently taken over by a human agent.
onlineNowNumberNumber of users actively chatting with the AI within the last 2 minutes.
dailySeriesArrayArray of daily objects containing counts for conversations, messages, leads, and bookings per date.
agentStatsArrayPerformance metrics for human agents, including messagesSent and csat (Customer Satisfaction score).
Developer API

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.

json
{

  "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.

json
{

  "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: {}.

Developer API

5. Widget Appearance & Config

Customize the frontend UI of the assistant bubble and chat window.

Update Widget Appearance

PATCH /api/assistants/:id/widget-config

json
{

  "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": []
  }
}
ParameterTypeRequiredDescription
primaryColorStringNoHex color code (e.g., "#000000").
positionEnumNo"bottom-right", "bottom-left", "top-right", "top-left".
languageStringNoWidget language code (e.g., "en", "fr").
welcomeMessageStringNoThe initial greeting message.
titleStringNoThe title in the widget header.
themeEnumNo"light" or "dark".
fontFamilyEnumNo"default" (Inter) or "inherit".
bubbleStyleEnumNo"circle", "bar", "drawer", "branded-circle", "branded-bar", "branded-drawer".
bubbleTextStringNoText to display next to the bubble (for bar/drawer styles).
headerSubtitleStringNoSubtitle in the widget header.
inputPlaceholderStringNoPlaceholder text for the message input.
privacyPolicyUrlStringNoURL to your privacy policy.
avatarUrlStringNoURL to custom avatar image.
customLogoUrlStringNoURL to custom header logo image.
voiceEnabledBooleanNoEnable voice calling.
voiceNameStringNoThe voice identity for audio responses. See available voices below.
welcomeMessageDelayNumberNoDelay in seconds before greeting.
fileUploadEnabledBooleanNoAllow users to upload attachments.
dictationEnabledBooleanNoEnable voice dictation (speech-to-text).
copilotEnabledBooleanNoEnable copilot suggestion chips.
welcomeSuggestionsArrayNoArray of strings for initial quick reply chips.
pageVisibilityObjectNoDetermines which pages the widget appears on (mode, paths).
rateLimitEnabledBooleanNoEnable chat rate limiting. Default true.
rateLimitMaxMessagesNumberNoMax messages in window. Default 30.
rateLimitTimeWindowNumberNoTime window in minutes. Default 60.
gdprDataMaskingEnabledBooleanNoMask 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.

Developer API

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:

json
<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.

json
{

  "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).*

ParameterTypeRequiredDescription
assistantIdStringYesThe UUID of the assistant.
sessionIdStringYesYou 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).
messageStringYesThe text content of the message (max 5000 chars).
conversationIdStringNoThe UUID of the conversation (returned in your first request).
idStringNoOptional 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.

json
{

  "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": "..." }

Developer API

7. Advanced Assistant Settings

PATCH /api/assistants/:id

Update Core Configuration

Modify the core settings, persona, and scraping bounds of the assistant.

json
{

  "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.

Developer API

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": "..." }

Developer API

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.

Developer API

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" }

Developer API

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`):

json
{

  "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"
}
Ready to start?

Launch your assistant
in 10 minutes.

Sign up, train on your site, customize alerts, and embed on your website.