Chat Data API Schema Guide (2.0.0)

Download OpenAPI specification:Download

Introduction

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.

Conventions

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.

JSON conventions

  • Response body of success requests is generally as follows:

    {
      "status": "success",
      "id": 160,
      "name": "Bo",
      ...
    }
    
    • status is a common property.
    • Depending on the function of the api call, there might be other properties as well.
  • 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.

Request limits

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.

Authentication

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.

Chat Data Website Guide

Creating Chatbot

Migrated to Creating Chatbot.

Getting Started With Your Chatbot Settings

Migrated to Basic Configurations.

Enhancing Chatbot Responses

Webhooks Setup

Migrated to Webhooks Setup.

Discord Bot Integration

Slack Bot Integration

Migrated to Slack Bot Integration.

Whatsapp Integration

Migrated to WhatsApp Integration.

Train by Products From Shopify Store

Add Chatbot to Your Shopify Store

Shopify Webhook Synchronization Integration

Import Products From WooCommerce Store

Add Chatbot to Your WordPress Website

WooCommerce Webhook Synchronization Integration

Customizing Your Domain for Embedding Scripts

Chat Data RESTful API

Chatbot Operations

Create and train a 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 humans
  • medical-chat-vet: For medical chat with veterinarians
  • custom-model: For using a custom model

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

Authorizations:
HTTPBearer
Request Body schema: application/json
required
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 http:// or https:// protocol, such as in the format https://www.chat-data.com. Relevant only if the model is custom-data-upload.

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:

  • For custom data upload: custom-data-upload
  • For medical chat with humans: medical-chat-human
  • For medical chat with veterinarians: medical-chat-vet
  • For custom model: custom-model

The chatbot defaults to custom-data-upload if the model paramter is not provided. In medical models and custom model, sourceText and urlsToScrape are ignored.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}

Retrain an existing chatbot

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:

  • Text data via sourceText
  • URLs to scrape via urlsToScrape
  • Product information via products
  • Q&A pairs via 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.

Authorizations:
HTTPBearer
Request Body schema: application/json
required
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.

Responses

Request samples

Content type
application/json
{
  • "chatbotId": "string",
  • "sourceText": "Example training text.",
  • "products": [
    ],
  • "qAndAs": [
    ],
  • "deletes": [
    ]
}

Response samples

Content type
application/json
{}

Get Chatbot Status

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"
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string (Chatbot ID)

The unique identifier allocated to the chatbot.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "progress": 100
}

Delete a chatbot

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"
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string (Chatbot ID)

The unique identifier allocated to the chatbot.

Responses

Response samples

Content type
application/json
{
  • "status": "success"
}

Get all chatbots

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"
Authorizations:
HTTPBearer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "chatbots": [
    ]
}

Get a chatbot

Returns the related information about a single chatbot. The returned chatbot schema is the same as the /get-chatbotsendpoint.

Example request by curl:

curl -X GET https://api.chat-data.com/api/v2/get-chatbot/{chatbotId} \
-H "Authorization: Bearer YOUR_API_KEY"
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string (Chatbot ID)

The unique identifier allocated to the chatbot.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "chatbot": {
    }
}

Update Chatbot Settings

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"
}'
Authorizations:
HTTPBearer
Request Body schema: application/json
required
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 custom-data-upload model.

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.

Responses

Request samples

Content type
application/json
{
  • "chatbotId": "string",
  • "chatbotName": "string",
  • "basePrompt": "string",
  • "initialMessages": [
    ],
  • "suggestedMessages": [
    ],
  • "visibility": "private",
  • "onlyAllowOnAddedDomains": true,
  • "domains": [
    ],
  • "rateLimitPoints": 0,
  • "rateLimitTimeframe": 0,
  • "rateLimitMessage": "string",
  • "baseModel": "gpt-4o-mini",
  • "temperature": 0,
  • "storeChat": true,
  • "showCalendar": false,
  • "calendarMessage": "Book a demo",
  • "enableBouncingAnimation": true,
  • "ignoreDataSource": false,
  • "leadsConfig": {
    },
  • "styles": {
    },
  • "notification": {},
  • "bearer": "string"
}

Response samples

Content type
application/json
{
  • "status": "success"
}

Add a webhook to the chatbot

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"
}'
Authorizations:
HTTPBearer
Request Body schema: application/json
required
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.

Responses

Request samples

Content type
application/json
{
  • "chatbotId": "string",
  • "url": "string",
  • "event": "chat"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "webhooks": [
    ]
}

Delete a webhook from the chatbot.

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"
}'
Authorizations:
HTTPBearer
Request Body schema: application/json
required
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.

Responses

Request samples

Content type
application/json
{
  • "chatbotId": "string",
  • "url": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "webhooks": [
    ]
}

Update profile picture

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}
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string

The unique identifier allocated to the chatbot.

Request Body schema: multipart/form-data
required
image
string <binary> (Picture file path)

The path of the profile picture.

Responses

Response samples

