zpk.

Documentation

Learn how to connect varying data sources, customize your AI's persona, and deploy the chat widget on your platform using our extensive set of guides.

Introduction

Welcome to ZPK Digital's developer documentation. Our platform is designed to effortlessly transform your unstructured company data into a highly intelligent, conversational AI assistant that can be embedded anywhere.

Whether you are a no-code marketer trying to put a widget on a WordPress site, or an engineer building a custom React application with our REST APIs, this documentation holds everything you need.

API Keys & Workspaces
Every bot you create belongs to a Workspace. API Keys are generated per Workspace. Ensure you are looking at the correct workspace when performing API testing.

Quickstart Guide

Going from zero to a live AI agent takes less than 5 minutes. The process is completely streamlined into three major steps:

  1. Initialize: Create an account and add a new Bot Instance. Give your agent a name that suits your brand tone.
  2. Feed Data: Paste the URL of your website's sitemap. The crawler will ingest your pages.
  3. Deploy: Copy the generated JS snippet from your dashboard and paste it inside the <head> element of your website.

For a detailed breakdown of these steps, please visit our Full Getting Started Guide.

Architecture

Underneath the hood, ZPK Digital leverages a sophisticated Retrieval-Augmented Generation (RAG) architecture powered by Gemini 2.5.

How your data flows

  • Ingestion: When you provide a website or text file, our pipeline converts this text into high-dimensional vector embeddings.
  • Storage: These vectors are securely isolated in a vector database tied strictly to your workspace's unique ID.
  • Retrieval: When a user asks a question, we convert their query to a vector, find the most relevant chunks in your database, and inject it into the LLM context to formulate the final answer.

Website Syncing

The easiest way to train your AI is to simply provide your website's domain or XML sitemap. We handle the web crawling, scraping, and cleaning.

Sitemaps vs Direct URLs

Providing a direct URL (like https://example.com) will tell our system to recursively find links. However, providing a direct sitemap (like https://example.com/sitemap.xml) is highly recommended as it ensures all hidden pages are indexed, and prevents loops.

Auto-Sync Feature
Business and Enterprise tier accounts feature daily Auto-syncing. If you update your blog or documentation on your site, the AI will automatically re-read it without your interaction.

PDF & File Upload

Not all company knowledge is public on a website. Often, internal manuals, HR handbooks, or specific product sheets are physical files. You can drag and drop these directly to your Bot's memory banks.

Supported Formats

Format Extensions Parsing Efficiency
PDF Documents .pdf Excellent (Text-based preferred over scans)
Markdown .md, .mdx Flawless (Highly recommended)
Plain Text .txt, .csv Excellent
Word Documents .doc, .docx Good

Persona & Context

Your AI shouldn't sound like a generic robot. By using the "Base Prompt" (System Instructions) setting, you can heavily influence the style and rules of the conversation.

Writing a great System Prompt

Be explicit about who the bot is, the tone it should use, and what it MUST NOT do.

Example Prompt
You are an expert, highly energetic customer support agent for ZPK Digital.
Your name is 'Nova'. 
Always answer in short, concise paragraphs. 
Use emojis occasionally to match a friendly startup vibe. 
NEVER guarantee a refund unless the specific knowledge base allows it.
If you do not know the answer, say exactly: "Let me connect you to a human expert."

Script Installation

The standard way to provide an AI chat interface to your users is by rendering our native JavaScript widget. The widget script is asynchronous and weighs under 40kb, meaning it has zero impact on your site's SEO speeds.

HTML5 Script
<!-- Ensure you place this before the closing  tag -->
<script 
    src="https://cdn.zpkdigital.com/widget/v2/chat.min.js" 
    data-bot-id="YOUR_BOT_UUID_HERE"
    data-auto-open="false"
    defer>
</script>

Widget Styling

You can change the primary colors, avatar images, and welcome messages via the Dashboard UI. However, if you are a developer, our widget allows for deep CSS overrides.

By defining standard CSS classes in your native stylesheet, you can overwrite the widget's layout:

CSS
/* Override the floating toggle button */
.zpk-widget-btn {
    bottom: 40px !important;
    right: 40px !important;
    border-radius: 50% !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5) !important;
}

/* Force the chat window to be completely dark mode */
.zpk-chat-window {
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
}

API Integration

If you prefer to build your own chat interface (for instance, inside a React Native mobile app), you can talk to your trained AI using our REST API directly.

POST /api/v1/chat/completion

Pass your user's message alongside your API key in the authorization header.

CURL
curl -X POST https://api.zpkdigital.com/v1/chat/completion \
  -H "Authorization: Bearer zpk_live_your_secret_token" \
  -H "Content-Type: application/json" \
  -d '{
    "bot_id": "YOUR_BOT_UUID_HERE",
    "messages": [
      {
        "role": "user",
        "content": "What are your pricing plans?"
      }
    ],
    "stream": false
  }'

We provide comprehensive JSON responses including citation sources, confidence scores, and token usage metrics.

Full API Reference
For a complete breakdown of endpoints, webhooks, and rate limits, view the dedicated Developer API docs.