Documentation

Otoq Documentation

Everything you need to set up, train, and deploy your AI customer engagement agent. Pro plan users can also access the REST API for programmatic control.

Setup Guides

Getting Started
Create your first AI agent and embed it on your website in under 5 minutes.
  1. 1Sign up for a free account at getotoq.com
  2. 2Create an agent in the Dashboard → Agents page
  3. 3Add knowledge by crawling your website URL or uploading documents
  4. 4Copy the embed code from your agent's detail page
  5. 5Paste the script tag into your website's HTML before </body>
Training Your Agent
Feed your agent with business data so it can answer customer questions accurately.
  1. 1Go to Dashboard → Knowledge
  2. 2Choose a source type: URL, Text, or File Upload
  3. 3For URLs: enter your website URL — we'll crawl and extract content automatically
  4. 4For files: upload PDF, TXT, MD, or CSV files (up to 10MB)
  5. 5For text: paste FAQ answers, product descriptions, or policies directly
  6. 6Your agent will use this knowledge to answer customer questions
Embedding the Widget
Add the chat widget to any website with a single line of code.
  1. 1Go to Dashboard → Agents → select your agent
  2. 2Click the 'Embed' tab to find the embed code
  3. 3Copy the <script> tag
  4. 4Paste it into your website's HTML, just before the closing </body> tag
  5. 5The widget will appear as a chat bubble in the bottom-right corner
  6. 6Customize colors, position, and behavior from the agent settings
Managing Conversations
View and manage all customer conversations from your dashboard.
  1. 1Go to Dashboard → Conversations to see all chats
  2. 2Each conversation shows the visitor's messages and AI responses
  3. 3Conversations are automatically scored for sentiment
  4. 4When visitors request human help, you'll receive an email notification
  5. 5Use the search and filter options to find specific conversations
Lead Capture
Automatically capture visitor contact information from conversations.
  1. 1Lead capture is automatic — no setup needed
  2. 2When visitors share their email, name, or phone number in chat, it's captured as a lead
  3. 3View all leads in Dashboard → Leads
  4. 4Export leads as CSV for your CRM
  5. 5Set up webhooks (Starter+) to push leads to Zapier or your CRM in real-time
Analytics & Insights
Track your agent's performance and understand customer needs.
  1. 1Go to Dashboard → Analytics for an overview
  2. 2Free plan: view total conversations, messages, resolution rate, and leads
  3. 3Growth plan: unlock conversation trends, sentiment analysis, token usage, and agent performance
  4. 4Weekly email digest (Growth+) sends stats every Monday at 9am UTC
  5. 5Use insights to improve your knowledge base and agent training
Shopify IntegrationStarter+
Connect your Shopify store to automatically train your agent on product data.
  1. 1Go to Dashboard → Integrations
  2. 2Click 'Connect Shopify' and enter your store domain (e.g. mystore.myshopify.com)
  3. 3Authorize Otoq in Shopify's OAuth flow
  4. 4Select which agent should learn your product catalog
  5. 5Click 'Sync Products' — products become knowledge sources automatically
  6. 6Re-sync anytime to keep your agent up to date with inventory changes
Webhook Lead ExportStarter+
Push leads to your CRM, Zapier, or any tool via real-time webhooks.
  1. 1Go to Dashboard → Settings → Webhook section
  2. 2Enable webhooks and enter your endpoint URL (e.g. a Zapier webhook URL)
  3. 3Copy your webhook secret for signature verification (HMAC-SHA256)
  4. 4Test the webhook with the 'Test' button to verify it's working
  5. 5New leads will be pushed to your endpoint in real-time as JSON payloads
  6. 6Failed deliveries are automatically retried daily
