Skip to main content
POST
/
public
/
v1
/
knowledge-base
/
documents
/
file
Upload document file
curl --request POST \
  --url https://api.callin.io/api/public/v1/knowledge-base/documents/file \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: <api-key>' \
  --form 'groupName=<string>' \
  --form 'files=<string>' \
  --form files.items='@example-file'
{
  "success": true,
  "data": {
    "groupId": "<string>",
    "name": "<string>",
    "documents": [
      {
        "documentId": "<string>",
        "type": "file",
        "name": "<string>",
        "details": {
          "fileUrl": "<string>",
          "fileType": "<string>",
          "fileSize": 123
        },
        "metadata": {
          "createdAt": "2023-11-07T05:31:56Z",
          "createdBy": {
            "userId": "<string>",
            "userEmail": "<string>"
          }
        }
      }
    ],
    "metadata": {
      "allowedMb": 123,
      "usedMb": 123,
      "usedMbAfter": 123,
      "remainingMbAfter": 123
    }
  }
}

Authorizations

x-api-key
string
header
required

Send your Callin API key in the x-api-key header.

Body

multipart/form-data

Upload one or more files into a knowledge group (multipart/form-data). The group is created or matched by groupName.

groupName
string
required

Name of the knowledge group to create or add these documents to.

files
file[]
required

Files to upload. Each file must be PDF (.pdf), Word (.docx), or TSX (.tsx). Maximum 5 MB per file.

Minimum array length: 1

One file: PDF, DOCX, or TSX; max 5 MB.

Response

Document created

After uploading files: new or updated group, created documents, and storage usage (MB).

success
boolean
Example:

true

data
object

The details of the document created