Create a Chatbot
Build an AI chatbot that answers questions based on your content. Add knowledge sources from URLs, sitemaps, or uploaded documents, then embed it on your site.
What you are building
A chatbot with RAG (retrieval-augmented generation) that reads your content, indexes it into a vector database, and answers user questions with source citations.
When to use this approach
- Customer support automation
- Documentation assistant
- Internal knowledge base search
- Website FAQ bot
If you need direct LLM API access without a knowledge base, use the LLM API instead.
What you need
- A WAYSCloud account
- Content to index (website URL, sitemap, or documents)
Step 1 — Create the bot
Dashboard
- Open Services → AI & Machine Learning → Chatbot in the dashboard
- Click Create Bot
- Fill in name, purpose, and branding (colors, welcome message)
- Select a plan
- Add your first knowledge source (URL or upload)
API
bash
curl -X POST https://api.wayscloud.services/v1/dashboard/chatbot/bots \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Support Bot",
"slug": "support-bot",
"language": "en",
"purpose": "customer_support",
"source_type": "url",
"url": "https://docs.example.com",
"display_name": "Support Assistant",
"welcome_message": "How can I help you today?",
"primary_color": "#2563eb",
"selected_plan": "CHATBOT-BUSINESS"
}'Response:
json
{
"id": "bot-abc123",
"name": "Support Bot",
"status": "draft",
"public_token": "wayscloud_cb_abc123_full_token...",
"source_count": 1,
"created_at": "2025-12-15T10:00:00Z"
}Save the public_token — it is only shown once.
Step 2 — Add knowledge sources
Add additional content for the bot to learn from:
Add a URL:
bash
curl -X POST https://api.wayscloud.services/v1/dashboard/chatbot/bots/bot-abc123/sources \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"source_type": "sitemap",
"url": "https://example.com/sitemap.xml",
"title": "Main Website",
"refresh_interval_hours": 24
}'Upload a document:
bash
curl -X POST https://api.wayscloud.services/v1/dashboard/chatbot/bots/bot-abc123/sources/upload \
-H "Authorization: Bearer $JWT_TOKEN" \
-F "file=@product-guide.pdf"Sources are indexed automatically. Monitor progress:
bash
curl https://api.wayscloud.services/v1/dashboard/chatbot/bots/bot-abc123/health \
-H "Authorization: Bearer $JWT_TOKEN"Step 3 — Test and activate
Test the bot before going live:
bash
curl -X POST https://api.wayscloud.services/v1/dashboard/chatbot/bots/bot-abc123/test-chat \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "What is your return policy?"}'Response:
json
{
"message": "Based on our documentation, the return policy allows...",
"sources": [
{"title": "Returns & Refunds", "url": "https://example.com/returns", "relevance": 0.95}
]
}When satisfied, activate:
bash
curl -X POST https://api.wayscloud.services/v1/dashboard/chatbot/bots/bot-abc123/activate \
-H "Authorization: Bearer $JWT_TOKEN"Step 4 — Next steps
- Embed on your site — Use the public token to add the chat widget
- Monitor analytics —
GET /bots/{id}/analyticsfor session counts and feedback - Tune behavior — Adjust
temperature,max_tokens, andsystem_prompt - Add guidance — Use
help_textandavoid_textto steer responses - Rotate token —
POST /bots/{id}/rotate-tokenif the token is compromised
Related services
- Chatbot (CaaS) — full service documentation
- LLM API — direct language model access
- Object Storage — store knowledge base documents
Related guides
- Authentication — API key setup
API reference
- Chatbot API — all chatbot endpoints