Skip to main content

Process External Links for Knowledge Base

Used to accept URLs or links to external content, which will then be crawled, processed, and indexed into the knowledge base. This allows the AI to draw information from web pages or online resources.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/kb/link

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/kb/link' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"project_key": "YOUR_PROJECT_KEY",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"link": "https://example.com/documentation/getting-started",
"allow_recursive": true
}'

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"project_key": "string",
"agent_id": "string",
"link": "string",
"allow_recursive": false
}

Request Body Parameters

FieldTypeRequiredDescription
project_keystringYesThe project key for your project.
agent_idstringYesUUID of the AI agent to associate the content with.
linkstringYesValid URL of the external content to crawl and process.
allow_recursivebooleanNoWhether to recursively crawl linked pages from the provided URL. Default: false.
note

Recursive Crawling

  • When allow_recursive is set to true, the system will follow links on the provided page and crawl related content within the same domain.
  • Be cautious with recursive crawling on large websites, as it may take considerable time and resources to process.
tip

External links are useful for:

  • Ingesting product documentation from your website
  • Adding knowledge from blog posts or articles
  • Incorporating information from public knowledge bases
  • Keeping your agent updated with the latest web content

Response

Success Response (200 OK)

Returns an object containing the processing status.

{
"is_success": true,
"detail": "Link content crawled and added to knowledge base successfully",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the link processing was successful.
detailstringSuccess or failure message with additional context.
errorobjectError details if the operation failed (empty if successful).
warning

The crawling and processing of external links may take time depending on:

  • The size and complexity of the content
  • Whether recursive crawling is enabled
  • The responsiveness of the external website
  • The number of pages to be processed

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"link"
],
"msg": "invalid or missing URL scheme",
"type": "value_error.url.scheme"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
400Bad Request - Invalid URL or crawling errorBad Request
422Validation Error - Invalid request parametersUnprocessable Entity
504Gateway Timeout - External site not respondingGateway Timeout