Skip to main content
POST
/
agents
/
{agentId}
/
kb
Add Knowledge Base
curl --request POST \
  --url https://eu-cloudflare.vg-stuff.com/agents/{agentId}/kb \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "sourceType": "doc",
  "content": "<string>",
  "metadata": {
    "description": "<string>"
  },
  "tags": [
    "<string>"
  ],
  "refreshRate": "never",
  "sitemapUrl": "<string>",
  "urls": [
    "<string>"
  ],
  "maxPages": 123,
  "scrapeContent": true
}
'
{
  "success": true,
  "message": "<string>",
  "data": "<unknown>"
}

Example: Add Text Document

{
  "name": "Product FAQ",
  "sourceType": "doc",
  "content": "Your product FAQ content here...",
  "metadata": {
    "description": "Frequently asked questions about our product"
  },
  "tags": ["faq", "product"]
}

Example: Add URLs

{
  "name": "Website Pages",
  "sourceType": "url",
  "urls": [
    "https://example.com/about",
    "https://example.com/pricing"
  ],
  "scrapeContent": true,
  "refreshRate": "3d"
}

Example: Crawl Sitemap

{
  "name": "Full Website",
  "sourceType": "sitemap",
  "sitemapUrl": "https://example.com/sitemap.xml",
  "maxPages": 100,
  "scrapeContent": true,
  "refreshRate": "7d"
}
URL and sitemap sources may take time to process. Check document status via GET /agents/{agentId}/kb/{docId}.
Set refreshRate to automatically re-crawl URL sources. Options: 3d, 7d, or never.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agentId
string
required

Body

application/json
name
string
required
sourceType
enum<string>
required
Available options:
doc,
url,
sitemap
content
string
metadata
object
tags
string[]
refreshRate
enum<string>
default:never
Available options:
3d,
7d,
never
sitemapUrl
string
urls
string[]
maxPages
number
scrapeContent
boolean

Response

Successful response

success
boolean
required
message
string
required
data
any