Quickstart
Go from an empty account to a persona answering on your website. You can do every step in the console; the API calls are shown for automation.
Set up your first persona
Create a knowledge base
A knowledge base holds the content for one persona. Choose its main language: Arabic or English.
curl -X POST "https://avatar-api.syntiva.tech/knowledge-bases" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "Customer service", "language": "ar"}'Upload a document
Upload a PDF, Word file, spreadsheet or text file. Servly extracts the text (with OCR for scans), then generates question-and-answer pairs in the background.
cURL curl -X POST "https://avatar-api.syntiva.tech/documents?knowledge_base_id=KB_ID" \ -H "X-API-Key: YOUR_API_KEY" \ -F "file=@./service-guide.pdf"Index the answers
Sync the knowledge base's Q&A pairs into its search index. New pairs added later through the console or the gap workflow are indexed automatically.
cURL curl -X POST "https://avatar-api.syntiva.tech/workflows/vectorize-sync?knowledge_base_id=KB_ID" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{}'Ask a question
Query the knowledge base. The response contains the matched answer and the other close candidates. Use the console's playground for the same test without code.
cURL curl -X POST "https://avatar-api.syntiva.tech/query?knowledge_base_id=KB_ID" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "What are your opening hours?"}'Embed the widget
Enable the widget for the knowledge base in the console, add your site's domain to the allow-list, and copy the embed code. It uses the public widget key, never your API key.
HTML <script src="https://avatar-cdn.syntiva.tech/v1/YOUR_WIDGET_KEY/avatar-widget.iife.js"></script> <avatar-widget api-url="https://avatar-api.syntiva.tech" widget-key="YOUR_WIDGET_KEY"></avatar-widget>
Next steps
- Review generated answers and close knowledge gaps.
- Build your first e-service with the workflow engine.
- Customize position, theme and colors in the widget reference.
Replace KB_ID, YOUR_API_KEY and YOUR_WIDGET_KEY with your own values from the console.