API Reference

Complete REST API documentation for Novumdesk

Authentication

Novumdesk API uses Bearer token authentication. Include your API token in the Authorization header.

Authorization: Bearer YOUR_API_TOKEN

Get API Token

Generate an API token from your account settings: Settings → API → Generate Token

Tickets

List Tickets

GET /api/v1/tickets
Authorization: Bearer YOUR_API_TOKEN

Query Parameters:

  • page - Page number (default: 1)
  • per_page - Items per page (default: 20)
  • status - Filter by status (open, closed, etc.)

Get Ticket

GET /api/v1/tickets/{id}
Authorization: Bearer YOUR_API_TOKEN

Create Ticket

POST /api/v1/tickets
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "subject": "Support Request",
  "description": "I need help with...",
  "priority": "medium",
  "customer_email": "customer@example.com"
}

Update Ticket

PUT /api/v1/tickets/{id}
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "status": "resolved",
  "priority": "high"
}

Users

List Users

GET /api/v1/users
Authorization: Bearer YOUR_API_TOKEN

Get User

GET /api/v1/users/{id}
Authorization: Bearer YOUR_API_TOKEN

Agents

List Agents

GET /api/v1/agents
Authorization: Bearer YOUR_API_TOKEN

Webhooks

Set up webhooks to receive real-time notifications about events in your Novumdesk instance.

Create Webhook

POST /api/v1/webhooks
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "url": "https://your-app.com/webhook",
  "events": ["ticket.created", "ticket.updated"],
  "secret": "your_webhook_secret"
}

Available Events

  • ticket.created
  • ticket.updated
  • ticket.resolved
  • ticket.closed

Chat & AI Chatbots

Integrate AI-powered chatbots using Ollama models. Chatbots can be trained on product documents for intelligent customer support.

Send Chat Message

POST /api/v1/chat/message
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "message": "What are your product features?",
  "chatbot_id": "chatbot_123",
  "session_id": "session_456",
  "context": {
    "ticket_id": "ticket_789"
  }
}

Response:

{
  "response": "Our platform includes ticket management, live chat, knowledge base, and API integrations...",
  "session_id": "session_456",
  "confidence": 0.95,
  "sources": ["product_doc_1", "product_doc_2"]
}

Create Chatbot

POST /api/v1/chatbots
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "name": "Product Support Bot",
  "model": "llama3",
  "ollama_endpoint": "http://localhost:11434",
  "temperature": 0.7,
  "max_tokens": 1000,
  "product_documents": ["doc_1", "doc_2"]
}

List Chatbots

GET /api/v1/chatbots
Authorization: Bearer YOUR_API_TOKEN

Get Chatbot

GET /api/v1/chatbots/{id}
Authorization: Bearer YOUR_API_TOKEN

Update Chatbot

PUT /api/v1/chatbots/{id}
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "name": "Updated Bot Name",
  "temperature": 0.8,
  "product_documents": ["doc_1", "doc_2", "doc_3"]
}

Delete Chatbot

DELETE /api/v1/chatbots/{id}
Authorization: Bearer YOUR_API_TOKEN

Document Review & Training

Upload and review product documents to train AI chatbots. Documents are processed using Ollama models for intelligent understanding.

Upload Document

POST /api/v1/documents
Authorization: Bearer YOUR_API_TOKEN
Content-Type: multipart/form-data

Form Data:
  file: (binary file)
  title: "Product Manual"
  category: "product"
  description: "Product features and specifications"
  train_ai: true

Supported formats: PDF, DOCX, TXT, MD

Response:

{
  "id": "doc_123",
  "title": "Product Manual",
  "status": "processing",
  "training_status": "pending"
}

Review Document with Ollama

POST /api/v1/documents/{id}/review
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "model": "llama3",
  "ollama_endpoint": "http://localhost:11434",
  "prompt": "Extract key product features and specifications",
  "extract_entities": true
}

Response:

{
  "summary": "This document describes...",
  "key_features": ["Feature 1", "Feature 2"],
  "entities": {
    "products": ["Product A", "Product B"],
    "features": ["Feature 1", "Feature 2"]
  },
  "confidence": 0.92
}

Train AI on Product Documents

POST /api/v1/documents/train
Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

{
  "document_ids": ["doc_1", "doc_2", "doc_3"],
  "chatbot_id": "chatbot_123",
  "model": "llama3",
  "ollama_endpoint": "http://localhost:11434",
  "training_type": "rag",
  "chunk_size": 1000,
  "overlap": 200
}

Response:

{
  "training_id": "train_456",
  "status": "processing",
  "documents_processed": 0,
  "total_documents": 3,
  "estimated_completion": "2024-01-15T10:30:00Z"
}

Get Training Status

GET /api/v1/documents/train/{training_id}
Authorization: Bearer YOUR_API_TOKEN

List Documents

GET /api/v1/documents
Authorization: Bearer YOUR_API_TOKEN

Query Parameters:
  category: product
  status: processed
  page: 1
  per_page: 20

Get Document

GET /api/v1/documents/{id}
Authorization: Bearer YOUR_API_TOKEN

Delete Document

DELETE /api/v1/documents/{id}
Authorization: Bearer YOUR_API_TOKEN

Ollama Integration

Novumdesk integrates with Ollama for local AI model inference. Supported models include:

  • llama3, llama3.1, llama3.2
  • mistral, mistral-nemo
  • phi3, phi3.5
  • qwen2, qwen2.5
  • gemma2

Note: Ensure Ollama is running and accessible at your specified endpoint. Default is http://localhost:11434.