ENDPOINTS

BASE URL
https://api.chatifix.com

POST Register & Get API Key

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

# 1. Register
curl -X POST https://api.chatifix.com/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Company",
    "email": "[email protected]",
    "password": "secure_password_123"
  }'

# 2. Create API Key (use the token from registration)
curl -X POST https://api.chatifix.com/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://api.chatifix.com/api/v1/auth/register", json={
    "name": "My Company",
    "email": "[email protected]",
    "password": "secure_password_123"
})
token = resp.json()["access_token"]

# Create API Key
resp = requests.post("https://api.chatifix.com/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://api.chatifix.com/api/v1/auth/register', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name: 'My Company',
    email: '[email protected]',
    password: 'secure_password_123'
  })
});
const { access_token } = await resp.json();

// Create API Key
const keyResp = await fetch('https://api.chatifix.com/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://api.chatifix.com/api/v1/auth/register",
    new { name = "My Company",
          email = "[email protected]",
          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://api.chatifix.com/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://api.chatifix.com/api/v1/knowledge/upload \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file=@company_faq.pdf"
import requests

with open("company_faq.pdf", "rb") as f:
    resp = requests.post(
        "https://api.chatifix.com/api/v1/knowledge/upload",
        headers={"X-API-Key": "YOUR_API_KEY"},
        files={"file": f}
    )
print(resp.json())
const formData = new FormData();
formData.append('file', fileInput.files[0]);

const resp = await fetch('https://api.chatifix.com/api/v1/knowledge/upload', {
  method: 'POST',
  headers: { 'X-API-Key': 'YOUR_API_KEY' },
  body: formData
});
const data = await resp.json();
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");

using var content = new MultipartFormDataContent();
using var fileStream = File.OpenRead("company_faq.pdf");
content.Add(new StreamContent(fileStream), "file", "company_faq.pdf");

var resp = await client.PostAsync(
    "https://api.chatifix.com/api/v1/knowledge/upload", content);

POST /api/v1/knowledge/text

Add raw text directly to the knowledge base.

curl -X POST https://api.chatifix.com/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..."}'
resp = requests.post(
    "https://api.chatifix.com/api/v1/knowledge/text",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={"title": "Return Policy",
          "content": "We offer a 30-day money-back guarantee..."}
)
const resp = await fetch('https://api.chatifix.com/api/v1/knowledge/text', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    title: 'Return Policy',
    content: 'We offer a 30-day money-back guarantee...'
  })
});
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");

var resp = await client.PostAsJsonAsync(
    "https://api.chatifix.com/api/v1/knowledge/text",
    new { title = "Return Policy",
          content = "We offer a 30-day money-back guarantee..." });

POST /api/v1/chat

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

curl -X POST https://api.chatifix.com/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", "similarity_score": 0.89 }]
}
resp = requests.post(
    "https://api.chatifix.com/api/v1/chat",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={"question": "What is your return policy?"}
)
data = resp.json()
print(data["answer"])
const resp = await fetch('https://api.chatifix.com/api/v1/chat', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ question: 'What is your return policy?' })
});
const { answer, sources } = await resp.json();
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");

var resp = await client.PostAsJsonAsync(
    "https://api.chatifix.com/api/v1/chat",
    new { question = "What is your return policy?" });
var data = await resp.Content.ReadFromJsonAsync<JsonElement>();
Console.WriteLine(data.GetProperty("answer"));

POST /api/v1/chat/stream

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

curl -N -X POST https://api.chatifix.com/api/v1/chat/stream \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question": "Tell me about pricing"}'
import requests, json

resp = requests.post(
    "https://api.chatifix.com/api/v1/chat/stream",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={"question": "Tell me about pricing"},
    stream=True
)

for line in resp.iter_lines():
    if line.startswith(b"data: "):
        data = json.loads(line[6:])
        if data["type"] == "token":
            print(data["data"], end="")
const response = await fetch('https://api.chatifix.com/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') document.write(data.data);
    }
  }
}
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");

var request = new HttpRequestMessage(HttpMethod.Post,
    "https://api.chatifix.com/api/v1/chat/stream");
request.Content = JsonContent.Create(new { question = "Tell me about pricing" });

using var resp = await client.SendAsync(request,
    HttpCompletionOption.ResponseHeadersRead);
using var stream = await resp.Content.ReadAsStreamAsync();
using var reader = new StreamReader(stream);
while (!reader.EndOfStream) {
    var line = await reader.ReadLineAsync();
    if (line?.StartsWith("data: ") == true)
        Console.Write(line[6..]);
}

GET /api/v1/knowledge/documents

List all documents in your knowledge base.

curl https://api.chatifix.com/api/v1/knowledge/documents \
  -H "X-API-Key: YOUR_API_KEY"
resp = requests.get(
    "https://api.chatifix.com/api/v1/knowledge/documents",
    headers={"X-API-Key": "YOUR_API_KEY"}
)
for doc in resp.json()["documents"]:
    print(doc["filename"], doc["status"])
const resp = await fetch('https://api.chatifix.com/api/v1/knowledge/documents', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const { documents, total } = await resp.json();
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");

var resp = await client.GetAsync(
    "https://api.chatifix.com/api/v1/knowledge/documents");
var data = await resp.Content.ReadFromJsonAsync<JsonElement>();
CHATIFIX AI
Online - Ask me anything
Hello! I'm the CHATIFIX AI assistant. Ask me anything about our product, pricing, or features!