Skip to main content
POST
/
ai-agents
/
agent-builder
/
knowledge-base
/
uploads
/
initiate
Initiate File Uploads
curl --request POST \
  --url https://{appid}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/knowledge-base/uploads/initiate \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "files": [
    {
      "fileName": "document.pdf",
      "mimeType": "application/pdf",
      "fileSize": 1024000
    },
    {
      "fileName": "document_2.pdf",
      "mimeType": "application/pdf",
      "fileSize": 512000
    }
  ]
}
'
{
  "uploads": [
    {
      "uploadId": "550e8400-e29b-41d4-a716-446655440000",
      "fileName": "document.pdf",
      "mimeType": "application/pdf",
      "fileSize": 1024000,
      "s3Key": "my-app-id/uploads/550e8400/document.pdf",
      "presignedUrl": "https://s3.amazonaws.com/bucket/..."
    }
  ]
}

Authorizations

apikey
string
header
required

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

Body

application/json
files
object[]
required

List of files to upload

Response

200 - application/json

Presigned URLs generated and upload records created successfully

uploads
object[]