Download OpenAPI specification:Download
Welcome to Chat Data Guide and API Reference, Version 2.0.0!
Chat Data is a platform that allows you to create AI chatbots using your chosen data or data provided by the service. It offers the following features:
Integration: You can integrate a chat widget or iframe on your website by either providing any customized documents(.pdf, docs, html, txt), website links, plaintext or Q&As.
Language Compatibility: Chat Data is designed to work with multiple languages. You can use it with sources in any language and pose questions in any language as well.
User Analysis: The owner of the chatbot has the ability to monitor user activities on the chatbot. They can analyze user geographic distribution, track user activities.
Customer Information Gathering: When customers express interest in the owner's products or services, the chatbot can collect customer information. This allows the owner to gather valuable data for marketing and customer relationship management purposes.
Email Notifications: Chatbot owners can receive daily email notifications containing all chatbot conversations and collected leads
This reference serves as a comprehensive guide to the Chat Data system and its Version 2.0.0 API. Here, you'll find detailed information on the objects and endpoints used in the API. We greatly value your feedback. If you notice any missing or inaccurate information, please don't hesitate to email us at: admin@chat-data.com.
To leverage Chat Data's API capabilities, you'll need an API key. API keys can be created by subscribing to an appropriate membership plan on chat-data.com.
All API requests should be directed to the domain api.chat-data.com
. and secure HTTPS is mandatory for all interactions.
Our ChatDOC API adheres to RESTful conventions where applicable, utilizing standard HTTP methods such as GET, POST, PUT, and DELETE. Request and response payloads are encoded in JSON format.
HTTP status codes are used in accordance with industry standards. Successful requests return a 200 OK response, while failed requests produce 4xx or 5xx error codes.
If you have any questions or need further assistance, please don't hesitate to reach out to our support team.
Response body of success requests is generally as follows:
{
"status": "success",
"id": 160,
"name": "Bo",
...
}
status
is a common property.And failed response may be:
{
"status": "error",
"message": ""Error message""
}
status
and message
are common properties.Property names are in camelCase (not snake_case or kebab-case).
Optional properties are nullable, you can just ignore it sometimes.
To maintain a uniform developer experience for all API users, the Chat Data API enforces rate limits at 600 requests per minute (RPM). Requests from the same user are subject to the same rate limiter pool.
Requests use the HTTP Authorization
header to both authenticate and authorize operations. The Chat Data API accepts bearer tokens in this header. Bearer keys can be managed in the your account page.
curl 'https://api.chat-data.com/api/v2/{{endpoint}}' -H 'Authorization: Bearer $API_KEY'
Different keys of the same user are interoperable of each others' resource, they share common permission and rate limit of the user.
Please note: keep your API keys confidential, and do not put them in any client code, including browser html and mobile client, API interactions should be done on the server side.
Migrated to Creating Chatbot.
Migrated to Basic Configurations.
Migrated to Debug And Optimization.
Migrated to Webhooks Setup.
Migrated to Discord Bot Integration.
Migrated to Slack Bot Integration.
Migrated to WhatsApp Integration.
Migrated to Train With Your Data#Shopify.
Migrated to Add a Chatbot to Your Shopify Store.
Migrated to Shopify Webhook Synchronization Integration.
Migrated to Train With Your Data#WooCommerce.
Migrated to Add a Chatbot to Your WordPress Website.
Migrated to WooCommerce Webhook Synchronization Integration.
Migrated to White Label Your Chatbot.
Create a Chatbot using either our medical chat models, custom data upload, or a custom model. The default model is custom-data-upload
if not specified.
Available models:
custom-data-upload
: For training with your own data using GPT-4o-mini
, GPT-4o
or GPT-4.0
, Claude 3 Opus
, Claude 3.5 Sonnet
, Claude 3 Haiku
medical-chat-human
: For medical chat with humansmedical-chat-vet
: For medical chat with veterinarianscustom-model
: For using a custom modelFor custom-data-upload
model, you can provide training data using sourceText
or urlsToScrape
. These fields are ignored for other models.
You can also specify a custom backend URL and bearer token if you prefer to use your own backend.
You can poll the status of the training by GET /chatbot/status/{chatbotId}
at interval of 10s. Generally it takes 1-2 minutes to finish depending on content length of the provided text or websites.
Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/create-chatbot \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"chatbotName": "My Chatbot",
"sourceText": "Training text for the chatbot",
"urlsToScrape": [
"https://www.chat-data.com/api-reference",
"https://www.chat-data.com/privacy"
],
"model": "custom-data-upload"
}'
Note: The sourceText
and urlsToScrape
fields are subject to character limits based on your plan.
chatbotName required | string (Chatbot Name) The name of the chatbot to be created. |
sourceText | string (Source Text) Text data for the chatbot, subject to character limits based on your plan. Relevant only if the model is custom-data-upload. |
urlsToScrape | Array of strings (Urls To Scrape) A list of URLs is provided for text content extraction by Chat Data. Since it is not possible to ascertain the website's textual content in advance, the web crawling process will terminate when either the list of URLs is exhausted or when the chatbot's character limit is reached. We kindly request that you ensure your URLs commence with the |
Array of objects (Products for Training) A list of products for training the chatbot. | |
Array of objects (Q&As for Training) A list of Q&As for the chatbot to learn specific topic answers. | |
customBackend | string (Custom Backend) The URL of a customized backend for the chatbot, to be used if you prefer to use your own backend. |
bearer | string (Bearer) The authentication bearer token required to access and authenticate against your custom backend. |
model | string (Chatbot Model) Default: "custom-data-upload" Enum: "custom-data-upload" "medical-chat-human" "medical-chat-vet" "custom-model" The chatbot uses different models:
The chatbot defaults to |
{- "chatbotName": "string",
- "sourceText": "training text",
- "products": [
- {
- "id": "shopify_1234567",
- "information": {
- "id": "shopify_1234567",
- "name": "Fleece Drawstring Joggers",
- "color": "white"
}
}
], - "qAndAs": [
- {
- "question": "What is Chat Data?",
- "answer": "Chat Data is a platform that..."
}
], - "bearer": "string",
- "model": "custom-data-upload"
}
{- "chatbotId": "string",
- "consumedCharacters": 1000000,
- "remainingCharacters": 10000000,
- "dataSources": [
], - "status": "success"
}
The Chatbot Retrain API enables you to retrain an existing chatbot. This API is applicable for chatbots with the custom-data-upload
model. It allows you to update the chatbot's knowledge base with new information or remove existing data.
You can provide new training data through various methods:
sourceText
urlsToScrape
products
qAndAs
You can also remove specific knowledge chunks using the deletes
array.
Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/retrain-chatbot \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"chatbotId": "your_chatbot_id",
"sourceText": "New training data for the chatbot",
"urlsToScrape": ["https://www.example.com/new-content"],
"products": [
{
"id": "product_123",
"information": {
"name": "New Product",
"description": "Product description"
}
}
],
"qAndAs": [
{
"question": "What is the new feature?",
"answer": "The new feature is..."
}
],
"deletes": [
{
"type": "website",
"url": "https://www.example.com/old-content"
}
]
}'
Note: The amount of new data you can add is subject to character limits based on your plan.
chatbotId required | string (Chatbot ID) The unique identifier allocated to the chatbot. |
sourceText | string (Source Text) Text data intended for chatbot training. Subject to character limits based on the user's plan. Applicable only for models with custom data upload capability. |
urlsToScrape | Array of strings (URLs to Scrape) A list of URLs provided for text content extraction. The web crawling process concludes once the list of URLs is fully processed or the chatbot's character limit is reached. Please ensure URLs begin with 'http://' or 'https://'. Applicable only for models with custom data upload capability. Existing website with the same url will be recrawled to get the latest content. |
Array of objects (Products for Training) A list of products for training the chatbot. | |
Array of objects (Q&As for Training) A list of Q&As for the chatbot to learn specific topic answers. | |
Array of objects or objects or objects or objects or objects (Knowledge Chunks to Delete) A list of knowledge sources to remove from the chatbot's knowledge base. |
{- "chatbotId": "string",
- "sourceText": "Example training text.",
- "products": [
- {
- "id": "shopify_1234567",
- "information": {
- "id": "shopify_1234567",
- "name": "Fleece Drawstring Joggers",
- "color": "white"
}
}
], - "qAndAs": [
- {
- "question": "What is Chat Data?",
- "answer": "Chat Data is a platform that..."
}
], - "deletes": [
- {
- "type": "website",
- "url": "string"
}
]
}
{- "chatbotId": "string",
- "consumedCharacters": 1000000,
- "remainingCharacters": 10000000,
- "dataSources": [
], - "status": "success"
}
Get the current training progress of the chatbot.
Example request by curl:
curl -X GET https://api.chat-data.com/api/v2/chatbot/status/{chatbotId} \
-H "Authorization: Bearer YOUR_API_KEY"
chatbotId required | string (Chatbot ID) The unique identifier allocated to the chatbot. |
{- "status": "success",
- "progress": 100
}
This API enables the deletion of a chatbot by specifying its ID. It removes the chatbot along with its associated data from the system, including training data, user monitoring data, conversations, leads information, etc. Exercise caution when using this deletion action, as all deleted sources are unrecoverable.
Example request by curl:
curl -X DELETE https://api.chat-data.com/api/v2/delete-chatbot/{chatbotId} \
-H "Authorization: Bearer YOUR_API_KEY"
chatbotId required | string (Chatbot ID) The unique identifier allocated to the chatbot. |
{- "status": "success"
}
Returns a list of all chatbots under your account with related information.
Example request by curl:
curl -X GET https://api.chat-data.com/api/v2/get-chatbots \
-H "Authorization: Bearer YOUR_API_KEY"
{- "status": "success",
- "chatbots": [
- {
- "chatbotId": "string",
- "chatbotName": "string",
- "visibility": "private",
- "createdAt": 0,
- "lastTrainedAt": 0,
- "onlyAllowOnAddedDomains": true,
- "domains": [
- "string"
], - "basePrompt": "string",
- "rateLimitPoints": 0,
- "rateLimitTimeframe": 0,
- "rateLimitMessage": "string",
- "suggestedMessages": [
- "string"
], - "initialMessages": [
- "string"
], - "styles": {
- "theme": "dark",
- "buttonColor": "rgb(0, 0, 0)",
- "displayName": "string",
- "alignChatButton": "left",
- "userMessageColor": "rgb(0, 0, 0)",
- "profilePictureFile": "string",
- "bubblePictureFile": "string",
- "autoOpenChatWindowAfter": 3
}, - "model": "custom-data-upload",
- "baseModel": "gpt-4o-mini",
- "numberOfConversations": 100,
- "status": 100,
- "temperature": 0,
- "qALinks": [
- {
- "text": "Create Chatbot",
}
], - "storeChat": true,
- "showCalendar": false,
- "calendarMessage": "Book a demo",
- "enableBouncingAnimation": true,
- "ignoreDataSource": false,
- "leadsConfig": {
- "message": "Let us know how to contact you",
- "collectName": true,
- "collectEmail": true,
- "collectPhone": false,
- "nameMessage": "Name",
- "emailMessage": "Email",
- "phoneMessage": "Phone"
}, - "notification": {
- "enableLeadsEmail": true,
- "enableConversationEmails": true,
}, - "bearer": "string"
}
]
}
Returns the related information about a single chatbot. The returned chatbot schema is the same as the /get-chatbots
endpoint.
Example request by curl:
curl -X GET https://api.chat-data.com/api/v2/get-chatbot/{chatbotId} \
-H "Authorization: Bearer YOUR_API_KEY"
chatbotId required | string (Chatbot ID) The unique identifier allocated to the chatbot. |
{- "status": "success",
- "chatbot": {
- "chatbotId": "string",
- "chatbotName": "string",
- "visibility": "private",
- "createdAt": 0,
- "lastTrainedAt": 0,
- "onlyAllowOnAddedDomains": true,
- "domains": [
- "string"
], - "basePrompt": "string",
- "rateLimitPoints": 0,
- "rateLimitTimeframe": 0,
- "rateLimitMessage": "string",
- "suggestedMessages": [
- "string"
], - "initialMessages": [
- "string"
], - "styles": {
- "theme": "dark",
- "buttonColor": "rgb(0, 0, 0)",
- "displayName": "string",
- "alignChatButton": "left",
- "userMessageColor": "rgb(0, 0, 0)",
- "profilePictureFile": "string",
- "bubblePictureFile": "string",
- "autoOpenChatWindowAfter": 3
}, - "model": "custom-data-upload",
- "baseModel": "gpt-4o-mini",
- "numberOfConversations": 100,
- "status": 100,
- "temperature": 0,
- "qALinks": [
- {
- "text": "Create Chatbot",
}
], - "storeChat": true,
- "showCalendar": false,
- "calendarMessage": "Book a demo",
- "enableBouncingAnimation": true,
- "ignoreDataSource": false,
- "leadsConfig": {
- "message": "Let us know how to contact you",
- "collectName": true,
- "collectEmail": true,
- "collectPhone": false,
- "nameMessage": "Name",
- "emailMessage": "Email",
- "phoneMessage": "Phone"
}, - "notification": {
- "enableLeadsEmail": true,
- "enableConversationEmails": true,
}, - "bearer": "string"
}
}
This API endpoint allows you to edit your chatbot.
Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/update-chatbot-settings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"chatbotId": "your_chatbot_id",
"chatbotName": "Updated Chatbot Name",
"basePrompt": "You are a helpful assistant specialized in customer support",
"initialMessages": ["Welcome! How can I assist you today?"],
"visibility": "private"
}'
chatbotId required | string (Chatbot ID) The unique identifier allocated to the generated chatbot. You can initiate API calls pertaining to this chatbot using this ID. |
chatbotName | string (Chatbot Name) The name of the created chatbot. |
basePrompt | string (Base prompt) Base prompt for the chatbot |
initialMessages | Array of strings (Initial messages) Array of initial messages to be used by the chatbot |
suggestedMessages | Array of strings (Suggested messages) Array of suggested messages shown in the chatbot. |
visibility | string (Visibility) Enum: "private" "public" Visibility status of the chatbot 'private' | 'public'. It controls whether your chatbot is accessible to others. |
onlyAllowOnAddedDomains | boolean (Only allow on added domains) Enable or disable only allow the iframe and widget on specific domains |
domains | Array of strings (Domains) Array of only allowed domains |
rateLimitPoints | number (RateLimit points) The limit on the number of messages (even if each message by GPT-4.0/GPT-4o consume 20/10 message credits, it's still considered as one message here in the rate limiter) to be sent from one device every rateLimitTimeframe seconds |
rateLimitTimeframe | number (RateLimit timeframe) The timeframe (in seconds) in which the messages limit sent |
rateLimitMessage | string (RateLimit message) The error message shown to the user when the conversation is rate limited. |
baseModel | string (Base Model) Enum: "gpt-4o-mini" "gpt-4o" "gpt-4" "claude-3-opus" "claude-3-5-sonnet" "claude-3-haiku" The OpenAPI model used in our RAG processing pipeline. |
temperature | number (Temperature) [ 0 .. 1 ] The temperature parameter for the AI model with range [0, 1] |
storeChat | boolean (Store Chat History) Default: true Indicates whether the chat history will be stored on our server. This option is automatically disabled when utilizing our medical chat models to prioritize user privacy and comply with confidentiality standards. |
Array of objects (Links for Frequently Asked Questions) An array representing added frequently asked questions pages. | |
showCalendar | boolean (Show Calendar) Default: false Specifies whether the Calendly booking button should be displayed in the chatbot widget or iframe. |
calendarUrl | string (Calendly url) The URL of Calendly for users to schedule appointments. |
calendarMessage | string (Calendly message) The message to display for appointment scheduling. |
enableBouncingAnimation | boolean (Enable bouncing animation) Default: true At the session start, determines whether the chatbot bubble should bounce to attract attention. |
ignoreDataSource | boolean (Ignore Data Source) Default: false Whether custom data uploaded by the user should be ignored for chatbot responses. If set to true, the chatbot will act the same as a pure ChatGPT chatbot. This option is applicable when the chatbot is based on the |
object (Configuration to collect customer information) The information to be collected from potential customers. | |
object (Chatbot styles) | |
object (Configuration for email notifications from the chatbot) The configuration for sending daily email notifications. | |
customBackend | string (Custom Backend) The URL of a customized backend for the chatbot, to be used if you prefer to use your own backend. |
bearer | string (Bearer) The authentication bearer token required to access and authenticate against your custom backend. |
{- "chatbotId": "string",
- "chatbotName": "string",
- "basePrompt": "string",
- "initialMessages": [
- "string"
], - "suggestedMessages": [
- "string"
], - "visibility": "private",
- "onlyAllowOnAddedDomains": true,
- "domains": [
- "string"
], - "rateLimitPoints": 0,
- "rateLimitTimeframe": 0,
- "rateLimitMessage": "string",
- "baseModel": "gpt-4o-mini",
- "temperature": 0,
- "storeChat": true,
- "qALinks": [
- {
- "text": "Create Chatbot",
}
], - "showCalendar": false,
- "calendarMessage": "Book a demo",
- "enableBouncingAnimation": true,
- "ignoreDataSource": false,
- "leadsConfig": {
- "message": "Let us know how to contact you",
- "collectName": true,
- "collectEmail": true,
- "collectPhone": false,
- "nameMessage": "Name",
- "emailMessage": "Email",
- "phoneMessage": "Phone"
}, - "styles": {
- "theme": "dark",
- "buttonColor": "rgb(0, 0, 0)",
- "displayName": "string",
- "alignChatButton": "left",
- "userMessageColor": "rgb(0, 0, 0)",
- "profilePictureFile": "string",
- "bubblePictureFile": "string",
- "autoOpenChatWindowAfter": 3
}, - "notification": {
- "enableLeadsEmail": true,
- "enableConversationEmails": true,
}, - "bearer": "string"
}
{- "status": "success"
}
Add a webhook endpoint with the corresponding event type([chat
, live-chat-escalation
, 'lead-submission']) for the chatbot to send real-time events.
Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/add-webhook \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"chatbotId": "your_chatbot_id",
"url": "https://your-webhook-endpoint.com",
"event": "chat"
}'
chatbotId required | string (Chatbot ID) The ID of he chabot to add the webhook. |
url required | string (URL) The url endpoint that the chatbot will deliver events to. |
event required | string (Event) Enum: "chat" "live-chat-escalation" "lead-submission" The type of the event that the webhook has subscribed to. Please refer to the Webhook setting for more details. |
{- "chatbotId": "string",
- "url": "string",
- "event": "chat"
}
{- "status": "success",
- "webhooks": [
- {
- "endpoint": "string",
- "events": [
- "chat"
], - "secret": "string",
- "enable": true
}
]
}
Delete the webhook which has the give url and all event under the webhook.
Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/delete-webhook \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"chatbotId": "your_chatbot_id",
"url": "https://your-webhook-endpoint.com"
}'
chatbotId required | string (Chatbot ID) The ID of he chabot to add the webhook. |
url required | string (URL) The url endpoint that the chatbot will deliver events to. |
{- "chatbotId": "string",
- "url": "string"
}
{- "status": "success",
- "webhooks": [
- {
- "endpoint": "string",
- "events": [
- "chat"
], - "secret": "string",
- "enable": true
}
]
}
This API endpoint allows you to update the profile picture of your chatbot.
Example request by curl:
curl -X POST -H "Content-Type: multipart/form-data" -F "image=@/path/to/your/image.jpg" https://api.chat-data.com/api/v2/upload-chatbot-profile-picture/{chatbotId}
chatbotId required | string The unique identifier allocated to the chatbot. |
image | string <binary> (Picture file path) The path of the profile picture. |
{- "status": "success"
}
Delete a chatbot profile picture.
Example request by curl:
curl -X DELETE https://api.chat-data.com/api/v2/delete-chatbot-profile-picture/{chatbotId} \
-H "Authorization: Bearer YOUR_API_KEY"
chatbotId required | string (Chatbot ID) The unique identifier allocated to the chatbot. |
{- "status": "success"
}
This API endpoint allows you to update the icon picture of your chatbot.
Example request by curl:
curl -X POST -H "Content-Type: multipart/form-data" -F "image=@/path/to/your/image.jpg" https://api.chat-data.com/api/v2/upload-chatbot-icon/{chatbotId}
chatbotId required | string The unique identifier allocated to the chatbot. |
image | string <binary> (Picture file path) The path of the profile picture. |
{- "status": "success"
}
Delete a chatbot icon picture.
Example request by curl:
curl -X DELETE https://api.chat-data.com/api/v2/delete-chatbot-icon/{chatbotId} \
-H "Authorization: Bearer YOUR_API_KEY"
chatbotId required | string (Chatbot ID) The unique identifier allocated to the chatbot. |
{- "status": "success"
}
This operation retrieves the confidence scores (defined as cosine similarity
) of related chunks used to generate answers. You can use this function to obtain confidence scores before calling the /chat
API endpoint, providing an estimate of the chatbot's ability to deliver high-quality answers based on the context. Chunks are cached based on the messages
array, so subsequent calls to the /chat
API with the same messages array will incur minimal latency in retrieving related vector embeddings from the database. Therefore, calling this API endpoint before /chat
should not significantly impact overall chat performance.
Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/get-confidence-score \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"messages": [
{"role": "user", "content": "What are your services?"}
],
"chatbotId": "your_chatbot_id"
}'
required | Array of objects (List of Message Objects) List of messages |
baseModel | string (Chatbot Base Model) Enum: "gpt-4o-mini" "gpt-4o" "gpt-4" "claude-3-opus" "claude-3-5-sonnet" "claude-3-haiku" The baseModel parameter in the API call overrides the Chatbot's baseModel setting when processing the Rag context during chatting. |
chatbotId required | string The ID of the chatbot |
{- "messages": [
- {
- "role": "assistant",
- "content": "How can I help you with?"
}, - {
- "role": "user",
- "content": "How does Chat Data work?"
}
], - "baseModel": "gpt-4o-mini",
- "chatbotId": "string"
}
{- "status": "success",
- "averageScore": 0.8,
- "scoresArray": [
- 0.85,
- 0.75
], - "sources": [
- [
- {
- "score": 0.85,
- "truncatedText": "Topic: Bone Marrow and Stem Cell Transplant. Section: What is a bone marrow and stem cell transplant...",
- "title": "Bone Marrow and Stem Cell Transplant",
- "type": "website"
}, - {
- "score": 0.75,
- "truncatedText": "Medical Field: Patient Education. Topic: Blood disorders. Medical condition: Hematopoietic cell tran...",
- "title": "Multiple myeloma treatment (Beyond the Basics)",
- "topic": "Patient Education",
- "subtopic": "Blood disorders",
- "type": "website"
}
]
], - "embeddingText": "what is marrow transfer"
}
This operation fetches segments pertinent to generating responses. Designed for seamless chatbot integration with the GPTs store, this API endpoint allows users to supply relevant document fragments to the GPTs. Similar to the /get-confidence-score
endpoint, this API are cached for efficiency based on the query.
Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/query-knowledge-base/{chatbotId} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"query": "What services do you offer?",
"count": 5
}'
chatbotId required | string (Chatbot ID) The unique identifier allocated to the chatbot. |
query required | string (Query) The text utilized for vector-based searching of the knowledge base based on the cosine similarity. |
count | number (Context Count) Default: 5 Specifies the maximum number of context segments to return that show a positive cosine similarity with the input query text. |
{- "query": "string",
- "count": 5
}
[- {
- "source": "string",
- "snippet": "string",
- "relavant_score": 1
}
]
Send messages to a chatbot and receive a response.
Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/chat \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"messages": [
{"role": "user", "content": "Hello, how can you help me?"}
],
"chatbotId": "your_chatbot_id",
"stream": false
}'
required | Array of objects (List of Message Objects) List of messages |
chatbotId required | string The ID of the chatbot |
baseModel | string (Chatbot Base Model) Enum: "gpt-4o-mini" "gpt-4o" "gpt-4" "claude-3-opus" "claude-3-5-sonnet" "claude-3-haiku" The baseModel parameter in the API call overrides the Chatbot's baseModel setting when processing the Rag context during chatting. |
basePrompt | string (Chatbot Base Prompt) The basePrompt parameter in the API call overrides the Chatbot's basePrompt when processing the Rag context during chatting. |
stream | boolean (Stream) Default: false Whether to stream back partial progress or wait for the full response |
appendMessages | boolean (Append Messages) Default: false If |
conversationId | string (Conversation ID) ID of the current conversation. The chatbot will generate one if this field is undefined. |
{- "messages": [
- {
- "role": "assistant",
- "content": "How can I help you with?"
}, - {
- "role": "user",
- "content": "How does Chat Data work?"
}
], - "chatbotId": "string",
- "baseModel": "gpt-4o-mini",
- "basePrompt": "string",
- "stream": false,
- "appendMessages": false,
- "conversationId": "string"
}
abc chunk2 chunk3
Deletes a specific conversation associated with a chatbot. This operation requires both the chatbotId and conversationId.
Example request by curl:
curl -X DELETE https://api.chat-data.com/api/v2/delete-conversation \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"chatbotId": "your_chatbot_id",
"conversationId": "conversation_id_to_delete"
}'
chatbotId required | string (Chatbot ID) The unique identifier of the chatbot. |
conversationId required | string (Conversation ID) The unique identifier of the conversation to be deleted. |
{- "status": "success",
- "message": "Conversation deleted successfully."
}
Send live chat messages to a chatbot for an existing conversation.
Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/live-chat \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"chatbotId": "your_chatbot_id",
"conversationId": "your_conversation_id",
"message": "Hello, this is a live chat message.",
"name": "John Doe",
"avatar": "https://example.com/avatar.jpg",
"files": [
{
"name": "document.pdf",
"type": "application/pdf",
"url": "https://example.com/document.pdf"
}
]
}'
chatbotId required | string The unique identifier of the chatbot. |
message required | string The message text to be sent to the conversation. |
conversationId required | string The unique identifier of the conversation. The conversation must be a valid existing conversation of the chatbot. |
name | string The name of the human agent sending the message. If unset, we will use the name of the chatbot owner as the agent name. |
avatar | string <uri> The URL of the avatar image for the message sender. If unset, we will use the avatar of the chatbot owner as the avatar of the human agent. |
Array of objects <= 3 items An optional array of file objects to be attached to the message. |
{- "chatbotId": "string",
- "message": "string",
- "conversationId": "string",
- "name": "string",
}
{- "status": "success",
- "emailed_offline_message": true,
- "is_user_online": true
}
Toggle the state of a live chat session for a specific conversation. Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/livechat-state \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"chatbotId": "your_chatbot_id",
"conversationId": "your_conversation_id",
"end": true
}'
chatbotId required | string The unique identifier of the chatbot. |
conversationId required | string The unique identifier of the conversation. |
end | boolean Optional. If provided, sets the live chat state to this value. If not provided, toggles the current state. |
{- "chatbotId": "string",
- "conversationId": "string",
- "end": true
}
{- "status": "success",
- "liveChatEnded": true
}
Upload a file to be used with a chatbot.
Example request by curl:
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: multipart/form-data" -F "file=@/path/to/your/file" https://api.chat-data.com/api/v2/upload-file/{chatbotId}
chatbotId required | string The ID of the chatbot |
file required | string <binary> The file to upload |
{- "status": "success",
- "url": "string"
}
This API endpoint allows you to delete a previously uploaded file associated with a chatbot.
Example request by curl:
curl -X POST https://api.chat-data.com/api/v2/delete-file \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"chatbotId": "{chatbotId}",
"fileUrl": "https://storage.azure.com/your-container/chatbot_id/filename.pdf"
}'
chatbotId required | string The unique identifier allocated to the chatbot. |
fileUrl required | string The URL of the file to be deleted. |
{- "chatbotId": "string",
- "fileUrl": "string"
}
{- "status": "success",
- "message": "File deleted successfully."
}
Generate a 30-day Shared Access Signature (SAS) token for accessing a specific file
chatbotId required | string The unique identifier allocated to the chatbot. |
fileUrl required | string The URL of the file to generate SAS token for. |
{- "chatbotId": "string",
- "fileUrl": "string"
}
{- "status": "success",
- "sasToken": "sv=2020-08-04&st=2023-01-01T00%3A00%3A00Z&se=2023-01-31T00%3A00%3A00Z..."
}
Get conversations from a chatbot. This operation support paginations. Example request by curl:
curl -X GET https://api.chat-data.com/api/v2/get-conversations/{chatbotId}?startTimestamp={value1}&endTimestamp={value2}&start={value3}&size={value4}&source={value5}
chatbotId required | string (Chatbot ID) The unique identifier allocated to the chatbot. |
startTimestamp | number (Start Timestamp) The timestamp of the start date. |
endTimestamp | number (End Timestamp) The timestamp of the end date. |
start | number (Start) Default: 0 The start position of the results, used for pagination. |
size | number (Size) Default: 100 The maximum size of the results retrieved after the start position, used for pagination. |
source | string (Source) Enum: "iframe" "site" "api" "widget" "Discord" "Slack" "Whatsapp" "Messenger" Filter conversations from a specific source. |
{- "status": "success",
- "conversations": [
- {
- "conversationId": "string",
- "createdAt": 0,
- "messages": [
- {
- "role": "user",
- "content": "string",
- "isTranscript": true,
- "upvote": true,
- "name": "string",
- "avatar": "string",
- "timestamp": 0,
- "read": true,
- "score": 0
}
], - "source": "iframe",
- "chatbotId": "string",
- "customer": {
- "name": "Firstname Lastname",
- "source": "widget",
- "type": "888-888-8888"
}
}
], - "total": 0
}
Get collected customers from a chatbot. This operation support paginations. Example request by curl:
curl -X GET https://api.chat-data.com/api/v2/get-customers/{chatbotId}?startTimestamp={value1}&endTimestamp={value2}&start={value3}&size={value4}&source={value5}
chatbotId required | string (Chatbot ID) The unique identifier allocated to the chatbot. |
startTimestamp | number (Start Timestamp) The timestamp of the start date. |
endTimestamp | number (End Timestamp) The timestamp of the end date. |
start | number (Start) Default: 0 The start position of the results, used for pagination. |
size | number (Size) Default: 100 The maximum size of the results retrieved after the start position, used for pagination. |
source | string (Source) Enum: "iframe" "site" "api" "widget" "Discord" "Slack" "Whatsapp" "Messenger" The source filter to filter the customers from which they were acquired. |
{- "status": "success",
- "customers": [
- {
- "name": "Firstname Lastname",
- "source": "widget",
- "type": "888-888-8888"
}
], - "total": 0
}
Get the aggregated statistics of a chatbot. Example request by curl:
curl -X GET https://api.chat-data.com/api/v2/get-analysis/{chatbotId}?startTimestamp={value1}&endTimestamp={value2}
chatbotId required | string (Chatbot ID) The unique identifier allocated to the chatbot. |
startTimestamp | number (Start Timestamp) The timestamp of the start date. |
endTimestamp | number (End Timestamp) The timestamp of the end date. |
{- "status": "success",
- "countryDistribution": [
- {
- "countryCode": "string",
- "count": 0
}
], - "hourDistribution": [
- {
- "hour": "string",
- "source": "iframe",
- "count": 0
}
], - "creditsDistribution": [
- {
- "date": 0,
- "source": "iframe",
- "count": 0
}
]
}
Get a summary of the user's current subscriptions and priviledges.
Response example:
{
status: "success"
email: '[email protected]',
name: 'username',
plan: {
subscriptions: {standard: 1},
remainingTrainingChars: 50000000,
refreshingTrainingChars: 110000000,
remainingCredits: 5000,
refreshingCredits: 10000,
chatbots: 2,
chatbotsLimit: 5,
chatbotCharactersLimit: 11000000,
gatherLeads: true,
customDomain: true,
api: true,
customModel: true,
userAnalysis: true,
notification: true,
gpt4: true,
removeBrand: false,
}
}
{- "status": "success",
- "email": "string",
- "name": "string",
- "plan": {
- "subscriptions": {
- "standard": 1
}, - "remainingTrainingChars": 50000000,
- "refreshingTrainingChars": 110000000,
- "remainingCredits": 5000,
- "refreshingCredits": 10000,
- "chatbots": 2,
- "chatbotsLimit": 5,
- "chatbotCharactersLimit": 11000000,
- "gatherLeads": true,
- "customDomain": true,
- "api": true,
- "customModel": true,
- "userAnalysis": true,
- "notification": true,
- "gpt4": true,
- "removeBrand": false
}
}