ENDPOINTS

BASE URL
https://livesupport365api.vpsmaker.net

POST Register & Get API Key

First, register a tenant account, then create an API key for authentication.

# 1. Register
curl -X POST https://livesupport365api.vpsmaker.net/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Company",
    "email": "admin@mycompany.com",
    "password": "secure_password_123"
  }'

# 2. Create API Key (use the token from registration)
curl -X POST https://livesupport365api.vpsmaker.net/api/v1/auth/api-keys \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Production Key"}'
import requests

# Register
resp = requests.post("https://livesupport365api.vpsmaker.net/api/v1/auth/register", json={
    "name": "My Company",
    "email": "admin@mycompany.com",
    "password": "secure_password_123"
})
token = resp.json()["access_token"]

# Create API Key
resp = requests.post("https://livesupport365api.vpsmaker.net/api/v1/auth/api-keys",
    headers={"Authorization": f"Bearer {token}"},
    json={"name": "Production Key"}
)
api_key = resp.json()["api_key"]
print(f"Your API Key: {api_key}")
// Register
const resp = await fetch('https://livesupport365api.vpsmaker.net/api/v1/auth/register', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name: 'My Company',
    email: 'admin@mycompany.com',
    password: 'secure_password_123'
  })
});
const { access_token } = await resp.json();

// Create API Key
const keyResp = await fetch('https://livesupport365api.vpsmaker.net/api/v1/auth/api-keys', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${access_token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ name: 'Production Key' })
});
const { api_key } = await keyResp.json();
using var client = new HttpClient();

// Register
var registerResp = await client.PostAsJsonAsync(
    "https://livesupport365api.vpsmaker.net/api/v1/auth/register",
    new { name = "My Company",
          email = "admin@mycompany.com",
          password = "secure_password_123" });
var data = await registerResp.Content
    .ReadFromJsonAsync<JsonElement>();
var token = data.GetProperty("access_token").GetString();

// Create API Key
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", token);
var keyResp = await client.PostAsJsonAsync(
    "https://livesupport365api.vpsmaker.net/api/v1/auth/api-keys",
    new { name = "Production Key" });

POST /api/v1/knowledge/upload

Upload a file (PDF, Word, Excel, CSV, JSON, XML, TXT, PPTX) to the knowledge base.

curl -X POST https://livesupport365api.vpsmaker.net/api/v1/knowledge/upload \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file=@company_faq.pdf"

# Response:
{
  "id": "abc-123",
  "filename": "company_faq.pdf",
  "file_type": "pdf",
  "status": "ready",
  "chunk_count": 24
}

POST /api/v1/knowledge/text

Add raw text directly to the knowledge base.

curl -X POST https://livesupport365api.vpsmaker.net/api/v1/knowledge/text \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Return Policy",
    "content": "We offer a 30-day money-back guarantee on all plans..."
  }'

POST /api/v1/chat

Ask a question. The AI searches your knowledge base and generates an answer with source citations.

curl -X POST https://livesupport365api.vpsmaker.net/api/v1/chat \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question": "What is your return policy?"}'

# Response:
{
  "answer": "We offer a 30-day money-back guarantee...",
  "session_id": "sess-456",
  "sources": [
    {
      "document_name": "Return Policy",
      "chunk_content": "We offer a 30-day money-back guarantee on all plans...",
      "similarity_score": 0.89
    }
  ]
}

POST /api/v1/chat/stream

Same as chat, but streams the response in real-time via Server-Sent Events (SSE).

# JavaScript example
const response = await fetch('https://livesupport365api.vpsmaker.net/api/v1/chat/stream', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ question: 'Tell me about pricing' })
});

const reader = response.body.getReader();
const decoder = new TextDecoder();

while (true) {
  const { done, value } = await reader.read();
  if (done) break;

  const lines = decoder.decode(value).split('\n');
  for (const line of lines) {
    if (line.startsWith('data: ')) {
      const data = JSON.parse(line.slice(6));
      if (data.type === 'token') {
        process.stdout.write(data.data); // Print each token
      }
    }
  }
}

GET /api/v1/knowledge/documents

List all documents in your knowledge base.

curl https://livesupport365api.vpsmaker.net/api/v1/knowledge/documents \
  -H "X-API-Key: YOUR_API_KEY"

# Response:
{
  "documents": [
    {"id": "abc", "filename": "faq.pdf", "status": "ready", "chunk_count": 24},
    {"id": "def", "filename": "policies.docx", "status": "ready", "chunk_count": 12}
  ],
  "total": 2
}
LiveSupport365 AI
Online - Ask me anything
Hello! I'm the LiveSupport365 AI assistant. Ask me anything about our product, pricing, or features!