Files

Upload File

Upload the specified file

post
/v1/file/{fileId}/upload

Description

Upload the specified file to the file storage service. The file can be specified either as a HTTP URL, a data URL, a multipart/form-data, or as a raw file stream. There is currently a limit of 4.5MB for files uploaded via all available methods except for direct-to-source uploads when using application/json request body with a file object.

Authorization

ChatBotKit API Secret * Required

HTTP Authorization Scheme: bearer

Path Parameters

fileIdstring* Required

Request Body * Required

Request Body Schema: application/json

import { ChatBotKit } from '@chatbotkit/sdk'

const cbk = new ChatBotKit({

secret: process.env.CHATBOTKIT_API_KEY!

})

const response = await cbk.file.upload(

fileId,
""
)
{
"id":"string",
"uploadRequest":{
"method":"string",
"url":"string",
"headers":"object"
}
}
The file was upload successfully