Skip to main content
GET
/
v1
/
voice-agents
/
knowledge-base
/
list
Return a list of Knowledge Base Items.
curl --request GET \
  --url https://api.tryhamsa.com/v1/voice-agents/knowledge-base/list \
  --header 'Authorization: <api-key>'
{
  "success": false,
  "message": "success",
  "data": {
    "total": 100,
    "filtered": 100,
    "items": [
      {
        "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
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '

Query Parameters

voiceAgentId
string

Optional UUID of the voice agent to filter associated knowledge bases items.

Example:

"d949f13f-40d2-4e48-ac86-b66633070603"

isActive
boolean

Optional boolean indicating whether to fetch active knowledge base items.

Example:

true

used
string

Optional boolean-like string indicating whether to fetch used knowledge base items in any voice agent.

Example:

"true"

skip
string

Page number for pagination. Defaults to '1'.

Example:

"1"

take
string

Number of items to take for pagination. Defaults to '10'.

Example:

"10"

A search query to filter knowledge base items' names.

Example:

"Product Catalog"

type
enum<string>[]

An array of knowledge base item type to filter by.

Available options:
TEXT,
URL,
FILE
Example:
["TEXT", "URL"]
status
enum<string>[]

An array of knowledge base item status to filter by.

Available options:
PROCESSED,
FAILED,
COMPLETED_WITH_ERRORS,
UPLOAD_FAILURE,
READING_FAILURE,
INGESTION_FAILURE
Example:
["INGESTION_FAILURE", "PROCESSED"]
extensions
enum<string>[]

An array of knowledge base item extensions to filter by when the type is FILE.

Available options:
pdf,
docx,
doc,
txt,
html,
epub
Example:
["pdf", "txt", "html"]
sortField
enum<string>

The field name to sort the results by

Available options:
words,
createdAt,
fileSize
Example:

"createdAt"

sortOrder
enum<string>

Sort order. Can be 'asc' or 'desc'.

Available options:
asc,
desc
Example:

"asc"

Response

Successful response

success
boolean
default:false
message
string
default:success
data
object