curl --request PUT \
--url https://api.botpress.cloud/v1/files/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-bot-id: <x-bot-id>' \
--data '
{
"metadata": "<unknown>",
"tags": {},
"accessPolicies": [
"integrations"
],
"expiresAt": "2023-11-07T05:31:56Z"
}
'{
"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>"
},
"failedStatusReason": "<string>",
"expiresAt": "<string>",
"indexingStack": "v1"
}
}Update file metadata, without updating the file content.
curl --request PUT \
--url https://api.botpress.cloud/v1/files/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-bot-id: <x-bot-id>' \
--data '
{
"metadata": "<unknown>",
"tags": {},
"accessPolicies": [
"integrations"
],
"expiresAt": "2023-11-07T05:31:56Z"
}
'{
"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>"
},
"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
File ID or Key
File metadata to update.
Custom metadata for the file expressed as an object of key-value pairs. Omit to keep existing metadata intact. Any existing metadata keys not included will be preserved. New keys will be added. To delete a metadata key, set its value to null.
The file tags to update as an object of key-value pairs with string (text) values. Omit to keep existing tags intact. Any existing tags not included will be preserved. New tags will be added. To delete a tag, set its value to null.
Show child attributes
1000New access policies to set for the file. Omit to keep existing policies intact.
integrations, public_content 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. Omit to keep the existing expiry intact. Set to null to remove the expiry.
An object containing the updated file metadata.
Show child attributes
File ID
The ID of the bot the file belongs to
Unique key for the file. Must be unique across the bot (and the integration, when applicable).
URL to retrieve the file content. This URL will be ready to use once the file is uploaded.
If the file has a public_content policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe.
File size in bytes. Non-null if file upload status is "COMPLETE".
MIME type of the file's content
File creation timestamp in ISO 8601 format
File last update timestamp in ISO 8601 format
Access policies configured for the file.
integrations, public_content Whether the file was requested to be indexed for search or not.
Status of the file. If the status is upload_pending, the file content has not been uploaded yet. The status will be set to upload_completed once the file content has been uploaded successfully.
If the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to upload_failed and the reason for the failure will be available in the failedStatusReason field of the file.
However, if the file has been uploaded and the index attribute was set to true on the file, the status will immediately transition to the indexing_pending status (the upload_completed status step will be skipped).
Once the indexing is completed and the file is ready to be used for searching its status will be set to indexing_completed. If the indexing failed the status will be set to indexing_failed and the reason for the failure will be available in the failedStatusReason field.
upload_pending, upload_failed, upload_completed, indexing_pending, indexing_failed, indexing_completed Show child attributes
bot, integration, user This field is present if type is "user" or "bot". If type is "user", this is the user ID. If type is "bot", this is the bot ID.
This field is present if the type is "integration". If type is "integration", this is the integration name.
If the file status is upload_failed or indexing_failed this will contain the reason of the failure.
File expiry timestamp in ISO 8601 format
Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of "v2" denotes the latest stack, "v1" denotes the legacy stack.
v1, v2 Was this page helpful?