Skip to main content
GET
/
ai-agents
/
agent-builder
/
knowledge-base
List Knowledge Base Records
curl --request GET \
  --url https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base \
  --header 'apikey: <api-key>'
{
  "data": [
    {
      "uniqueId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "appId": "my-app-id",
      "sourceName": "document.pdf",
      "type": "uploads",
      "status": "indexed",
      "lastSynced": 1700000000000,
      "createdAt": 1700000000000,
      "updatedAt": 1700000000000
    }
  ],
  "meta": {
    "current": {
      "limit": 10,
      "count": 1
    },
    "previous": {
      "affix": "prepend",
      "cursor": "1700000000000.12345"
    },
    "next": {
      "affix": "append",
      "cursor": "1700000000000.12345"
    }
  }
}

Authorizations

apikey
string
header
required

API Key (i.e. Rest API Key from the Dashboard).

Query Parameters

cursor
string

To be used with affix for pagination.

Example:

"1732492800000.12345"

limit
number

Maximum number of results to return per page.

Example:

20

affix
enum<string>

To paginate over results, use the value of affix as prepend or append.

Available options:
append,
prepend
start
number
required
end
number
required
endTime
number

End timestamp (Unix timestamp in milliseconds) to filter records created before this time

Example:

1732579200000

startTime
number

Start timestamp (Unix timestamp in milliseconds) to filter records created after this time

Example:

1732492800000

Response

200 - application/json

Knowledge base records retrieved successfully with pagination metadata

data
object[]

Array of knowledge base records (excludes _id, __v, paginationKey)

meta
object

Pagination metadata for navigation