← Back to Guides

Integrating 0xDoktor With Existing Systems: CMS, Help Desks, and Custom Pipelines

Integration overview

0xDoktor is designed to fit into existing systems rather than replace them. This guide covers three integration patterns:

  1. Push connector: automatically sync content from your CMS or database into the knowledge base
  2. REST API: query the chat engine programmatically from your own application
  3. SSE streaming: stream answers token-by-token for low-latency chat UIs

Pattern 1: Webhook push connector

The push connector is the recommended integration for keeping your knowledge base in sync with a CMS, wiki, or documentation platform.

How it works

Your system sends a POST request to 0xDoktor whenever content is created or updated. 0xDoktor ingests the document, creates embeddings, and makes it immediately available for answering questions.

Request format

POST https://api.0xdoktor.com/api/connectors/push/YOUR_TENANT_ID
X-Webhook-Secret: YOUR_HMAC_SHARED_SECRET
Content-Type: application/json

{
  "documents": [
    {
      "slug": "unique-doc-identifier",
      "title": "How to reset your password",
      "content": "Full markdown or plain text content...",
      "sourceHash": "sha256-of-content-for-dedup"
    }
  ]
}

Authentication

The X-Webhook-Secret header is an HMAC-SHA256 signature of the request body using a shared secret. Configure the shared secret in the admin dashboard under Connectors → Push.

Deduplication with sourceHash

Provide a sourceHash (SHA-256 of the document content) to prevent unnecessary re-indexing. If the hash matches an existing document version, 0xDoktor skips re-ingestion — no charges, no latency.

Deleting documents

To remove a document from the knowledge base:

{
  "documents": [
    { "slug": "doc-to-delete", "deleted": true }
  ]
}

Pattern 2: REST API integration

For custom chat UIs, backend integrations, or automated testing, query the chat engine directly.

Basic request

POST https://api.0xdoktor.com/chat
Content-Type: application/json
Authorization: Bearer YOUR_JWT_TOKEN

{
  "tenantId": "your-tenant-id",
  "knowledgeBaseId": "your-kb-id",
  "question": "How do I reset my password?",
  "conversationId": "conv_abc123"
}

Response

{
  "status": "succeeded",
  "data": {
    "answer": "To reset your password, go to Settings → Security...",
    "confidence": 0.87,
    "sources": [
      { "slug": "password-reset", "chunkIndex": 2 }
    ],
    "warnings": []
  }
}

Error handling

All responses follow the canonical envelope: status: "succeeded" or status: "failed", with errors[] (plural) for failures. Never attempt to parse a raw error string — always read errors[0].code for programmatic handling.

Pattern 3: SSE streaming

For chat UIs that need real-time token streaming:

POST https://api.0xdoktor.com/v1/chat/stream
Content-Type: application/json
Authorization: Bearer YOUR_JWT_TOKEN

{ "tenantId": "...", "question": "..." }

The response is an SSE stream:

  • event: chunk — individual text token
  • event: metadata — final event with { runId, confidence, sources, warnings }

Handling the stream in JavaScript

const response = await fetch("https://api.0xdoktor.com/v1/chat/stream", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${token}`
  },
  body: JSON.stringify({ tenantId, question })
});

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.chunk) appendToUI(data.chunk);
      if (data.metadata) handleMetadata(data.metadata);
    }
  }
}

Integrating with specific platforms

Notion

Use a Notion webhook or scheduled export to push page content to the push connector. Export pages as plain text or Markdown for best ingestion results.

Confluence

Confluence's webhook system fires on page create/update events. Configure a serverless function (Vercel, AWS Lambda) to receive the Confluence webhook, extract the page body, and forward it to 0xDoktor's push connector.

GitHub (documentation repos)

Use a GitHub Actions workflow triggered on push to docs/**:

- name: Push docs to 0xDoktor
  run: |
    for file in docs/*.md; do
      slug=$(basename "$file" .md)
      content=$(cat "$file")
      curl -X POST https://api.0xdoktor.com/api/connectors/push/$TENANT_ID \
        -H "X-Webhook-Secret: $DOKTOR_WEBHOOK_SECRET" \
        -H "Content-Type: application/json" \
        -d "{\"documents\":[{\"slug\":\"$slug\",\"content\":\"$content\"}]}"
    done

Help desks (Zendesk, Intercom)

Use the REST API to query 0xDoktor from within your help desk's answer suggestion feature. When an agent views a ticket, trigger a background query with the ticket subject line. Surface the top answer in the agent's sidebar panel.

See 0xDoktor in action — ask anything about this page: