Skip to main content

Process Raw Text for Knowledge Base

Processes raw text input and adds it to the knowledge base for the specified agent.

API Endpoint

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

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/kb/text' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"agent_id": "YOUR_AGENT_ID",
"text": "This is the raw text content to be added to the knowledge base."
}'

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",
"text": "string"
}

Request Body Parameters

FieldTypeRequiredDescription
agent_idstringYesThe unique identifier of the AI agent.
textstringYesThe raw text content to be processed.

Response

Success Response (200 OK)

Returns an object containing the processing status and details.

{
"is_success": true,
"knowledge_id": "kb_abc123",
"detail": "Text processed successfully",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the text processing was successful.
knowledge_idstringUnique identifier for the created knowledge entry.
detailstringSuccess or failure message with additional context.
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