Get Chatbots
Get Chatbots
This endpoint allows you to retrieve a list of all chatbots or specific chatbot details from your Nexvio.ai account.
Get All Chatbots
Retrieve a list of all chatbots in your account.
GET https://api.nexvio.ai/v1/chatbotsHeaders
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Your API key in the format: Bearer YOUR_API_KEY |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Maximum number of chatbots to return. Default: 50, Max: 100 |
offset | integer | No | Number of chatbots to skip. Used for pagination. Default: 0 |
team_id | string | No | Filter chatbots by team ID |
sort_by | string | No | Field to sort by. Options: created_at, name. Default: created_at |
sort_order | string | No | Sort order. Options: asc, desc. Default: desc |
Response
{ "status": "success", "data": { "chatbots": [ { "id": "chatbot_456def", "team_id": "team_123abc", "name": "Sales Assistant", "model": "gpt-4", "created_at": "2023-07-15T12:30:45Z", "updated_at": "2023-07-15T12:30:45Z" }, { "id": "chatbot_789ghi", "team_id": "team_123abc", "name": "Support Bot", "model": "gpt-3.5-turbo", "created_at": "2023-06-20T09:15:30Z", "updated_at": "2023-07-10T14:25:12Z" } // More chatbots... ], "total": 5, "limit": 50, "offset": 0 }}Get a Specific Chatbot
Retrieve details about a specific chatbot.
GET https://api.nexvio.ai/v1/chatbots/{chatbotId}Headers
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Your API key in the format: Bearer YOUR_API_KEY |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chatbotId | string | Yes | The ID of the chatbot to retrieve |
Response
{ "status": "success", "data": { "chatbot": { "id": "chatbot_456def", "team_id": "team_123abc", "name": "Sales Assistant", "welcome_message": "Hello! I'm your sales assistant. How can I help you today?", "model": "gpt-4", "instructions": "You are a sales assistant for Acme Corp, a software company that specializes in CRM solutions...", "appearance": { "primary_color": "#4A90E2", "chat_bubble_button_style": "round", "position": "bottom-right", "chatbox_header_text": "Sales Support", "hide_branding": false }, "sources": [ { "id": "source_123xyz", "type": "website", "url": "https://acmecorp.com/products", "added_at": "2023-07-15T14:20:10Z" } ], "stats": { "total_conversations": 1245, "total_messages": 8976, "last_conversation_at": "2023-07-16T08:45:22Z" }, "created_at": "2023-07-15T12:30:45Z", "updated_at": "2023-07-15T14:20:10Z" } }}Get Chatbot Conversations
Retrieve conversations for a specific chatbot.
GET https://api.nexvio.ai/v1/chatbots/{chatbotId}/conversationsHeaders
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Your API key in the format: Bearer YOUR_API_KEY |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chatbotId | string | Yes | The ID of the chatbot |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Maximum number of conversations to return. Default: 50, Max: 100 |
offset | integer | No | Number of conversations to skip. Used for pagination. Default: 0 |
start_date | string | No | Filter conversations by start date (ISO 8601 format) |
end_date | string | No | Filter conversations by end date (ISO 8601 format) |
Response
{ "status": "success", "data": { "conversations": [ { "id": "conv_789ghi", "chatbot_id": "chatbot_456def", "contact_id": "contact_123abc", "contact_name": "John Doe", "contact_email": "john@example.com", "started_at": "2023-07-15T14:20:00Z", "last_message_at": "2023-07-15T14:22:31Z", "message_count": 6, "summary": "Customer asked about pricing plans and features for enterprise" }, // More conversations... ], "total": 1245, "limit": 50, "offset": 0 }}Get Chatbot Stats
Retrieve analytics and statistics for a specific chatbot.
GET https://api.nexvio.ai/v1/chatbots/{chatbotId}/statsHeaders
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Your API key in the format: Bearer YOUR_API_KEY |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chatbotId | string | Yes | The ID of the chatbot |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
start_date | string | No | Start date for stats (ISO 8601 format) |
end_date | string | No | End date for stats (ISO 8601 format) |
granularity | string | No | Data granularity. Options: day, week, month. Default: day |
Response
{ "status": "success", "data": { "summary": { "total_conversations": 1245, "total_messages": 8976, "avg_messages_per_conversation": 7.2, "avg_conversation_duration_seconds": 186, "contacts_collected": 532 }, "time_series": [ { "date": "2023-07-15", "conversations": 42, "messages": 301, "contacts_collected": 18 }, { "date": "2023-07-16", "conversations": 38, "messages": 275, "contacts_collected": 15 } // More data points... ] }}Error Responses
Authentication Error
{ "status": "error", "error": { "code": "unauthorized", "message": "Invalid API key" }}Not Found Error
{ "status": "error", "error": { "code": "not_found", "message": "Chatbot not found" }}Code Examples
cURL
# Get all chatbotscurl -X GET "https://api.nexvio.ai/v1/chatbots" \ -H "Authorization: Bearer YOUR_API_KEY"
# Get a specific chatbotcurl -X GET "https://api.nexvio.ai/v1/chatbots/chatbot_456def" \ -H "Authorization: Bearer YOUR_API_KEY"JavaScript
// Get all chatbotsconst response = await fetch('https://api.nexvio.ai/v1/chatbots', { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_API_KEY' }});
const data = await response.json();console.log(data);
// Get a specific chatbotconst chatbotId = 'chatbot_456def';const chatbotResponse = await fetch(`https://api.nexvio.ai/v1/chatbots/${chatbotId}`, { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_API_KEY' }});
const chatbotData = await chatbotResponse.json();console.log(chatbotData);Python
import requests
# Get all chatbotsurl = "https://api.nexvio.ai/v1/chatbots"headers = { "Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(url, headers=headers)data = response.json()print(data)
# Get a specific chatbotchatbot_id = "chatbot_456def"chatbot_url = f"https://api.nexvio.ai/v1/chatbots/{chatbot_id}"
chatbot_response = requests.get(chatbot_url, headers=headers)chatbot_data = chatbot_response.json()print(chatbot_data)