Skip to content

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/chatbots

Headers

NameRequiredDescription
AuthorizationYesYour API key in the format: Bearer YOUR_API_KEY

Query Parameters

ParameterTypeRequiredDescription
limitintegerNoMaximum number of chatbots to return. Default: 50, Max: 100
offsetintegerNoNumber of chatbots to skip. Used for pagination. Default: 0
team_idstringNoFilter chatbots by team ID
sort_bystringNoField to sort by. Options: created_at, name. Default: created_at
sort_orderstringNoSort 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

NameRequiredDescription
AuthorizationYesYour API key in the format: Bearer YOUR_API_KEY

Path Parameters

ParameterTypeRequiredDescription
chatbotIdstringYesThe 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}/conversations

Headers

NameRequiredDescription
AuthorizationYesYour API key in the format: Bearer YOUR_API_KEY

Path Parameters

ParameterTypeRequiredDescription
chatbotIdstringYesThe ID of the chatbot

Query Parameters

ParameterTypeRequiredDescription
limitintegerNoMaximum number of conversations to return. Default: 50, Max: 100
offsetintegerNoNumber of conversations to skip. Used for pagination. Default: 0
start_datestringNoFilter conversations by start date (ISO 8601 format)
end_datestringNoFilter 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}/stats

Headers

NameRequiredDescription
AuthorizationYesYour API key in the format: Bearer YOUR_API_KEY

Path Parameters

ParameterTypeRequiredDescription
chatbotIdstringYesThe ID of the chatbot

Query Parameters

ParameterTypeRequiredDescription
start_datestringNoStart date for stats (ISO 8601 format)
end_datestringNoEnd date for stats (ISO 8601 format)
granularitystringNoData 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

Terminal window
# Get all chatbots
curl -X GET "https://api.nexvio.ai/v1/chatbots" \
-H "Authorization: Bearer YOUR_API_KEY"
# Get a specific chatbot
curl -X GET "https://api.nexvio.ai/v1/chatbots/chatbot_456def" \
-H "Authorization: Bearer YOUR_API_KEY"

JavaScript

// Get all chatbots
const 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 chatbot
const 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 chatbots
url = "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 chatbot
chatbot_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)