KB URL Sync API
Automatically synchronize website content to your agent's knowledge base. This API creates or updates KB entries, perfect for CMS webhooks, scheduled updates, and CI/CD pipelines.
/api/kb/urlKey Features
Auto Upsert
Automatically creates or updates KB entries. No duplicates.
Zero Downtime
Old content stays active while new content processes.
Unique URLs
Each agent can only have one resource per URL.
Request Headers
| Header | Required | Description |
|---|---|---|
| Content-Type | Required | application/json |
| X-API-Key | Required | Your agent API key |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Required | Full URL to scrape and sync |
| name | string | Optional | Custom name (auto-generated from page title if omitted) |
Each agent can only have ONE resource per URL. If you sync the same URL again, it will UPDATE the existing resource instead of creating a new one. This ensures no duplicate URLs in your knowledge base.
Request Example
curl -X POST https://api.aksita.ai/api/kb/url \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"url": "https://example.com/pricing",
"name": "Pricing Information"
}'Success Response
{
"status": true,
"data": {
"resource": {
"id": 123,
"name": "Pricing Information",
"url": "https://example.com/pricing",
"status": "training",
"credits": 4,
"remaining_credits": 1111,
"created_at": "2026-01-22T10:30:00Z"
}
},
"detail": "URL queued for processing"
}Processing Status
The resource status will be "training" initially. It will change to "completed" once the URL is scraped, processed, and added to the knowledge base. This typically takes 10-60 seconds depending on the page size.
Error Responses
URL is missing or empty
{
"status": false,
"reason": "url is required"
}URL format is invalid
{
"status": false,
"reason": "invalid URL format"
}Invalid or missing API key
{
"status": false,
"reason": "Invalid API key"
}Insufficient credits
{
"status": false,
"reason": "Insufficient credits"
}Common Use Cases
CMS Webhooks
Trigger KB sync automatically when content is published in WordPress, Strapi, or any CMS with webhook support.
Scheduled Updates
Use cron jobs or scheduled tasks to sync KB daily, keeping your agent updated with the latest website content.
CI/CD Pipelines
Integrate KB sync into your deployment pipeline to update knowledge base automatically after website deployments.
Bulk Updates
Loop through multiple URLs to sync entire website sections in one batch, perfect for initial setup or major updates.