Chat API
- Introduction
- Endpoints
Admin API
- Getting started
- Concepts
- Endpoints
Files API
Tables API
- Getting Started
- Endpoints
Runtime API
- Getting Started
- Concepts
- Endpoints
upsertFile
Creates or updates a file using the key
parameter as unique identifier. Updating a file will erase the existing content of the file. Upload the file content by sending it in a PUT request to the uploadUrl
returned in the response.
PUT
/
v1
/
files
curl --request PUT \
--url https://api.botpress.cloud/v1/files \
--header 'Content-Type: application/json' \
--data '{
"key": "<string>",
"tags": {},
"size": 123,
"index": false,
"indexing": {
"configuration": {
"parsing": {
"minimumParagraphLength": 1025,
"smartCleanup": true
},
"chunking": {
"maximumChunkLength": 2550,
"embeddedContextLevels": 1,
"embedBreadcrumb": true
},
"summarization": {
"enable": false,
"modelType": "balanced",
"minimumInputLength": 5500,
"outputTokenLimit": 5500,
"generateMasterSummary": true
},
"vision": {
"transcribePages": "<any>",
"indexPages": "<any>"
}
}
},
"accessPolicies": [
"public_content"
],
"contentType": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"publicContentImmediatelyAccessible": true,
"metadata": "<any>"
}'
{
"file": {
"id": "<string>",
"botId": "<string>",
"key": "<string>",
"url": "<string>",
"size": 123,
"contentType": "<string>",
"tags": {},
"metadata": {},
"createdAt": "<string>",
"updatedAt": "<string>",
"accessPolicies": [
"integrations"
],
"index": true,
"status": "upload_pending",
"failedStatusReason": "<string>",
"expiresAt": "<string>",
"uploadUrl": "<string>"
}
}
Body
application/json
Properties of the file to create or update.
The body is of type object
.
Response
200
application/json
The created or updated file
The response is of type object
.
Was this page helpful?
curl --request PUT \
--url https://api.botpress.cloud/v1/files \
--header 'Content-Type: application/json' \
--data '{
"key": "<string>",
"tags": {},
"size": 123,
"index": false,
"indexing": {
"configuration": {
"parsing": {
"minimumParagraphLength": 1025,
"smartCleanup": true
},
"chunking": {
"maximumChunkLength": 2550,
"embeddedContextLevels": 1,
"embedBreadcrumb": true
},
"summarization": {
"enable": false,
"modelType": "balanced",
"minimumInputLength": 5500,
"outputTokenLimit": 5500,
"generateMasterSummary": true
},
"vision": {
"transcribePages": "<any>",
"indexPages": "<any>"
}
}
},
"accessPolicies": [
"public_content"
],
"contentType": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"publicContentImmediatelyAccessible": true,
"metadata": "<any>"
}'
{
"file": {
"id": "<string>",
"botId": "<string>",
"key": "<string>",
"url": "<string>",
"size": 123,
"contentType": "<string>",
"tags": {},
"metadata": {},
"createdAt": "<string>",
"updatedAt": "<string>",
"accessPolicies": [
"integrations"
],
"index": true,
"status": "upload_pending",
"failedStatusReason": "<string>",
"expiresAt": "<string>",
"uploadUrl": "<string>"
}
}