Widget CustomizationStarter+
Match the chat widget to your brand with custom styling and behavior.
  1. 1Go to Dashboard → Agents → select agent → Settings tab
  2. 2Scroll to the 'Widget Customization' section
  3. 3Set widget position: bottom-right, bottom-left, or custom
  4. 4Choose a theme: light, dark, or auto (follows visitor's system preference)
  5. 5Configure auto-open triggers: on page load, after delay, or on scroll
  6. 6Enable pre-chat form to collect name/email/phone before the conversation starts

Webhook Payload Format

When a new lead is captured, Otoq sends a POST request to your configured webhook URL. The payload is signed using HMAC-SHA256 with your webhook secret (sent in the X-Webhook-Signature header).

POSTYour Webhook URL
{
  "event": "lead.captured",
  "timestamp": "2026-02-15T12:00:00.000Z",
  "data": {
    "id": "lead-uuid",
    "agent_id": "agent-uuid",
    "conversation_id": "conv-uuid",
    "name": "John Doe",
    "email": "john@example.com",
    "phone": "+1234567890",
    "company": "Acme Inc",
    "source": "chat",
    "score": 85,
    "created_at": "2026-02-15T12:00:00.000Z"
  }
}

Headers:

  • Content-Type: application/json
  • X-Webhook-Signature: sha256=... — HMAC-SHA256 of the body using your secret
  • X-Webhook-ID: evt_... — Unique event ID for deduplication

API ReferencePro Plan

Programmatically manage your agents, conversations, leads, and analytics. API access requires a Pro or Enterprise plan. Generate API keys in your Dashboard → Settings after signing in.

Download API Reference (.md)OpenAPI Spec (.json)

Feed the Markdown to your AI assistant, or use the OpenAPI spec to auto-generate SDKs with tools like openapi-generator.

Authentication

All API requests require a Bearer token in the Authorization header.

curl https://getotoq.com/api/v1/agents \
  -H "Authorization: Bearer otoq_your_api_key_here"

⚠️ Keep your API keys secret

Never expose API keys in client-side code. Use them only in server-to-server communication.

Base URL
https://getotoq.com/api/v1

All endpoints return JSON. Errors follow the format: { "error": "code", "message": "description" }

Rate Limits

API requests are rate limited to prevent abuse. Current limits:

  • 100 requests per minute per API key (sliding window)
  • Monthly conversation limits still apply per your plan

Rate Limit Headers

Every API response includes standard rate limit headers so you can track your usage:

X-RateLimit-Limit: 100        # Max requests per window
X-RateLimit-Remaining: 87     # Requests remaining
X-RateLimit-Reset: 1708099200 # Unix timestamp when window resets

429 Too Many Requests

When you exceed the limit, the API returns a 429 status with a Retry-After header:

HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1708099200

{
  "error": "rate_limited",
  "message": "Too many requests. Please slow down."
}

Endpoints

GET/api/v1/agents
List all your agents

Response:

{ "data": [{ "id": "...", "name": "...", "is_active": true, ... }], "meta": { "total": 3 } }
POST/api/v1/agents
Create a new agent

Request Body:

{ "name": "Support Bot", "personality": "friendly", "primary_color": "#6366f1" }

Response:

{ "data": { "id": "...", "name": "Support Bot", ... } }
GET/api/v1/agents/:id
Get a single agent with full details

Response:

{ "data": { "id": "...", "name": "...", "system_prompt": "...", ... } }
PATCH/api/v1/agents/:id
Update an agent

Request Body:

{ "name": "Updated Bot", "is_active": false }

Response:

{ "data": { "id": "...", "name": "Updated Bot", ... } }
DELETE/api/v1/agents/:id
Delete an agent

Response:

{ "success": true }
POST/api/v1/chat
Send a message and get an AI response (non-streaming)

Request Body:

{ "agent_id": "...", "message": "What are your return policies?", "conversation_id": "..." }

Response:

{ "data": { "conversation_id": "...", "response": "Our return policy...", "sources": [...] } }
GET/api/v1/conversations?agent_id=...&status=active&limit=50&offset=0
List conversations with pagination

Response:

{ "data": [...], "meta": { "total": 142, "limit": 50, "offset": 0 } }
GET/api/v1/conversations/:id
Get a conversation with all messages

Response:

{ "data": { "id": "...", "status": "active", "messages": [{ "role": "user", "content": "..." }, ...] } }
GET/api/v1/leads?agent_id=...&limit=50&offset=0
List captured leads with pagination

Response:

{ "data": [{ "id": "...", "email": "...", "name": "...", ... }], "meta": { "total": 28 } }
GET/api/v1/analytics?days=30
Get analytics summary for a time period

Response:

{ "data": { "total_conversations": 142, "total_leads": 28, "sentiment": { "positive": 80, ... } } }
Error Codes
StatusError CodeDescription
400validation_errorInvalid request body or parameters
401unauthorizedMissing, invalid, or expired API key
403forbiddenPlan does not include API access
404not_foundResource not found or not owned by you
429rate_limitedToo many requests
500internal_errorServer error — retry or contact support

Frequently Asked Questions

How does the AI know about my business?

You train it by adding knowledge sources — your website URL, documents, or text content. The AI uses this data to answer customer questions accurately using RAG (retrieval-augmented generation). It will never make up information.

What happens when the AI can't answer a question?

The AI will honestly tell the visitor it doesn't have that information and offer to connect them with a human. You'll receive an email notification when a handoff is requested.

Can I customize how the AI responds?

Yes! You can set the agent's personality (professional, friendly, casual, formal), provide custom system instructions, configure language preferences, and set a custom welcome message.

Is my data secure?

Yes. We use encryption in transit (TLS), row-level security policies in our database, rate limiting, and input sanitization. Your data is never used to train third-party AI models. See our Privacy Policy for full details.

What counts as a 'conversation'?

A conversation is a chat session between a visitor and your AI agent. Multiple messages within the same session count as one conversation. Each plan has a monthly conversation limit (50 free, 1K starter, 5K growth, 15K pro).

Can I use the widget on multiple websites?

Yes! Each agent has its own embed code. You can create multiple agents for different websites or use the same agent across multiple pages.

How does the Shopify integration work?

Otoq connects to your Shopify store via OAuth. It reads your product catalog (name, description, price, variants, images) and converts them into knowledge sources so your AI agent can answer product questions.

How do webhooks work?

When a new lead is captured, Otoq sends a POST request to your configured webhook URL with the lead data as JSON. Payloads are signed with HMAC-SHA256 for security. Failed deliveries are retried daily.

Need More Help?

Can't find what you're looking for? We're here to help.