curl --request PUT \
--url https://api.botpress.cloud/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-bot-id: <x-bot-id>' \
--data '
{
"key": "<string>",
"size": 123,
"tags": {},
"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
},
"stack": "legacy",
"vision": {
"transcribePages": "<unknown>",
"indexPages": "<unknown>"
}
}
},
"accessPolicies": [
"public_content"
],
"contentType": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"publicContentImmediatelyAccessible": true,
"metadata": "<unknown>"
}
'{
"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",
"owner": {
"type": "bot",
"id": "<string>",
"name": "<string>"
},
"uploadUrl": "<string>",
"failedStatusReason": "<string>",
"expiresAt": "<string>",
"indexingStack": "v1"
}
}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.
curl --request PUT \
--url https://api.botpress.cloud/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-bot-id: <x-bot-id>' \
--data '
{
"key": "<string>",
"size": 123,
"tags": {},
"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
},
"stack": "legacy",
"vision": {
"transcribePages": "<unknown>",
"indexPages": "<unknown>"
}
}
},
"accessPolicies": [
"public_content"
],
"contentType": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"publicContentImmediatelyAccessible": true,
"metadata": "<unknown>"
}
'{
"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",
"owner": {
"type": "bot",
"id": "<string>",
"name": "<string>"
},
"uploadUrl": "<string>",
"failedStatusReason": "<string>",
"expiresAt": "<string>",
"indexingStack": "v1"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bot id
Integration id
Integration alias
Integration name
User Id
User Role
Properties of the file to create or update.
Unique key for the file. Must be unique across the bot (and the integration, when applicable).
File size in bytes. This will count against your File Storage quota. If the index parameter is set to true, this will also count against your Vector DB Storage quota.
File tags as an object of key-value pairs. Tag values should be of string (text) type.
Show child attributes
Set to a value of 'true' to index the file in vector storage. Only certain file formats are currently supported for indexing. Files larger than 95 MB cannot be indexed. Note that if a file is indexed, it will count towards both the Vector DB Storage quota and the File Storage quota of the workspace.
Show child attributes
File access policies. Add "public_content" to allow public access to the file content. Add "integrations" to allow read, search and list operations for any integration installed in the bot.
public_content, integrations File content type. If omitted, the content type will be inferred from the file extension (if any) specified in key. If a content type cannot be inferred, the default is "application/octet-stream".
Expiry timestamp in ISO 8601 format with UTC timezone. After expiry, the File will be deleted. Must be in the future. Cannot be more than 90 days from now. The value up to minutes is considered. Seconds and milliseconds are ignored.
Use when your file has "public_content" in its access policy and you need the file's content to be immediately accessible through its URL after the file has been uploaded without having to wait for the upload to be processed by our system.
If set to true, the x-amz-tagging HTTP header with a value of public=true will need to be sent in the HTTP PUT request to the uploadUrl in order for the upload request to work.
Custom metadata for the file expressed as an object of key-value pairs. The values can be of any type.
The created or updated file
Show child attributes
Was this page helpful?