Skip to main content
POST
/
api
/
v1
/
knowledge-base
/
{kb_id}
/
items
Upload Knowledge Base Item
curl --request POST \
  --url https://api.kollie.ai/api/v1/knowledge-base/{kb_id}/items \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-Key: <api-key>' \
  --form file='@example-file' \
  --form 'name=<string>' \
  --form 'notes=<string>'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Upload Knowledge Base Item

This endpoint allows you to upload a new item (PDF or TXT file) to a knowledge base.

Request

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token for authentication
Content-TypestringYesmultipart/form-data

Path Parameters

NameTypeRequiredDescription
kb_idstringYesThe ID of the knowledge base

Form Data

NameTypeRequiredDescription
filefileYesThe PDF or TXT file to upload
namestringNoCustom name for the item (defaults to filename)

Response

200 OK

{
  "data": {
    "id": "string",
    "name": "string",
    "file_type": "string",
    "status": "string",
    "created_at": "string",
    "updated_at": "string",
    "knowledge_base_id": "string"
  }
}

Response Fields

FieldTypeDescription
idstringUnique identifier for the uploaded item
namestringName of the item
file_typestringType of the file (PDF or TXT)
statusstringCurrent status of the item
created_atstringTimestamp when the item was created
updated_atstringTimestamp when the item was last updated
knowledge_base_idstringID of the knowledge base this item belongs to

Example

curl -X POST 'https://api.kollie.ai/api/v1/knowledge-base/123e4567-e89b-12d3-a456-426614174000/items' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -F '[email protected]' \
  -F 'name=Product Manual'

Authorizations

X-API-Key
string
header
required

Path Parameters

kb_id
string<uuid>
required

Body

multipart/form-data
file
file
required
name
string
required
notes
string | null

Response

Successful Response