Content type
application/json
{
  • "status": "success"
}

Delete chatbot profile picture

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"
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string (Chatbot ID)

The unique identifier allocated to the chatbot.

Responses

Response samples

Content type
application/json
{
  • "status": "success"
}

Update chatbot icon

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}
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string

The unique identifier allocated to the chatbot.

Request Body schema: multipart/form-data
required
image
string <binary> (Picture file path)

The path of the profile picture.

Responses

Response samples

Content type
application/json
{
  • "status": "success"
}

Delete chatbot icon picture

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"
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string (Chatbot ID)

The unique identifier allocated to the chatbot.

Responses

Response samples

Content type
application/json
{
  • "status": "success"
}

Retrieve confidence score for context chunks

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"
}'
Authorizations:
HTTPBearer
Request Body schema: application/json
required
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

Responses

Request samples

Content type
application/json
{
  • "messages": [
    ],
  • "baseModel": "gpt-4o-mini",
  • "chatbotId": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "averageScore": 0.8,
  • "scoresArray": [
    ],
  • "sources": [],
  • "embeddingText": "what is marrow transfer"
}

Retrieve context chunks

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
}'
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string (Chatbot ID)

The unique identifier allocated to the chatbot.

Request Body schema: application/json
required
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.

Responses

Request samples

Content type
application/json
{
  • "query": "string",
  • "count": 5
}

Response samples

Content type
application/json
[
  • {
    }
]

Send Message to Chatbot

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
}'
Authorizations:
HTTPBearer
Request Body schema: application/json
required
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 true, the messages parameter is appended to the previous messages with the same conversationId. If false, it is assumed that the messages parameter contains the entire message history.

conversationId
string (Conversation ID)

ID of the current conversation. The chatbot will generate one if this field is undefined.

Responses

Request samples

Content type
application/json
{
  • "messages": [
    ],
  • "chatbotId": "string",
  • "baseModel": "gpt-4o-mini",
  • "basePrompt": "string",
  • "stream": false,
  • "appendMessages": false,
  • "conversationId": "string"
}

Response samples

Content type
text/plain
abc
chunk2
chunk3

Delete a conversation

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"
}'
Authorizations:
HTTPBearer
query Parameters
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.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "Conversation deleted successfully."
}

Send Live Chat Message

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"
    }
  ]
}'
Authorizations:
HTTPBearer
Request Body schema: application/json
required
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.

Responses

Request samples

Content type
application/json
{
  • "chatbotId": "string",
  • "message": "string",
  • "conversationId": "string",
  • "name": "string",
  • "avatar": "http://example.com",
  • "files": []
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "emailed_offline_message": true,
  • "is_user_online": true
}

Toggle Live Chat State

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
}'
Authorizations:
HTTPBearer
Request Body schema: application/json
required
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.

Responses

Request samples

Content type
application/json
{
  • "chatbotId": "string",
  • "conversationId": "string",
  • "end": true
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "liveChatEnded": true
}

File Operations

Upload File

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}
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string

The ID of the chatbot

Request Body schema: multipart/form-data
required
file
required
string <binary>

The file to upload

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "url": "string"
}

Delete uploaded file

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"
}'
Authorizations:
HTTPBearer
Request Body schema: application/json
required
chatbotId
required
string

The unique identifier allocated to the chatbot.

fileUrl
required
string

The URL of the file to be deleted.

Responses

Request samples

Content type
application/json
{
  • "chatbotId": "string",
  • "fileUrl": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "File deleted successfully."
}

Generate SAS Token for File Access

Generate a 30-day Shared Access Signature (SAS) token for accessing a specific file

Authorizations:
HTTPBearer
Request Body schema: application/json
required
chatbotId
required
string

The unique identifier allocated to the chatbot.

fileUrl
required
string

The URL of the file to generate SAS token for.

Responses

Request samples

Content type
application/json
{
  • "chatbotId": "string",
  • "fileUrl": "string"
}

Response samples

Content type
application/json
{}

Chatbot Analytics

Get conversations.

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}
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string (Chatbot ID)

The unique identifier allocated to the chatbot.

query Parameters
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.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "conversations": [
    ],
  • "total": 0
}

Get Customers.

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}
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string (Chatbot ID)

The unique identifier allocated to the chatbot.

query Parameters
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.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "customers": [
    ],
  • "total": 0
}

Get the statistic distribution of the chatbot.

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}
Authorizations:
HTTPBearer
path Parameters
chatbotId
required
string (Chatbot ID)

The unique identifier allocated to the chatbot.

query Parameters
startTimestamp
number (Start Timestamp)

The timestamp of the start date.

endTimestamp
number (End Timestamp)

The timestamp of the end date.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "countryDistribution": [
    ],
  • "hourDistribution": [
    ],
  • "creditsDistribution": [
    ]
}

User Account

Get the current plan of the user

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,
  }
}
Authorizations:
HTTPBearer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "email": "string",
  • "name": "string",
  • "plan": {
    }
}