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.

HTTP Request
POST /api/kb/url

Key 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

HeaderRequiredDescription
Content-TypeRequiredapplication/json
X-API-KeyRequiredYour agent API key

Request Parameters

ParameterTypeRequiredDescription
urlstringRequiredFull URL to scrape and sync
namestringOptionalCustom name (auto-generated from page title if omitted)
URL Uniqueness Per Agent

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

200 OK
{
  "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

400 Bad Request
{
  "status": false,
  "reason": "url is required"
}

URL format is invalid

400 Bad Request
{
  "status": false,
  "reason": "invalid URL format"
}

Invalid or missing API key

401 Unauthorized
{
  "status": false,
  "reason": "Invalid API key"
}

Insufficient credits

402 Payment Required
{
  "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.