curl --request POST \
--url https://gateway.widebot.net/api/AIKnowledge/{botId} \
--header 'Content-Type: application/json' \
--header 'x-bot: <api-key>' \
--header 'x-user-auth: <api-key>' \
--data '
{
"title": "API Documentation",
"description": "Wikipedia API documentation",
"KnowledgeSource": 1,
"SourceContent": [
"https://en.wikipedia.org/wiki/API"
]
}
'{
"StatusCode": 200,
"Response": {},
"Consumption": "147/10000000"
}Register Knowledge Unit
Register a new knowledge unit (file or URL) to your bot’s knowledge base for indexing.
Supported Sources:
- URLs (KnowledgeSource = 1): Web pages, documentation, articles
- Files (KnowledgeSource = 0): PDF, DOCX, TXT, and other document formats
Process:
- For files: First upload the file via “Upload File” (POST /api/UploadBlob)
- Create a knowledge unit with file details or URL
- System automatically indexes the content
- Content becomes available for RAG queries
Note: Example requests/responses shown here are illustrative. When using the live “Try it” tool, you may see two responses: an HTTP status preview and the API’s JSON body.
POST
/
api
/
AIKnowledge
/
{botId}
curl --request POST \
--url https://gateway.widebot.net/api/AIKnowledge/{botId} \
--header 'Content-Type: application/json' \
--header 'x-bot: <api-key>' \
--header 'x-user-auth: <api-key>' \
--data '
{
"title": "API Documentation",
"description": "Wikipedia API documentation",
"KnowledgeSource": 1,
"SourceContent": [
"https://en.wikipedia.org/wiki/API"
]
}
'{
"StatusCode": 200,
"Response": {},
"Consumption": "147/10000000"
}Authorizations
Your API key from account settings
Your bot ID from account settings
Path Parameters
Bot ID to add knowledge to
Body
application/json
Title for the knowledge entry
Example:
"API Documentation"
Source type for the knowledge
Available options:
0, 1 Example:
1
Array of URLs (when KnowledgeSource = 1)
Example:
["https://en.wikipedia.org/wiki/API"]
Description of the knowledge content
Example:
"API documentation for testing"
Was this page helpful?

