Skip to main content

Get All Knowledges Based on Filters

Retrieves all knowledge entries for an agent based on specified filters.

API Endpoint

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

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/kb/knowledges' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"agent_id": "YOUR_AGENT_ID",
"filters": {
"source": "document",
"tags": ["important"],
"limit": 50,
"offset": 0
}
}'

Request Headers

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

Request Body

Request Body Schema

{
"agent_id": "string",
"filters": {
"source": "string",
"tags": ["string"],
"limit": "number",
"offset": "number"
}
}

Request Body Parameters

FieldTypeRequiredDescription
agent_idstringYesThe unique identifier of the AI agent.
filtersobjectNoFilter criteria for retrieving knowledge entries.
sourcestringNoFilter by knowledge source (e.g., "document", "text", "link").
tagsarrayNoFilter by tags associated with knowledge entries.
limitnumberNoMaximum number of results to return (default: 100).
offsetnumberNoNumber of results to skip for pagination (default: 0).

Response

Success Response (200 OK)

Returns an array of knowledge entries matching the filter criteria.

{
"is_success": true,
"total": 150,
"knowledges": [
{
"knowledge_id": "kb_1",
"content": "Knowledge entry content",
"source": "document",
"tags": ["tag1", "tag2"],
"created_at": "2024-01-12T10:00:00Z",
"updated_at": "2024-01-12T10:00:00Z"
}
],
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the retrieval was successful.
totalnumberTotal count of knowledge entries matching the filter.
knowledgesarrayArray of knowledge entry objects.
errorobjectError details if the operation failed (empty if successful).

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"agent_id"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
422Validation Error - Invalid request parametersUnprocessable Entity