API Reference

Integrate Gillya into your own applications with our REST API and SDK.

Docs.apiReference

Key API endpoints for chat, CRM, and campaign generation.

Chat API

POST /api/chat
Content-Type: application/json

{
  "message": "Хочу записатись на прийом",
  "locale": "uk",
  "conversationId": "123"
}

Response:
{
  "content": "Запишімо вас на прийом! Оберіть зручний час...",
  "toolCalls": []
}

CRM Sync API

POST /api/crm/sync
Content-Type: application/json
Authorization: Bearer <token>

{
  "name": "Іван Петров",
  "phone": "+380501234567",
  "service": "Ремонт взуття",
  "userId": 1
}

Campaign Generator API

POST /api/campaign-generator/generate
Content-Type: application/json
Authorization: Bearer <token>

{
  "clientAnswers": {
    "businessType": "Стоматологія",
    "geo": "Київ",
    "budget": 2000
  },
  "keywords": [
    { "keyword": "стоматолог київ", "volume": 1000 },
    { "keyword": "лікування зубів ціна", "volume": 500 }
  ]
}

Webhooks

Gillya supports incoming webhooks for external event handling.

Paddle Webhooks

# Paddle sends events to:
POST /api/paddle/webhook

# Handled events:
- subscription.created
- subscription.updated
- subscription.canceled
- adjustment.updated (refund)

CRM Sync Webhook

Configure your CRM to receive new leads via webhook when they are captured by the chat widget.

SDKs & Clients

Use Gillya programmatically with our SDKs and CLI.

JavaScript / TypeScript SDK

import { clusterKeywords, syncLeadToCRM, generateResponse } from 'gillya-sdk';

// Keyword clustering
const clusters = await clusterKeywords(keywords, pageUrls, { apiKey, model });

// Lead sync
const result = await syncLeadToCRM(leadData, userId);

// AI response
const response = await generateResponse(messages, context);

CLI (Command Line)

# Install globally
npm install -g gillya-cli

# Or via npx
npx -y gillya-cli ppc cluster --file keywords.csv

MCP (Model Context Protocol)

Connect any MCP-compatible client (Claude Desktop, VS Code, Cursor, Cline) to Gillya tools.

# Any MCP client can use Gillya tools
# Claude Desktop / VS Code config:

{
  "mcpServers": {
    "gillya": {
      "command": "gillya",
      "args": ["mcp"]
    }
  }
}