Get All Knowledges Based on Filters
Retrieves all knowledge entries for an agent based on specified filters.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://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
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
| Content-Type | application/json | Yes | Data 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
| Field | Type | Required | Description |
|---|---|---|---|
| agent_id | string | Yes | The unique identifier of the AI agent. |
| filters | object | No | Filter criteria for retrieving knowledge entries. |
| source | string | No | Filter by knowledge source (e.g., "document", "text", "link"). |
| tags | array | No | Filter by tags associated with knowledge entries. |
| limit | number | No | Maximum number of results to return (default: 100). |
| offset | number | No | Number 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
| Field | Type | Description |
|---|---|---|
| is_success | boolean | Indicates whether the retrieval was successful. |
| total | number | Total count of knowledge entries matching the filter. |
| knowledges | array | Array of knowledge entry objects. |
| error | object | Error 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 Code | Description | Response Type |
|---|---|---|
| 200 | Successful Response | Success |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |