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/..."
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

For the complete error reference, see Error Guide.

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

201 - application/json

Presigned URLs generated and upload records created successfully

uploads
object[]