Skip to main content

Get All Knowledges Based on Filters

Used to retrieve a list of knowledge base entries based on specified filter criteria, including pagination, type filtering, search, and status 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 '{
"is_disabled": false,
"is_archived": false,
"project_key": "YOUR_PROJECT_KEY",
"limit": 50,
"offset": 0,
"kb_type": "qa",
"search": "password reset",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"ids": ["kb_001", "kb_002"]
}'

Request Headers

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

Request Body

Request Body Schema

{
"is_disabled": true,
"is_archived": true,
"project_key": "string",
"limit": 100,
"offset": 0,
"kb_type": "string",
"search": "string",
"agent_id": "string",
"ids": ["string"]
}

Request Body Parameters

FieldTypeRequiredDescription
is_disabledbooleanNoFilter by disabled status. true returns only disabled entries, false returns only active entries.
is_archivedbooleanNoFilter by archived status. true returns only archived entries, false returns only non-archived entries.
project_keystringYesThe project key for your project.
limitintegerNoMaximum number of knowledge entries to return. Default: 100.
offsetintegerNoNumber of entries to skip for pagination. Default: 0.
kb_typestringNoFilter by knowledge type (e.g., file, text, qa, link).
searchstringNoSearch term to filter entries by content or metadata.
agent_idstringNoUUID of the AI agent to filter knowledge entries by.
idsarrayNoArray of specific knowledge base IDs to retrieve.
note

All filter parameters are optional except project_key. If no filters are provided, the endpoint returns all knowledge entries within the specified project, subject to pagination limits.

Response

Success Response (200 OK)

Returns an object containing an array of knowledge base entries and the total count.

{
"knowledge_bases": [
{
"kb_id": "kb_001",
"type": "qa",
"question": "How do I reset my password?",
"content": "To reset your password, click on the Forgot Password link on the login page...",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"is_disabled": false,
"is_archived": false,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z",
"metadata": {
"source": "user_submission",
"category": "account_management"
}
},
{
"kb_id": "kb_002",
"type": "text",
"content": "Our platform supports multiple languages including English, German, French, and Spanish...",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"is_disabled": false,
"is_archived": false,
"created_at": "2024-01-16T11:00:00Z",
"updated_at": "2024-01-16T11:00:00Z",
"metadata": {
"source": "documentation",
"category": "features"
}
},
{
"kb_id": "kb_003",
"type": "file",
"file_name": "product_guide.pdf",
"file_id": "file_123",
"content": "Extracted content from the PDF document...",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"is_disabled": false,
"is_archived": false,
"created_at": "2024-01-17T09:15:00Z",
"updated_at": "2024-01-17T09:15:00Z",
"metadata": {
"source": "file_upload",
"file_size": 2048576
}
}
],
"total_count": 3
}

Response Fields

FieldTypeDescription
knowledge_basesarrayArray of knowledge base entry objects matching the filters.
total_countintegerTotal number of knowledge entries matching the filters (before pagination).

Knowledge Base Entry Fields

FieldTypeDescription
kb_idstringUnique identifier of the knowledge base entry.
typestringType of knowledge entry (file, text, qa, link).
questionstringQuestion text (only for Q&A type entries).
contentstringMain content or answer text.
file_namestringName of the file (only for file type entries).
file_idstringIdentifier of the file (only for file type entries).
agent_idstringUUID of the associated AI agent.
is_disabledbooleanWhether the entry is currently disabled.
is_archivedbooleanWhether the entry is archived.
created_atstringISO 8601 timestamp of when the entry was created.
updated_atstringISO 8601 timestamp of the last update.
metadataobjectAdditional metadata associated with the entry.

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"limit"
],
"msg": "ensure this value is less than or equal to 1000",
"type": "value_error.number.not_le"
}
]
}

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
422Validation Error - Invalid request parametersUnprocessable Entity