Skip to main content
PATCH
/
ai-agents
/
agent-builder
/
agents
/
{agentId}
/
knowledge-base
/
{sourceType}
/
add
Add Files to Agent Knowledge Base
curl --request PATCH \
  --url https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/agents/{agentId}/knowledge-base/{sourceType}/add \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "uniqueIds": [
    "60f7b3b3b3b3b3b3b3b3b3b3",
    "60f7b3b3b3b3b3b3b3b3b3b4"
  ]
}
'

Authorizations

apikey
string
header
required

API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).

Path Parameters

agentId
string
required

Unique identifier of the agent

sourceType
string
required

Source type (uploads, knowledge-base, etc.)

Body

application/json
uniqueIds
string[]
required

Array of file IDs to be added to the knowledge base

Example:
[
"60f7b3b3b3b3b3b3b3b3b3b3",
"60f7b3b3b3b3b3b3b3b3b3b4"
]

Response

Files added to knowledge base successfully