curl --request POST \
--url https://api.tryhamsa.com/v1/voice-agents/knowledge-base \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"itemName": "Product Documentation",
"itemUrl": "https://example.com/document.pdf",
"type": "TEXT",
"itemUrls": [
"https://example.com/document.pdf"
],
"content": "This is the content of the knowledge base item..."
}
]
}
'{
"success": false,
"message": "success",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"itemName": "Product Documentation",
"fileSize": "2.5MB",
"type": "TEXT",
"status": "PROCESSED",
"failureReason": "File format not supported",
"content": "This is the content of the knowledge base item...",
"itemUrl": "https://example.com/document.pdf",
"itemUrls": [
"https://example.com/document.pdf"
],
"wordsNumber": 1298,
"extension": 1298,
"createdAt": "2024-01-15T10:30:00Z",
"isActive": true,
"used": true
}
}curl --request POST \
--url https://api.tryhamsa.com/v1/voice-agents/knowledge-base \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"itemName": "Product Documentation",
"itemUrl": "https://example.com/document.pdf",
"type": "TEXT",
"itemUrls": [
"https://example.com/document.pdf"
],
"content": "This is the content of the knowledge base item..."
}
]
}
'{
"success": false,
"message": "success",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"itemName": "Product Documentation",
"fileSize": "2.5MB",
"type": "TEXT",
"status": "PROCESSED",
"failureReason": "File format not supported",
"content": "This is the content of the knowledge base item...",
"itemUrl": "https://example.com/document.pdf",
"itemUrls": [
"https://example.com/document.pdf"
],
"wordsNumber": 1298,
"extension": 1298,
"createdAt": "2024-01-15T10:30:00Z",
"isActive": true,
"used": true
}
}Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token
Array of knowledge base items to be created.
1Show child attributes
Was this page helpful?